tap/app/views/layouts/_header.html.haml

45 lines
2.1 KiB
Text

%nav.navbar.navbar-inverse.navbar-fixed-top{role: "navigation"}
.container-fluid
/ Brand and toggle get grouped for better mobile display
.navbar-header
%button.navbar-toggle{"data-target" => ".navbar-collapse", "data-toggle" => "collapse", type: "button"}
%span.icon-bar
%span.icon-bar
%span.icon-bar
= link_to "Tap", root_path, class: "navbar-brand nav-logo"
/ Collect the nav links, forms, and other content for toggling
- unless current_user && current_user.koelkast?
.collapse.navbar-collapse
.hidden-xs.navbar-form.navbar-right
.form-group
- if user_signed_in?
= link_to "Logout", destroy_user_session_path, class: "btn btn-default form-control"
- else
= link_to "Login", omniauth_authorize_path("user", "zeuswpi"), class: "btn btn-success form-control"
%ul.nav.navbar-nav.navbar-right
%li= mail_to "tab@zeus.ugent.be", "Send feedback"
- if user_signed_in?
- if can? :manage, :all
%li.dropdown
%a.dropdown-toggle{"aria-expanded" => "false", "data-toggle" => "dropdown", href: "#", role: "button"}
Products
%span.caret
%ul.dropdown-menu{role: "menu"}
%li= link_to "List", products_path
%li= link_to "Add product" , new_product_path
%li= link_to "Add stock", new_stock_path
%li.dropdown
%a.dropdown-toggle{"data-toggle" => "dropdown", href: "#"}
Logged in as #{current_user.name}
%b.caret
%ul.dropdown-menu
%li= link_to "Edit avatar", edit_user_path(current_user)
%li
%p.navbar-text
Debt: #{euro(current_user.debt)}
.visible-xs.navbar-form
.form-group
- if user_signed_in?
= button_to "Logout", destroy_user_session_path, class: "btn btn-default form-control", method: :delete
- else
= link_to "Login", omniauth_authorize_path("user", "zeuswpi"), class: "btn btn-success form-control"