always remember me on the mobile. make previous helpers shorter
This commit is contained in:
parent
7c9eb065ba
commit
647bc585cc
4 changed files with 14 additions and 5 deletions
|
|
@ -13,6 +13,9 @@ class ApplicationController < ActionController::Base
|
|||
before_filter :set_git_header if (AppConfig[:git_update] && AppConfig[:git_revision])
|
||||
before_filter :set_grammatical_gender
|
||||
|
||||
before_filter do
|
||||
puts params.inspect
|
||||
end
|
||||
prepend_before_filter :clear_gc_stats
|
||||
|
||||
inflection_method :grammatical_gender => :gender
|
||||
|
|
|
|||
|
|
@ -8,7 +8,11 @@ module SessionsHelper
|
|||
end
|
||||
end
|
||||
|
||||
def should_display_registration_link?
|
||||
def display_registration_link?
|
||||
!AppConfig[:registrations_closed] && devise_mapping.registerable? && controller_name != 'registrations'
|
||||
end
|
||||
|
||||
def display_password_reset_link?
|
||||
devise_mapping.recoverable? && controller_name != 'passwords'
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
= f.label :password , t('password')
|
||||
= f.password_field :password, :tabindex => 2
|
||||
|
||||
- if devise_mapping.recoverable? && controller_name != 'passwords'
|
||||
- if display_password_reset_link?
|
||||
= link_to t('devise.shared.links.forgot_your_password'), new_password_path(resource_name), :id => "forgot_password_link", :tabindex => 5
|
||||
|
||||
%br
|
||||
|
|
@ -45,7 +45,7 @@
|
|||
= f.submit t('devise.sessions.new.sign_in'), :tabindex => 4
|
||||
|
||||
|
||||
- if should_display_registration_link?
|
||||
- if display_registration_link?
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
|
|
|
|||
|
|
@ -19,10 +19,12 @@
|
|||
.centered
|
||||
= f.password_field :password
|
||||
.row
|
||||
.hidden
|
||||
= f.check_box('remember_me', {:tabindex => 3}, 1, 1)
|
||||
= f.submit t('devise.sessions.new.sign_in'), :class => 'login-submit'
|
||||
- if devise_mapping.recoverable? && controller_name != 'passwords'
|
||||
- if display_password_reset_link?
|
||||
= link_to "Forgot password?", new_password_path(resource_name)
|
||||
|
||||
%footer
|
||||
- if should_display_registration_link?
|
||||
- if display_registration_link?
|
||||
= link_to t('.sign_up'), new_registration_path(resource_name)
|
||||
|
|
|
|||
Loading…
Reference in a new issue