Improved password reset screens, added missing translations.
This commit is contained in:
parent
bbefa26980
commit
e3604b4cec
3 changed files with 34 additions and 23 deletions
|
@ -4,9 +4,9 @@ class Index extends App.Controller
|
||||||
className: 'container'
|
className: 'container'
|
||||||
|
|
||||||
events:
|
events:
|
||||||
'submit form': 'submit'
|
'submit form': 'submit'
|
||||||
'click .submit': 'submit'
|
'click .submit': 'submit'
|
||||||
'click .retry': 'rerender'
|
'click .retry': 'rerender'
|
||||||
|
|
||||||
constructor: ->
|
constructor: ->
|
||||||
super
|
super
|
||||||
|
@ -17,26 +17,27 @@ class Index extends App.Controller
|
||||||
|
|
||||||
@render()
|
@render()
|
||||||
|
|
||||||
render: ->
|
render: (params) ->
|
||||||
configure_attributes = [
|
configure_attributes = [
|
||||||
{ name: 'username', display: 'Enter your username or email address:', tag: 'input', type: 'text', limit: 100, null: false, class: 'input span4', },
|
{ name: 'username', display: 'Enter your username or email address', tag: 'input', type: 'text', limit: 100, null: false, class: 'input span4', },
|
||||||
]
|
]
|
||||||
|
|
||||||
@html App.view('reset_password')()
|
@html App.view('reset_password')(params)
|
||||||
|
|
||||||
new App.ControllerForm(
|
@form = new App.ControllerForm(
|
||||||
el: @el.find('#form-password')
|
el: @el.find('#form-password-item')
|
||||||
model: { configure_attributes: configure_attributes }
|
model: { configure_attributes: configure_attributes }
|
||||||
autofocus: true
|
autofocus: true
|
||||||
)
|
)
|
||||||
|
|
||||||
rerender: (e) ->
|
rerender: (e) ->
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
@render()
|
@el.find('#form-password').show()
|
||||||
|
|
||||||
submit: (e) ->
|
submit: (e) ->
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
params = @formParam(e.target)
|
params = @formParam(e.target)
|
||||||
|
@formDisable(e)
|
||||||
|
|
||||||
# get data
|
# get data
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
|
@ -50,16 +51,15 @@ class Index extends App.Controller
|
||||||
)
|
)
|
||||||
|
|
||||||
success: (data, status, xhr) =>
|
success: (data, status, xhr) =>
|
||||||
@html App.view('generic/hero_message')(
|
@render( sent: true )
|
||||||
head: 'We\'ve sent password reset instructions to your email address'
|
@el.find('#form-password').hide()
|
||||||
message: 'If you don\'t receive instructions within a minute or two, check your email\'s spam and junk filters, or try <a href="#" class="retry">resending your request</a>.'
|
|
||||||
)
|
|
||||||
|
|
||||||
error: (data, status, xhr) =>
|
error: (data, status, xhr) =>
|
||||||
@html App.view('generic/hero_message')(
|
@notify(
|
||||||
head: 'Problem'
|
type: 'error'
|
||||||
message: 'Username or email address invalid, please go back and try <a href="#" class="retry">again</a>.'
|
msg: App.i18n.translateContent( 'Username or email address invalid, please try again.' )
|
||||||
)
|
)
|
||||||
|
@formEnable( @el.find('#form-password') )
|
||||||
|
|
||||||
App.Config.set( 'reset_password', Index, 'Routes' )
|
App.Config.set( 'reset_password', Index, 'Routes' )
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,18 @@
|
||||||
<div class="hero-unit">
|
<div class="hero-unit">
|
||||||
<h2><%- @T( 'Forgot your password?' ) %><small></small></h2>
|
<% if @sent: %>
|
||||||
<div class="container">
|
<h2><%- @T('We\'ve sent password reset instructions to your email address.') %><small></small></h2>
|
||||||
<form>
|
<div class="container">
|
||||||
<p id="form-password"></p>
|
<p><%- @T('If you don\'t receive instructions within a minute or two, check your email\'s spam and junk filters, or try resending your request.') %></p>
|
||||||
<a href="#/" class="btn cancel"><%- @T( 'Cancel' ) %></a>
|
<a href="#" class="retry">» <%- @T('again') %> «</a>
|
||||||
<button class="btn btn-primary submit"><%- @T( 'Submit' ) %></button>
|
</div>
|
||||||
</form>
|
<% end %>
|
||||||
|
<div id="form-password">
|
||||||
|
<h2><%- @T( 'Forgot your password?' ) %><small></small></h2>
|
||||||
|
<div class="container">
|
||||||
|
<form id="form-password-item">
|
||||||
|
<a href="#/" class="btn cancel"><%- @T( 'Cancel' ) %></a>
|
||||||
|
<button class="btn btn-primary submit"><%- @T( 'Submit' ) %></button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -1757,5 +1757,8 @@ Translation.create( :locale => 'de', :source => "Enter your username or email ad
|
||||||
Translation.create( :locale => 'de', :source => "Choose your new password.", :target => "Wählen Sie Ihr neues Passwort.", :updated_by_id => 1, :created_by_id => 1 )
|
Translation.create( :locale => 'de', :source => "Choose your new password.", :target => "Wählen Sie Ihr neues Passwort.", :updated_by_id => 1, :created_by_id => 1 )
|
||||||
Translation.create( :locale => 'de', :source => "Woo hoo! Your password has been changed!", :target => "Vielen Dank, Ihr Passwort wurde geändert!", :updated_by_id => 1, :created_by_id => 1 )
|
Translation.create( :locale => 'de', :source => "Woo hoo! Your password has been changed!", :target => "Vielen Dank, Ihr Passwort wurde geändert!", :updated_by_id => 1, :created_by_id => 1 )
|
||||||
Translation.create( :locale => 'de', :source => "Please try to login!", :target => "Bitte melden Sie sich nun an!", :updated_by_id => 1, :created_by_id => 1 )
|
Translation.create( :locale => 'de', :source => "Please try to login!", :target => "Bitte melden Sie sich nun an!", :updated_by_id => 1, :created_by_id => 1 )
|
||||||
|
Translation.create( :locale => 'de', :source => "Username or email address invalid, please try again.", :target => "Benutzername oder E-Mail-Addresse ungültig, bitte erneut versuchen.", :updated_by_id => 1, :created_by_id => 1 )
|
||||||
|
Translation.create( :locale => 'de', :source => "If you don\'t receive instructions within a minute or two, check your email\'s spam and junk filters, or try resending your request.", :target => "Wir hanben die Andorderung per E-Mail an Sie versendet, bitte Überprüfen Sie Ihr Email-Postfach (auch die Junk E-Mails) ggf. starten Sie eine Andorderung erneut.", :updated_by_id => 1, :created_by_id => 1 )
|
||||||
|
Translation.create( :locale => 'de', :source => "again", :target => "erneut", :updated_by_id => 1, :created_by_id => 1 )
|
||||||
|
|
||||||
#Translation.create( :locale => 'de', :source => "", :target => "" )
|
#Translation.create( :locale => 'de', :source => "", :target => "", :updated_by_id => 1, :created_by_id => 1 )
|
||||||
|
|
Loading…
Reference in a new issue