OpenFest: Fix registration and login process

This commit is contained in:
Andrew Radev 2015-08-05 14:54:17 +03:00
parent ce61422321
commit 9d53e49fb4
8 changed files with 17 additions and 27 deletions

View File

@ -1,24 +1,16 @@
br
- if controller_name != 'sessions'
= link_to t('sessions.sign_in'), new_session_path(resource_name)
= link_to t('sessions.sign_in'), new_user_session_path
br
- if devise_mapping.registerable? && controller_name != 'registrations'
= link_to t('registrations.sign_up'), new_registration_path(resource_name)
= link_to t('registrations.sign_up'), new_user_registration_path
br
- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
= link_to t('passwords.forgotten_password'), new_password_path(resource_name)
= link_to t('passwords.forgotten_password'), new_user_password_path
br
- if devise_mapping.confirmable? && controller_name != 'confirmations'
= link_to t('confirmations.did_not_receive_confirmation_instructions'), new_confirmation_path(resource_name)
= link_to t('confirmations.did_not_receive_confirmation_instructions'), new_user_confirmation_path
br
- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
= link_to t('unlocks.did_not_receive_unlock_instructions'), new_unlock_path(resource_name)
br
- if devise_mapping.omniauthable?
- resource_class.omniauth_providers.each do |provider|
= link_to t('sessions.sign_in_with', provider: provider.to_s.titleize), omniauth_authorize_path(resource_name, provider)

View File

@ -10,4 +10,6 @@
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require_tree .

View File

@ -15,6 +15,7 @@
<body>
<%= render 'open_fest/shared/nav' %>
<section class="content">
<%= render 'open_fest/shared/flash_messages' %>
<%= yield %>
</section>
</body>

View File

@ -0,0 +1,3 @@
div#flash_messages
- flash.each do |key, value|
= content_tag :div, value, class: "flash #{key}"

View File

@ -1,6 +1,6 @@
- content_for(:title) { t :edit_speaker_profile }
= simple_form_for(resource, wrapper: :default, as: resource_name, url: open_fest.user_registration_path, html: { method: :put, multipart: true }) do |f|
= simple_form_for(resource, wrapper: :default, as: :user, url: user_registration_path, html: { method: :put, multipart: true }) do |f|
.form_inputs
h2.entry-title = t :personal_profile
= f.error_notification

View File

@ -2,7 +2,7 @@
h2.entry-title = t :registration
= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
= simple_form_for(resource, as: resource_name, url: user_registration_path) do |f|
= f.error_notification
.form-inputs

View File

@ -2,7 +2,7 @@
h2.entry-title = t :login
= simple_form_for(resource, wrapper: :default, as: resource_name, url: session_path(resource_name), ) do |f|
= simple_form_for(resource, wrapper: :default, as: resource_name, url: user_session_path) do |f|
.form-inputs
= f.input :email, required: false, autofocus: true, hint: false
= f.input :password, required: false, hint: false

View File

@ -1,23 +1,15 @@
- if controller_name != 'sessions'
= link_to t(:enter), new_session_path(resource_name)
= link_to t(:enter), new_user_session_path
br
- if devise_mapping.registerable? && controller_name != 'registrations'
= link_to t(:registration), new_registration_path(resource_name)
= link_to t(:registration), new_user_registration_path
br
- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
= link_to t(:lostpass), new_password_path(resource_name)
= link_to t(:lostpass), new_user_password_path
br
- if devise_mapping.confirmable? && controller_name != 'confirmations'
= link_to t(:did_not_get_confirmation), new_confirmation_path(resource_name)
= link_to t(:did_not_get_confirmation), new_user_confirmation_path
br
- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
= link_to t(:did_not_get_unlock), new_unlock_path(resource_name)
br
- if devise_mapping.omniauthable?
- resource_class.omniauth_providers.each do |provider|
= link_to t(:login_with, with: @provider.to_s.titleize), omniauth_authorize_path(resource_name, provider)