-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show Google Form feedback modal on Area and Explore pages
Markup, styling, and JavaScript handling for feedback modal that only gets shown on Area and Explore pages if the user hasn’t already skipped or submitted it. Form is submitted, via Ajax, to a Google Form. As part of this, I reused and refactored the CollapsableMailingListForm from the Area page, into a general setUpCollapsable function. I also fixed a bug where the "shared" JavaScript in home-out-esm.js (such as the `.form-check + .conditional-fields` handling) wasn’t being loaded on Area or Explore pages. I guess, really, we should either rename home-out-esm.js to shared-out-esm.js, or we should break out the parts that are intended to be used on other pages, and leave home-out-esm.js for homepage-only stuff. And since the feedback form gathers some personal information, I’ve updated the Privacy Policy to explain that.
- Loading branch information
Showing
15 changed files
with
324 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
.feedback-modal { | ||
--#{$prefix}modal-padding: 2rem; | ||
--#{$prefix}modal-width: 550px; | ||
|
||
@include media-breakpoint-up('lg') { | ||
--#{$prefix}modal-padding: 2.5rem; | ||
--#{$prefix}modal-width: 600px; | ||
@include font-size(1.125rem); | ||
} | ||
|
||
.modal-header { | ||
border-bottom: none; | ||
align-items: center; | ||
padding: var(--#{$prefix}modal-padding) var(--#{$prefix}modal-padding) 0 var(--#{$prefix}modal-padding); | ||
} | ||
|
||
.modal-body { | ||
padding: 1rem var(--#{$prefix}modal-padding); | ||
} | ||
|
||
.modal-footer { | ||
border-top: none; | ||
justify-content: flex-start; | ||
padding: 0 var(--#{$prefix}modal-padding) var(--#{$prefix}modal-padding) var(--#{$prefix}modal-padding); | ||
|
||
& > * { | ||
margin: 0; | ||
} | ||
} | ||
|
||
.close { | ||
padding: 1rem 1rem; | ||
margin: -1rem -1rem -1rem auto; | ||
background: transparent; | ||
border: none; | ||
color: $text-muted; | ||
font-size: 1rem; | ||
} | ||
|
||
legend { | ||
font-size: 1em; // match paragraphs | ||
margin-bottom: 1em; // match paragraphs | ||
} | ||
|
||
.form-check { | ||
margin-bottom: 0.25em; | ||
} | ||
} | ||
|
||
.conditional-fields { | ||
border-left: 4px solid $gray-400; | ||
padding-left: 1rem; | ||
margin-left: 0.4em; | ||
margin-top: 1rem; | ||
margin-bottom: 1rem; | ||
} | ||
|
||
.team-avatars { | ||
display: flex; | ||
margin: 0 -4px 1rem -4px; | ||
} | ||
|
||
.team-avatars__person { | ||
display: flex; | ||
align-items: center; | ||
margin-right: -10px; | ||
|
||
img { | ||
width: 60px; | ||
height: 60px; | ||
border-radius: 30px; | ||
border: 4px solid #fff; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,3 +66,4 @@ | |
@import "accounts"; | ||
@import "landing-page"; | ||
@import "print"; | ||
@import "feedback-modal"; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import $ from 'jquery/dist/jquery.slim' | ||
import Collapse from 'bootstrap/js/dist/collapse' | ||
|
||
const setUpCollapsable = function(targets, triggers, triggerEvents, showTest) { | ||
var instances = []; | ||
var $targets = $(targets); // targets can either be a jQuery object or selector(s) | ||
var $triggers = $(triggers); // triggers can either be a jQuery object or selector(s) | ||
|
||
var updateUI = function() { | ||
var show = showTest($targets, $triggers); | ||
$.each(instances, function(i, instance){ | ||
show ? instance.show() : instance.hide(); | ||
}); | ||
}; | ||
|
||
$targets.addClass('collapse').each(function(){ | ||
instances.push(new Collapse(this, { toggle: false})); | ||
}); | ||
|
||
$triggers.on(triggerEvents, function(){ | ||
updateUI(); | ||
}); | ||
|
||
updateUI(); | ||
} | ||
|
||
export default setUpCollapsable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
import Collapse from 'bootstrap/js/dist/collapse' | ||
|
||
import exploreApp from './explore.esm.js' | ||
exploreApp.mount('#exploreApp') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.