make some shared devise logic into a helper
This commit is contained in:
parent
9562fb41a8
commit
7c9eb065ba
3 changed files with 6 additions and 2 deletions
|
|
@ -7,4 +7,8 @@ module SessionsHelper
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def should_display_registration_link?
|
||||||
|
!AppConfig[:registrations_closed] && devise_mapping.registerable? && controller_name != 'registrations'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
= f.submit t('devise.sessions.new.sign_in'), :tabindex => 4
|
= f.submit t('devise.sessions.new.sign_in'), :tabindex => 4
|
||||||
|
|
||||||
|
|
||||||
- if !AppConfig[:registrations_closed] && devise_mapping.registerable? && controller_name != 'registrations'
|
- if should_display_registration_link?
|
||||||
%br
|
%br
|
||||||
%br
|
%br
|
||||||
%br
|
%br
|
||||||
|
|
|
||||||
|
|
@ -24,5 +24,5 @@
|
||||||
= link_to "Forgot password?", new_password_path(resource_name)
|
= link_to "Forgot password?", new_password_path(resource_name)
|
||||||
|
|
||||||
%footer
|
%footer
|
||||||
- if !AppConfig[:registrations_closed] && devise_mapping.registerable? && controller_name != 'registrations'
|
- if should_display_registration_link?
|
||||||
= link_to t('.sign_up'), new_registration_path(resource_name)
|
= link_to t('.sign_up'), new_registration_path(resource_name)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue