Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Commit

Permalink
remove instituions completely at start and only adds it when needed; …
Browse files Browse the repository at this point in the history
…with correct label and warnings
  • Loading branch information
awolfe76 committed Nov 16, 2017
1 parent 984e4d3 commit c081708
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
5 changes: 1 addition & 4 deletions keycloak/themes/hmda/login/register.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@
<span class="usa-form-hint">The provided email address will be used to notify you of any HMDA related technology updates.</span>
<input type="text" id="email" name="email" value="${(register.formData.email!'')?html}" />

<label>Select your institutions</label>
<div id="institutions">
<span class="usa-input-help-message">${msg("hmdaEnterEmailAddress", (properties.supportEmailTo!''))}</span>
</div>
<div id="institutions"></div>

<input id="user.attributes.institutions" name="user.attributes.institutions" class="usa-skipnav" hidden style="display:none;"/>

Expand Down
16 changes: 8 additions & 8 deletions keycloak/themes/hmda/login/resources/js/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@

//Given a list of institutions, return an html list of description lists for each
function createInstitutions(institutions) {
var html = '<ul class="usa-unstyled-list">'
var labelContent = 'Select your institution'
if(institutions.length > 1) {
labelContent = 'Select all available institutions you wish to file for. You may select more than one.'
}
var html = '<label>' + labelContent + '</label><ul class="usa-unstyled-list">'

for (var i = 0; i < institutions.length; i++) {
html =
Expand Down Expand Up @@ -71,9 +75,9 @@
404: function() {
$('#institutions').html(
'<span class="hmda-error-message">' +
"Sorry, we couldn't find that email domain. Please contact " +
"Sorry, we couldn't find that email domain. For help getting registered, please contact " +
getEmailLink() +
' for help getting registered.</span>'
' and provide your institution name plus one other identifier (RSSD, tax ID, NMLS ID, etc).</span>'
)
}
},
Expand Down Expand Up @@ -144,11 +148,7 @@

// keycode (tab key) used to not warn when first tabbing into the email field
if ((emailVal === '' || emailVal === null) && e.keyCode !== 9) {
$('#institutions').html(
'<span class="hmda-error-message">' +
HMDA.enterEmailMessage +
'</span>'
)
$('#institutions').html('')
} else {
// e.keyCode will be 'undefined' on tab key
// don't make the API call on tab keyup
Expand Down

0 comments on commit c081708

Please sign in to comment.