From 74e548fedb4f8548dd61ecf2909b793aaa0e12d8 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sun, 20 Jul 2014 00:24:58 +0200 Subject: [PATCH] Fixed login -> reset password -> go back --- .../app/controllers/login.js.coffee | 4 ++ .../app/controllers/reset_password.js.coffee | 15 +++---- .../app/controllers/signup.js.coffee | 2 - .../javascripts/app/views/login.jst.eco | 39 ++++++++----------- .../app/views/password/reset.jst.eco | 10 ++--- .../app/views/password/reset_change.jst.eco | 2 +- .../javascripts/app/views/signup.jst.eco | 2 +- 7 files changed, 32 insertions(+), 42 deletions(-) diff --git a/app/assets/javascripts/app/controllers/login.js.coffee b/app/assets/javascripts/app/controllers/login.js.coffee index 29dba271a..35b73cd50 100644 --- a/app/assets/javascripts/app/controllers/login.js.coffee +++ b/app/assets/javascripts/app/controllers/login.js.coffee @@ -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 = [] diff --git a/app/assets/javascripts/app/controllers/reset_password.js.coffee b/app/assets/javascripts/app/controllers/reset_password.js.coffee index 5b149fd56..475ee66df 100644 --- a/app/assets/javascripts/app/controllers/reset_password.js.coffee +++ b/app/assets/javascripts/app/controllers/reset_password.js.coffee @@ -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' diff --git a/app/assets/javascripts/app/controllers/signup.js.coffee b/app/assets/javascripts/app/controllers/signup.js.coffee index 0a2ade213..0f0cd248e 100644 --- a/app/assets/javascripts/app/controllers/signup.js.coffee +++ b/app/assets/javascripts/app/controllers/signup.js.coffee @@ -1,6 +1,4 @@ class Index extends App.ControllerContent - className: 'signup fit' - events: 'submit form': 'submit' 'click .submit': 'submit' diff --git a/app/assets/javascripts/app/views/login.jst.eco b/app/assets/javascripts/app/views/login.jst.eco index 3f3923c5e..0411d665d 100644 --- a/app/assets/javascripts/app/views/login.jst.eco +++ b/app/assets/javascripts/app/views/login.jst.eco @@ -18,31 +18,23 @@ <% if @C('user_lost_password'): %> - <%- @T( 'Forgot password?' ) %> + <%- @T( 'Forgot password?' ) %> <% end %> - <% if true or !_.isEmpty( @auth_providers ): %> + <% if !_.isEmpty( @auth_providers ): %>
<%- @T( 'or sign in using' ) %>
- - - - - Google+ - - + <% for auth_provider in @auth_providers: %> + + + <%- @T( auth_provider.name ) %> + +
  • + <% end %>
    <% end %> @@ -50,14 +42,15 @@

    <%- @T( "You're already registered with your email adress if you've been in touch with our support team.") %>
    - <%- @T( "You can request your password") %> <%- @T( "here") %>. + <% if @C('user_lost_password'): %> + <%- @T( "You can request your password") %> <%- @T( "here") %>. + <% end %>

    <% if @C('user_create_account'): %> -
    - -

    - <%- @T( 'Register as a new customer' ) %> -

    +
    +

    + <%- @T( 'Register as a new customer' ) %> +

    <% end %> diff --git a/app/assets/javascripts/app/views/password/reset.jst.eco b/app/assets/javascripts/app/views/password/reset.jst.eco index 5650ba5e6..afb08c97b 100644 --- a/app/assets/javascripts/app/views/password/reset.jst.eco +++ b/app/assets/javascripts/app/views/password/reset.jst.eco @@ -1,18 +1,18 @@ -
    +
    <% if @sent: %>

    <%- @T('We\'ve sent password reset instructions to your email address.') %>

    <%- @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.') %>

    » <%- @T('again') %> « - <% end %> -
    + <% else: %>

    <%- @T( 'Forgot your password?' ) %>

    -
    + +
    <%- @T( 'Cancel & Go Back' ) %>
    -
    + <% end %>
    diff --git a/app/assets/javascripts/app/views/password/reset_change.jst.eco b/app/assets/javascripts/app/views/password/reset_change.jst.eco index f10f7a026..5b194a5fc 100644 --- a/app/assets/javascripts/app/views/password/reset_change.jst.eco +++ b/app/assets/javascripts/app/views/password/reset_change.jst.eco @@ -1,4 +1,4 @@ -
    +

    <%- @T( 'Choose your new password.' ) %>

    diff --git a/app/assets/javascripts/app/views/signup.jst.eco b/app/assets/javascripts/app/views/signup.jst.eco index 7c576c872..b4a1db8a2 100644 --- a/app/assets/javascripts/app/views/signup.jst.eco +++ b/app/assets/javascripts/app/views/signup.jst.eco @@ -1,4 +1,4 @@ -
    +