This commit is contained in:
Nick Chapman 2014-01-14 16:52:28 -08:00
Родитель 51d59c0fbd
Коммит 7371a707ff
5 изменённых файлов: 20 добавлений и 38 удалений

Просмотреть файл

@ -1,7 +1,7 @@
<header> <header>
<h1 id='fxa-complete-reset-password-header'>{{#t}}Firefox Accounts{{/t}}</h1> <h1 id='fxa-complete-reset-password-header'>{{#t}}Firefox Accounts{{/t}}</h1>
<h2>{{#t}}Please create a new password{{/t}}</h2> <h2>{{#t}}Reset password{{/t}}</h2>
</header> </header>
<section> <section>
@ -17,8 +17,7 @@
</div> </div>
<div class="button-row"> <div class="button-row">
<button type="submit">{{#t}}Next &gt;{{/t}}</button> <button type="submit">{{#t}}Next{{/t}}</button>
</div> </div>
</form> </form>
</section> </section>

Просмотреть файл

@ -1,26 +1,17 @@
<header> <header>
<h1 id="fxa-confirm-reset-password-header">{{#t}}Firefox Accounts{{/t}}</h1> <h1 id="fxa-confirm-reset-password-header">{{#t}}Firefox Accounts{{/t}}</h1>
<h2>{{#t}}Password Reset Email Sent{{/t}}</h2> <h2>{{#t}}Reset email sent{{/t}}</h2>
</header> </header>
<section> <section>
<div class="error"></div> <div class="error"></div>
<div class="placeholder email-placeholder"> <img src="/images/graphic_mail.png" alt="Email" width="150" class="graphic" />
{{#t}}Email{{/t}}
</div>
<p>{{#t}}Your password reset link awates at:{{/t}} <p>{{#t}}A reset link has been sent to:{{/t}}<br/><strong>{{email}}.</strong></p>
<br/>
<strong>{{email}}.</strong>
</p>
<div class="links"> <div class="links">
{{#t}}Email not arriving?{{/t}} <a>{{#t}}Send again{{/t}}</a> <a>{{#t}}Email not showing up? Send again{{/t}}</a>
</div> </div>
</section> </section>
<footer>
</footer>

Просмотреть файл

@ -8,27 +8,19 @@
<div class="error"></div> <div class="error"></div>
<form> <form>
<label for="email"> <p>{{#t}}Enter your email address, and we'll email you instructions on how to reset your password{{/t}}</p>
{{#t}}Enter your email address, and we'll email you instructions on how to reset your password{{/t}}
</label>
<div class="input-row"> <div class="input-row">
<input name="email" type="email" class="email" placeholder="{{#t}}Email{{/t}}"> <input name="email" type="email" class="email" placeholder="{{#t}}Email{{/t}}">
</div> </div>
<div class="button-row"> <div class="button-row">
<button type="submit">{{#t}}Submit{{/t}}</button> <button type="submit" disabled>{{#t}}Submit{{/t}}</button>
</div> </div>
</form> </form>
<div class="links"> <div class="links">
<a href="/signin">{{#t}}Sign In{{/t}}</a> <a href="/signin" class="left">{{#t}}Sign in{{/t}}</a>
<a href="/signup" class="right">{{#t}}Create an account{{/t}}</a>
<a href="/signup">{{#t}}Create Account{{/t}}</a>
</div> </div>
</section> </section>
<footer>
</footer>

Просмотреть файл

@ -1,22 +1,17 @@
<header> <header>
<h1 id='fxa-reset-password-complete-header'>{{#t}}Firefox Accounts{{/t}}</h1> <h1 id='fxa-reset-password-complete-header'>{{#t}}Firefox Accounts{{/t}}</h1>
<h2>{{#t}}Password Reset!{{/t}}</h2> <h2>{{#t}}Password reset{{/t}}</h2>
</header> </header>
<section> <section>
<div class="error"></div> <div class="error"></div>
<img src="/images/graphic_checkbox.png" width="150" class="graphic" />
{{#redirectTo}} {{#redirectTo}}
<p> <p>{{#t}}Continue to{{/t}} {{ service }} {{#t}}on the <strong>Initial Client</strong>.{{/t}}</p>
{{#t}}Continue to{{/t}} {{ service }} {{#t}}on the <strong>Initial Client</strong>.{{/t}}
</p>
<a href="{{ redirectTo }}">Continue</a> <a href="{{ redirectTo }}">Continue</a>
{{/redirectTo}} {{/redirectTo}}
</section> </section>
<footer>
</footer>

Просмотреть файл

@ -17,13 +17,14 @@ function (_, BaseView, Template, FxaClient, Session) {
className: 'reset_password', className: 'reset_password',
events: { events: {
'submit form': 'requestPasswordReset' 'submit form': 'requestPasswordReset',
'keyup input': 'enableButtonWhenValid'
}, },
requestPasswordReset: function (event) { requestPasswordReset: function (event) {
event.preventDefault(); event.preventDefault();
if (! this._validateEmail()) { if (! this.isValid()) {
return; return;
} }
@ -36,6 +37,10 @@ function (_, BaseView, Template, FxaClient, Session) {
}, },
isValid: function () {
return this._validateEmail();
},
_onRequestResetSuccess: function () { _onRequestResetSuccess: function () {
Session.email = this._getEmail(); Session.email = this._getEmail();
router.navigate('confirm_reset_password', { trigger: true }); router.navigate('confirm_reset_password', { trigger: true });