%ul.nav.nav-stacked.nav-pills.mySidebar
  .btn-group
    %button{type:'button', class:'btn btn-default btn-link dropdown-toggle', 'data-toggle'=>'dropdown'}
      %span.fa.fa-cog
      = @conference.short_title
      %span.caret
    %ul.dropdown-menu{role:'menu'}
      %li
        = link_to(admin_conference_index_path) do
          %span.fa.fa-home
          All Conferences
      - @conferences.each do |conference|
        - if can? :show, conference
          %li
            = link_to(admin_conference_path(conference.short_title)) do
              %span.fa.fa-cog
              Manage
              = conference.short_title
      - if (current_user.is_admin) || (current_user.has_role? :organizer, :any)
        %li
          = link_to(new_admin_conference_path) do
            %span.fa.fa-plus
            New Conference
  %hr
  - if can? :show, @conference
    %li{:class=> "#{active_nav_li(admin_conference_path(@conference.short_title))} nav-header nav-header-bigger"}
      = link_to(admin_conference_path(@conference.short_title)) do
        %span.fa.fa-tachometer
        Dashboard
  - if can? :show, @conference
    %li{:class=> "#{active_nav_li(edit_admin_conference_path(@conference.short_title))}"}
      = link_to(edit_admin_conference_path(@conference.short_title)) do
        %span.fa.fa-home
        Basics
      %ul
        - if can? :update, Contact.new(conference_id: @conference.id)
          %li{:class=> "#{active_nav_li(edit_admin_conference_contact_path(@conference.short_title))}"}
            = link_to 'Contact', edit_admin_conference_contact_path(@conference.short_title)
        - if can? :index, @conference.commercials.build
          %li{:class=> "#{active_nav_li(admin_conference_commercials_path(@conference.short_title))}"}
            = link_to 'Commercials', admin_conference_commercials_path(@conference.short_title)
        - if can? :update, @conference
          %li{:class=> active_nav_li(edit_admin_conference_splashpage_path(@conference.short_title))}
            = link_to 'Splashpage', admin_conference_splashpage_path(@conference.short_title)
  - if can? :index, Venue.new(conference_id: @conference.id)
    %li{:class=> "#{active_nav_li(admin_conference_venue_path(@conference.short_title))}"}
      = link_to(admin_conference_venue_path(@conference.short_title)) do
        %span.fa.fa-road
        Venue
      %ul
        - if can? :update, @conference.rooms.build
          %li{:class=> active_nav_li(admin_conference_rooms_path(@conference.short_title))}
            = link_to 'Rooms', admin_conference_rooms_path(@conference.short_title)
        - if can? :update, @conference.lodgings.build
          %li{ class: active_nav_li(admin_conference_lodgings_path(@conference.short_title)) }
            = link_to 'Lodgings', admin_conference_lodgings_path(@conference.short_title)
    %li
      %a
        %span.fa.fa-calendar
        Program
      %ul
        - if can? :update, @conference.events.build
          %li{:class=> active_nav_li(admin_conference_events_path(@conference.short_title))}
            = link_to 'Events', admin_conference_events_path(@conference.short_title)
        - if can? :update, CallForPaper.new(conference_id: @conference.id)
          %li{:class=> "#{active_nav_li(admin_conference_call_for_paper_path(@conference.short_title))}"}
            = link_to 'Call for Papers', admin_conference_call_for_paper_path(@conference.short_title)
        - if can? :update, @conference.tracks.build
          %li{:class=> active_nav_li(admin_conference_tracks_path(@conference.short_title))}
            = link_to 'Tracks', admin_conference_tracks_path(@conference.short_title)
        - if can? :update, @conference.event_types.build
          %li{:class=> active_nav_li(admin_conference_event_types_path(@conference.short_title))}
            = link_to 'Event Types', admin_conference_event_types_path(@conference.short_title)
        - if can? :update, @conference.difficulty_levels.build, conference_id: @conference.id
          %li{:class=> active_nav_li(admin_conference_difficulty_levels_path(@conference.short_title))}
            = link_to 'Difficulty Levels', admin_conference_difficulty_levels_path(@conference.short_title)
        - if can? :update, @conference.events.build
          %li{class: active_nav_li(admin_conference_schedule_path(@conference.short_title))}
            = link_to 'Schedule', admin_conference_schedule_path(@conference.short_title), target: '_blank'

  - if can? :update, Registration.new(conference_id: @conference.id)
    %li{:class=> active_nav_li(admin_conference_registrations_path(@conference.short_title))}
      = link_to(admin_conference_registrations_path(@conference.short_title)) do
        %span.fa.fa-user
        Registrations
      %ul
        - if can? :update, @conference
          %li{:class=> active_nav_li(admin_conference_registration_period_path(@conference.short_title))}
            = link_to 'Registration Period', admin_conference_registration_period_path(@conference.short_title)
        - if can? :update, Question.new(conference_id: @conference.id)
          %li{:class=> active_nav_li(admin_conference_questions_path(@conference.short_title))}
            = link_to 'Questions', admin_conference_questions_path(@conference.short_title)
    %li
      %a
        %span.fa.fa-usd
        Donations
      %ul
        - if can? :update, @conference.sponsorship_levels.build
          %li{:class=> "#{active_nav_li(admin_conference_sponsorship_levels_path(@conference.short_title))}" }
            = link_to 'Sponsorship Levels', admin_conference_sponsorship_levels_path(@conference.short_title)
        - if can? :update, @conference.sponsors.build
          %li{:class=> active_nav_li(admin_conference_sponsors_path(@conference.short_title))}
            = link_to 'Sponsors', admin_conference_sponsors_path(@conference.short_title)
        - if can? :update, @conference.tickets.build
          %li{ class: active_nav_li(admin_conference_tickets_path(@conference.short_title)) }
            = link_to 'Tickets', admin_conference_tickets_path(@conference.short_title)
    %li
      %a
        %span.fa.fa-money
        Objectives
      %ul
        - if can? :update, @conference
          %li{class: active_nav_li(admin_conference_campaigns_path(@conference.short_title))}
            = link_to 'Campaigns', admin_conference_campaigns_path(@conference.short_title)
        - if can? :update, @conference.targets.build
          %li{:class=> "#{active_nav_li(admin_conference_targets_path(@conference.short_title))}"}
            = link_to 'Goals', admin_conference_targets_path(@conference.short_title)
  - if can? :update, @conference.email_settings
    %li{:class=> active_nav_li(admin_conference_emails_path(@conference.short_title))}
      = link_to(admin_conference_emails_path(@conference.short_title)) do
        %span.fa.fa-envelope
        E-Mails
  - if can? :manage, @conference
    %li{:class=> active_nav_li(roles_admin_conference_path(@conference.short_title))}
      = link_to(roles_admin_conference_path(@conference.short_title)) do
        %span.fa.fa-group
        Roles
