Merge pull request #528 from ChrisBr/devise

Implements iChain authentication
This commit is contained in:
Christian Bruckmayer 2014-11-06 09:48:52 +01:00
commit 79de791f22
24 changed files with 305 additions and 136 deletions

View file

@ -16,7 +16,7 @@
%ul.nav.navbar-nav.navbar-right
%li.dropdown
%a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#", id: "current-user-detail"}
- if not current_user.name.empty?
- if not current_user.name.blank?
#{current_user.name}
-else
#{current_user.email}
@ -26,13 +26,13 @@
= render 'layouts/user_menu'
- else
%ul.nav.navbar-nav.navbar-right
- if current_page?(new_registration_path('user'))
%li.active
= link_to(new_registration_path('user')) do
- if CONFIG['authentication']['ichain']['enabled']
%li{:class=> "#{active_nav_li(new_ichain_registration_path('user'))}"}
= link_to(new_ichain_registration_path('user')) do
%span.fa.fa-heart
Sign Up
- else
%li
%li{:class=> "#{active_nav_li(new_registration_path('user'))}"}
= link_to(new_registration_path('user')) do
%span.fa.fa-heart
Sign Up
@ -42,23 +42,29 @@
Sign In
%span.caret
.dropdown-menu{:style => "padding: 17px;"}
= form_tag user_session_path do
= text_field_tag 'user[email]', nil, id: 'user_email_dd'
= password_field_tag 'user[password]', nil, id: 'user_password_dd'
%p.text-right
%small
Remember me
= check_box_tag 'user[remember_me]'
%button.btn.btn-success.btn-block Sign in
- unless omniauth_configured.empty?
.divider
%h6.text-center
or
= render 'devise/shared/openid'
%p.text-right
%a.small{"data-toggle" => "collapse", "data-target" => "#navbar-devise-help"}
Need Help?
#navbar-devise-help.collapse
= link_to "Forgot your password?", new_password_path(User.new)
%li.hidden-lg
= link_to('Sign In', new_user_session_path)
- if CONFIG['authentication']['ichain']['enabled']
= form_tag new_user_ichain_session_path do
= text_field_tag 'username', nil, id: 'user_ichain_email_dd'
= password_field_tag 'password', nil, id: 'user_ichain_password_dd'
%button.btn.btn-success.btn-block Sign in
- else
= form_tag new_user_session_path do
= text_field_tag 'user[login]', nil, id: 'user_login_dd'
= password_field_tag 'user[password]', nil, id: 'user_password_dd'
%p.text-right
%small
Remember me
= check_box_tag 'user[remember_me]'
%button.btn.btn-success.btn-block Sign in
- unless omniauth_configured.empty?
.divider
%h6.text-center
or
= render 'devise/shared/openid'
%p.text-right
%a.small{"data-toggle" => "collapse", "data-target" => "#navbar-devise-help"}
Need Help?
#navbar-devise-help.collapse
= link_to "Forgot your password?", new_password_path(User.new)
%li.hidden-lg
= link_to('Sign In', new_user_session_path)

View file

@ -1,16 +1,26 @@
- unless CONFIG['authentication']['ichain']['enabled']
%li
= link_to(edit_user_registration_path) do
%span.fa.fa-wrench
Edit Account
%li
= link_to(edit_user_registration_path) do
%span.fa.fa-wrench
Edit Account
= link_to(edit_user_path(current_user.id)) do
%span.fa.fa-user
Edit Profil
-if @conference and @conference.id
%li
= link_to(conference_proposal_index_path(@conference.short_title)) do
%span.fa.fa-comment
My Submissions
%li
= link_to(destroy_user_session_path, :method=>'delete') do
%span.fa.fa-minus
Sign out
- if CONFIG['authentication']['ichain']['enabled']
= link_to(destroy_user_ichain_session_path, :method=>'delete') do
%span.fa.fa-minus
Sign out
- else
= link_to(destroy_user_session_path, :method=>'delete') do
%span.fa.fa-minus
Sign out
- if can? :index, Conference
%li.divider
%li