Fixed login -> reset password -> go back
This commit is contained in:
parent
e6cf28b222
commit
74e548fedb
7 changed files with 32 additions and 42 deletions
|
@ -20,21 +20,25 @@ class Index extends App.ControllerContent
|
|||
url: '/auth/facebook',
|
||||
name: 'Facebook',
|
||||
config: 'auth_facebook',
|
||||
class: 'facebook',
|
||||
},
|
||||
twitter: {
|
||||
url: '/auth/twitter',
|
||||
name: 'Twitter',
|
||||
config: 'auth_twitter',
|
||||
class: 'twitter',
|
||||
},
|
||||
linkedin: {
|
||||
url: '/auth/linkedin',
|
||||
name: 'LinkedIn',
|
||||
config: 'auth_linkedin',
|
||||
class: 'linkedin',
|
||||
},
|
||||
google_oauth2: {
|
||||
url: '/auth/google_oauth2',
|
||||
name: 'Google',
|
||||
config: 'auth_google_oauth2',
|
||||
class: 'google',
|
||||
},
|
||||
}
|
||||
auth_providers = []
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
class Index extends App.ControllerContent
|
||||
className: 'reset_password fit'
|
||||
|
||||
events:
|
||||
'submit form': 'submit'
|
||||
'click .submit': 'submit'
|
||||
'click .retry': 'rerender'
|
||||
'click .retry': 'retry'
|
||||
|
||||
constructor: ->
|
||||
super
|
||||
|
@ -28,14 +26,14 @@ class Index extends App.ControllerContent
|
|||
@html App.view('password/reset')(params)
|
||||
|
||||
@form = new App.ControllerForm(
|
||||
el: @el.find('#form-password-item')
|
||||
el: @el.find('.form-password-item')
|
||||
model: { configure_attributes: configure_attributes }
|
||||
autofocus: true
|
||||
)
|
||||
|
||||
rerender: (e) ->
|
||||
retry: (e) ->
|
||||
e.preventDefault()
|
||||
@el.find('#form-password').show()
|
||||
@render()
|
||||
|
||||
submit: (e) ->
|
||||
e.preventDefault()
|
||||
|
@ -55,20 +53,17 @@ class Index extends App.ControllerContent
|
|||
|
||||
success: (data, status, xhr) =>
|
||||
@render( sent: true )
|
||||
@el.find('#form-password').hide()
|
||||
|
||||
error: (data, status, xhr) =>
|
||||
@notify(
|
||||
type: 'error'
|
||||
msg: App.i18n.translateContent( 'Username or email address invalid, please try again.' )
|
||||
)
|
||||
@formEnable( @el.find('#form-password') )
|
||||
@formEnable( @el.find('.form-password') )
|
||||
|
||||
App.Config.set( 'reset_password', Index, 'Routes' )
|
||||
|
||||
class Verify extends App.ControllerContent
|
||||
className: 'container'
|
||||
|
||||
events:
|
||||
'submit form': 'submit'
|
||||
'click .submit': 'submit'
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
class Index extends App.ControllerContent
|
||||
className: 'signup fit'
|
||||
|
||||
events:
|
||||
'submit form': 'submit'
|
||||
'click .submit': 'submit'
|
||||
|
|
|
@ -18,31 +18,23 @@
|
|||
<button class="btn btn-primary" type="submit"><%- @T( 'Sign in' ) %></button>
|
||||
|
||||
<% if @C('user_lost_password'): %>
|
||||
<a href="#reset_password" class="subtle-link standalone pull-right"><%- @T( 'Forgot password?' ) %></a>
|
||||
<a href="#reset_password" class="subtle-link standalone pull-right"><%- @T( 'Forgot password?' ) %></a>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% if true or !_.isEmpty( @auth_providers ): %>
|
||||
<% if !_.isEmpty( @auth_providers ): %>
|
||||
<div class="separator">
|
||||
<span class="separator-text"><%- @T( 'or sign in using' ) %></span>
|
||||
</div>
|
||||
|
||||
<div class="auth_providers horizontal stretch">
|
||||
<!--<% for auth_provider in @auth_providers: %>
|
||||
<li><a href="<%= auth_provider.url %>"><%- @T( auth_provider.name ) %></a></li>
|
||||
<% end %>-->
|
||||
<a class="auth_provider facebook horizontal">
|
||||
<span class="provider_icon"></span>
|
||||
<span class="provider_name flex">Facebook</span>
|
||||
</a>
|
||||
<a class="auth_provider google horizontal">
|
||||
<span class="provider_icon"></span>
|
||||
<span class="provider_name flex">Google+</span>
|
||||
</a>
|
||||
<a class="auth_provider twitter horizontal">
|
||||
<span class="provider_icon"></span>
|
||||
<span class="provider_name flex">Twitter</span>
|
||||
</a>
|
||||
<% for auth_provider in @auth_providers: %>
|
||||
<a class="auth_provider <%= auth_provider.class %> horizontal" href="<%= auth_provider.url %>">
|
||||
<span class="provider_icon"></span>
|
||||
<span class="provider_name flex"><%- @T( auth_provider.name ) %></span>
|
||||
</a>
|
||||
<li><a href="<%= auth_provider.url %>"></a></li>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</form>
|
||||
|
@ -50,14 +42,15 @@
|
|||
|
||||
<p>
|
||||
<%- @T( "You're already registered with your email adress if you've been in touch with our support team.") %><br>
|
||||
<%- @T( "You can request your password") %> <a href="#"><%- @T( "here") %></a>.
|
||||
<% if @C('user_lost_password'): %>
|
||||
<%- @T( "You can request your password") %> <a href="#reset_password"><%- @T( "here") %></a>.
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<% if @C('user_create_account'): %>
|
||||
<hr>
|
||||
|
||||
<p>
|
||||
<a href="#signup"><%- @T( 'Register as a new customer' ) %></a>
|
||||
</p>
|
||||
<hr>
|
||||
<p>
|
||||
<a href="#signup"><%- @T( 'Register as a new customer' ) %></a>
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
<div class="fullHeight vertical center justified">
|
||||
<div class="fullHeight vertical center justified reset_password fit">
|
||||
<div class="hero-unit">
|
||||
<% if @sent: %>
|
||||
<h2><%- @T('We\'ve sent password reset instructions to your email address.') %><small></small></h2>
|
||||
<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="subtle retry">» <%- @T('again') %> «</a>
|
||||
<% end %>
|
||||
<div id="form-password">
|
||||
<% else: %>
|
||||
<h2><%- @T( 'Forgot your password?' ) %><small></small></h2>
|
||||
<form id="form-password-item">
|
||||
<form class="form-password">
|
||||
<div class="form-password-item"></div>
|
||||
<div class="form-controls">
|
||||
<a class="subtle-link standalone pull-left cancel" href="#/"><%- @T( 'Cancel & Go Back' ) %></a>
|
||||
<button class="btn btn-primary submit pull-right"><%- @T( 'Submit' ) %></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="fullHeight vertical center justified">
|
||||
<div class="fullHeight vertical center justified reset_password fit">
|
||||
<div class="hero-unit">
|
||||
<h2><%- @T( 'Choose your new password.' ) %><small></small></h2>
|
||||
<form id="form-password-change">
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="fullHeight vertical center justified">
|
||||
<div class="fullHeight vertical center justified signup fit">
|
||||
<div class="hero-unit">
|
||||
<h1><%- @T( 'Join' ) %> <%= @C( 'product_name' ) %></h1>
|
||||
<form>
|
||||
|
|
Loading…
Reference in a new issue