osem-fcy/app/views/layouts/_navigation.html.haml

89 lines
4.5 KiB
Text
Raw Normal View History

.navbar.navbar-default.navbar-fixed-top{:role=>"navigation"}
.container
.navbar-header
%button{"data-target"=>".navbar-collapse", "data-toggle"=>"collapse", :class=>"navbar-toggle", :type=>"button"}
%span.sr-only
Toggle navigation
%span.icon-bar
%span.icon-bar
%span.icon-bar
= link_to CONFIG['name'], root_path, class: 'navbar-brand', title: 'Open Source Event Manager'
.collapse.navbar-collapse
2014-05-29 10:30:35 +05:30
- if content_for :splash_nav
2014-06-26 15:13:23 +05:30
%ul.nav.navbar-nav#splash-nav
2014-05-29 10:30:35 +05:30
= content_for :splash_nav
2014-05-22 18:19:07 +02:00
-if user_signed_in?
.btn-group.pull-right
%ul.nav.navbar-nav.navbar-right
%li.dropdown
%a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#", id: "current-user-detail"}
- if not current_user.name.blank?
#{current_user.name}
-else
#{current_user.email}
= image_tag(current_user.gravatar_url(size: '18'), title: "Yo #{current_user.name}!", :alt => '')
%b.caret
%ul.dropdown-menu
= render 'layouts/user_menu'
- if can? :index, Comment
%ul.nav.navbar-nav.navbar-right
%li.dropdown
%a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#"}
- if unread_notifications(current_user)
Notifications (#{unread_notifications(current_user).length})
%span.fa.fa-comment
%b.caret
%ul.dropdown-menu
- if unread_notifications(current_user).length > 0
%li.dropdown-header Last 5 Comments for:
- unread_notifications(current_user).limit(5).group_by{ |comment| comment.commentable}.each do |event, comments|
%li= link_to("#{event.title}(#{comments.count})", admin_conference_program_event_path(event.program.conference.short_title, event.id))
%li.divider
%li= link_to "See all unread Comments (#{unread_notifications(current_user).length})", admin_comments_path
%li= link_to 'See all Comments', admin_comments_path(anchor: 'all_comments')
- else
%ul.nav.navbar-nav.navbar-right
2014-11-04 17:42:47 +01:00
- 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
2014-11-04 17:42:47 +01:00
%li{:class=> "#{active_nav_li(new_registration_path('user'))}"}
= link_to(new_registration_path('user')) do
%span.fa.fa-heart
Sign Up
%li.dropdown.visible-desktop
%a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#"}
%span.fa.fa-user
Sign In
%span.caret
2015-04-22 16:31:44 +02:00
.dropdown-menu{:style => "padding: 17px; min-width: 225px;"}
2014-11-04 17:42:47 +01:00
- if CONFIG['authentication']['ichain']['enabled']
= form_tag User.ichain_login_url do
2014-11-06 16:17:30 +01:00
= text_field_tag 'username', nil, id: 'user_ichain_email_dd', placeholder: 'Username'
= password_field_tag 'password', nil, id: 'user_ichain_password_dd', placeholder: 'Password'
2014-11-04 17:42:47 +01:00
%button.btn.btn-success.btn-block Sign in
- else
= form_tag new_user_session_path do
2014-11-06 16:17:30 +01:00
= text_field_tag 'user[login]', nil, id: 'user_login_dd', placeholder: 'Username / E-Mail'
= password_field_tag 'user[password]', nil, id: 'user_password_dd', placeholder: 'Password'
2014-11-04 17:42:47 +01:00
%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
2015-04-18 21:44:40 +03:00
= render 'devise/shared/openid_links'
2014-11-04 17:42:47 +01:00
%p.text-right
2015-04-18 21:44:40 +03:00
%br
%a.small.btn.btn-xs.btn-default{"data-toggle" => "collapse", "data-target" => "#navbar-devise-help"}
2014-11-04 17:42:47 +01:00
Need Help?
#navbar-devise-help.collapse
2015-04-18 21:44:40 +03:00
= render 'devise/shared/links'
2014-11-04 17:42:47 +01:00
%li.hidden-lg
= link_to('Sign In', new_user_session_path)