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

46 lines
1.7 KiB
Text
Raw Normal View History

2013-01-08 08:36:21 +01:00
- if @conference.nil? || @conference.short_title.nil?
= link_to "OSEM", root_path, :class => 'brand'
- else
= link_to @conference.title, root_path, :class => 'brand'
%ul.nav
- if !@conference.nil? && @conference.registration_open?
- if current_page?(register_conference_path(@conference.short_title))
%li.active
= link_to "Registration", "#"
- else
%li
= link_to "Registration", register_conference_path(@conference.short_title)
- if !@conference.nil?
- if current_page?(conference_proposal_index_path(@conference.short_title))
%li.active
= link_to "My Proposals", "#"
- else
%li
= link_to "My Proposals", conference_proposal_index_path(@conference.short_title)
2013-01-07 09:04:09 +01:00
%ul.nav.pull-right
- if user_signed_in?
- if has_role?(current_user, "admin") || has_role?(current_user, "organizer")
%li
= link_to "Admin Area", admin_conference_index_path
2013-01-07 09:04:09 +01:00
%li
2013-01-17 16:27:03 +01:00
= link_to('Sign Out', destroy_user_session_path, :method=>'delete')
2013-01-07 09:04:09 +01:00
- else
%li
2013-01-17 16:27:03 +01:00
= link_to('Sign In', new_user_session_path)
2013-01-07 09:04:09 +01:00
- if user_signed_in?
%li
= link_to('Edit account', edit_user_registration_path)
%li.dropdown
- unless Conference.count == 1 && !has_role?(current_user, "admin")
= link_to "#", :class => "dropdown-toggle" do
Conferences
<b class="caret"></b>
%ul.dropdown-menu
- conferences = Conference.order("created_at DESC")
- unless conferences.nil?
- conferences.each do |c|
- unless @conference == c
%li= link_to c.short_title, admin_conference_path(c.short_title)
- if has_role?(current_user, "admin")
%li= link_to "New Conference", new_admin_conference_path