rosa-build/app/views/layouts/menu/_new_top.html.haml

41 lines
2.0 KiB
Plaintext
Raw Normal View History

2014-03-30 06:45:52 +01:00
%nav.navbar.navbar-default.top_menu{ role: "navigation" }
.container-fluid
/ Brand and toggle get grouped for better mobile display
.navbar-header
2014-04-02 11:32:35 +01:00
%button.navbar-toggle{ "data-target" => "#top-menu-navbar-collapse-1", "data-toggle" => "collapse", type: "button" }
2014-03-30 06:45:52 +01:00
%span.sr-only Toggle navigation
%span.icon-bar
%span.icon-bar
%span.icon-bar
= link_to image_tag('logo-mini.png', alt: 'ABF'), root_path, class: 'navbar-brand'
/ Collect the nav links, forms, and other content for toggling
2014-04-02 11:32:35 +01:00
#top-menu-navbar-collapse-1.collapse.navbar-collapse
2014-03-30 06:45:52 +01:00
%ul.nav.navbar-nav
- (collection = t 'top_menu').each do |base, title|
- if can? :index, base.to_s.classify.constantize
%li{ class: top_menu_class(base) }= link_to title, send("#{base}_path")
- if current_user.try(:admin?)
%li{ class: top_menu_class('admin') }= link_to t('admins_menu_header'), admin_users_path
= form_tag search_index_path, method: 'get', class: 'navbar-form navbar-left', role: 'search' do
.form-group
= text_field_tag 'query', @query, placeholder: t('layout.search.header'), class: 'form-control'
%ul.nav.navbar-nav.navbar-right
- if current_user
2014-05-26 18:42:27 +01:00
%li
.avatar= image_tag avatar_url(current_user), alt: 'avatar', height: "32", class: 'img-responsive'
2014-03-30 06:45:52 +01:00
%li.dropdown
%a.dropdown-toggle{ "data-toggle" => "dropdown", href: "#" }
= current_user.uname
%b.caret
%ul.dropdown-menu
%li= link_to current_user.uname, current_user
%li= link_to t('layout.settings.label'), profile_settings_path
%li.divider
%li= link_to t('layout.logout'), destroy_user_session_path, method: :delete
- else
%ul.nav.navbar-nav
%li= link_to t('layout.devise.shared_links.sign_up'), new_register_request_path
%li= link_to t('layout.devise.shared_links.sign_in'), new_user_session_path
/ /.navbar-collapse
/ /.container-fluid