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

Commit

Permalink
Merge pull request #190 from cfpb/no-default
Browse files Browse the repository at this point in the history
No default
  • Loading branch information
wpears authored Nov 16, 2017
2 parents f803c4e + c081708 commit 4f5b306
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion keycloak/themes/hmda/login/messages/messages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ invalidPasswordRegexPatternMessage=• Invalid password: fails to match rege
invalidPasswordHistoryMessage=• Invalid password: must not be equal to any of last {0} passwords.
invalidPasswordGenericMessage=• Invalid password: new password doesn''t match password policies
loginTimeout=• Sorry, you took too long to log in. The login process has restarted, please try again.
hmdaEnterEmailAddress=• To register as a filer for more than one institution, you may select multiple institutions from the list of available institutions based on your email domain. If one or more institutions is not available in the list based on your email domain, contact {0} for assistance with registering for the additional institution(s).
hmdaEnterEmailAddress=After entering your email address, please be sure to select all available institutions you wish to file on behalf of. You may select more than one.
staleEmailVerificationLink=• The link to verify your HMDA account registration appears to have been visited. Try logging in using the button below.
expiredCodeMessage=• Your login has timed out. Please log in again.
staleCodeMessage=• This page is no longer valid. Please log in again.
Expand Down
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
21 changes: 9 additions & 12 deletions keycloak/themes/hmda/login/resources/js/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +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 checked = institutions.length === 1 ? 'checked' : ''
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 All @@ -22,9 +25,7 @@
institutions[i].id +
'" name="institutions" value="' +
institutions[i].id +
'"' +
checked +
'>' +
'">' +
'<label for="' +
institutions[i].id +
'">' +
Expand Down Expand Up @@ -74,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 @@ -147,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 4f5b306

Please sign in to comment.