Improve spacing of registration form, and add instructions to the password field.

This commit is contained in:
Neil Lalonde 2013-12-16 17:31:05 -05:00
parent 2326d4ceb7
commit 7fb985a02e
5 changed files with 34 additions and 7 deletions

View File

@ -30,6 +30,10 @@ Discourse.CreateAccountController = Discourse.Controller.extend(Discourse.ModalF
return this.blank('authOptions.auth_provider'); return this.blank('authOptions.auth_provider');
}.property('authOptions.auth_provider'), }.property('authOptions.auth_provider'),
passwordInstructions: function() {
return I18n.t('user.password.instructions', {count: 6}); // TODO: soon to be configurable
}.property(),
// Validate the name // Validate the name
nameValidation: function() { nameValidation: function() {

View File

@ -3,50 +3,54 @@
<div> <div>
<form> <form>
<table> <table>
<tr> <tr class="input">
<td style="width:80px"><label for='new-account-name'>{{i18n user.name.title}}</label></td> <td style="width:80px"><label for='new-account-name'>{{i18n user.name.title}}</label></td>
<td style="width:496px"> <td style="width:496px">
{{textField value=accountName id="new-account-name" autofocus="autofocus"}} {{textField value=accountName id="new-account-name" autofocus="autofocus"}}
&nbsp;{{inputTip validation=nameValidation}} &nbsp;{{inputTip validation=nameValidation}}
</td> </td>
</tr> </tr>
<tr> <tr class="instructions">
<td></td> <td></td>
<td><label>{{i18n user.name.instructions}}</label></td> <td><label>{{i18n user.name.instructions}}</label></td>
</tr> </tr>
<tr> <tr class="input">
<td><label for='new-account-email'>{{i18n user.email.title}}</label></td> <td><label for='new-account-email'>{{i18n user.email.title}}</label></td>
<td> <td>
{{input value=accountEmail id="new-account-email"}} {{input value=accountEmail id="new-account-email"}}
&nbsp;{{inputTip validation=emailValidation}} &nbsp;{{inputTip validation=emailValidation}}
</td> </td>
</tr> </tr>
<tr> <tr class="instructions">
<td></td> <td></td>
<td><label>{{i18n user.email.instructions}}</label></td> <td><label>{{i18n user.email.instructions}}</label></td>
</tr> </tr>
<tr> <tr class="input">
<td><label for='new-account-username'>{{i18n user.username.title}}</label></td> <td><label for='new-account-username'>{{i18n user.username.title}}</label></td>
<td> <td>
{{input value=accountUsername id="new-account-username" maxlength="15"}} {{input value=accountUsername id="new-account-username" maxlength="15"}}
&nbsp;{{inputTip validation=usernameValidation}} &nbsp;{{inputTip validation=usernameValidation}}
</td> </td>
</tr> </tr>
<tr> <tr class="instructions">
<td></td> <td></td>
<td><label>{{i18n user.username.instructions}}</label></td> <td><label>{{i18n user.username.instructions}}</label></td>
</tr> </tr>
{{#if passwordRequired}} {{#if passwordRequired}}
<tr> <tr class="input">
<td><label for='new-account-password'>{{i18n user.password.title}}</label></td> <td><label for='new-account-password'>{{i18n user.password.title}}</label></td>
<td> <td>
{{input type="password" value=accountPassword id="new-account-password"}} {{input type="password" value=accountPassword id="new-account-password"}}
&nbsp;{{inputTip validation=passwordValidation}} &nbsp;{{inputTip validation=passwordValidation}}
</td> </td>
</tr> </tr>
<tr class="instructions">
<td></td>
<td><label>{{passwordInstructions}}</label></td>
</tr>
{{/if}} {{/if}}
<tr class="password-confirmation"> <tr class="password-confirmation">

View File

@ -9,6 +9,7 @@
Discourse.CreateAccountView = Discourse.ModalBodyView.extend({ Discourse.CreateAccountView = Discourse.ModalBodyView.extend({
templateName: 'modal/create_account', templateName: 'modal/create_account',
title: I18n.t('create_account.title'), title: I18n.t('create_account.title'),
classNames: ['create-account'],
didInsertElement: function(e) { didInsertElement: function(e) {

View File

@ -23,4 +23,21 @@
#new-account-link { #new-account-link {
cursor: pointer; cursor: pointer;
}
.create-account {
tr.input {
td {
padding-top: 10px;
}
input, label {
margin-bottom: 0;
}
}
tr.instructions {
label {
color: #888;
}
}
} }

View File

@ -351,6 +351,7 @@ en:
title: "Password" title: "Password"
too_short: "Your password is too short." too_short: "Your password is too short."
ok: "Your password looks good." ok: "Your password looks good."
instructions: "Must be at least %{count} characters."
ip_address: ip_address:
title: "Last IP Address" title: "Last IP Address"