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');
}.property('authOptions.auth_provider'),
passwordInstructions: function() {
return I18n.t('user.password.instructions', {count: 6}); // TODO: soon to be configurable
}.property(),
// Validate the name
nameValidation: function() {

View File

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

View File

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

View File

@ -23,4 +23,21 @@
#new-account-link {
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"
too_short: "Your password is too short."
ok: "Your password looks good."
instructions: "Must be at least %{count} characters."
ip_address:
title: "Last IP Address"