debshots/app/views/layouts/_topbar.slim

75 lines
2.7 KiB
Text

nav.top-bar
.grid-container style="flex-grow:1;"
// https://foundation.zurb.com/forum/posts/53446-top-bar-and-xy-grid
.grid-x
.top-bar-left
ul.menu
li.menu-text
img src="/images/logos/debian.svg" width="20" alt="Debian logo"
li.menu-text
a href='/'
// TODO: Make the logo depend on the virtual host
// TODO: Use proper distribution name
span style="font-weight: bold"
'Debian Screenshots
/ .top-bar-right
/ ul.menu
li.menu-text class=('active' if controller_name=='welcome' and action_name=='home')
a href="/"
/ = icon 'house'
span< Home
li.menu-text class=('active' if controller_name=='packages' and request.fullpath != packages_without_path)
a href="/packages"
/ = icon 'book-image'
span< Browse
/ TODO: highlights the "Browse" tab (even) when you click on Upload
li.menu-text class=('active' if request.fullpath == packages_without_path)
=link_to :packages_without
/ = icon 'image-up'
span< Upload
//li.has-dropdown
//a href="#" Distributions
//ul.dropdown
//// TODO: Use proper distribution list
//li
//a href="#" Debian
//li
//a href="#" Ubuntu
li.menu-text class=('active' if controller_name=='welcome' and action_name=='about')
a href="/about"
/ = icon 'info'
span< About/Privacy
// TODO: Check correct classes in Zurb/Foundation for top bar!
/- if user_signed_in? and current_user.is_admin? and Package.need_moderation.any?
li.menu-text
=link_to url_for(Package.need_moderation.first)
i.fa.fa-thumbs-up
span< Moderate
/ul.menu.dropdown data-dropdown-menu=true
li
a href='#' Admin
ul.menu
/ li = link_to 'Health', admin_health_path
li = link_to 'Logs', admin_logs_path
/ li = link_to 'Users', admin_users_pathlogs_path
.top-bar-right
ul.menu
li.menu-text class=('active' if controller_name=='my')
- if user_signed_in?
= link_to my_profile_path
/ = image_tag "/images/sso/icons/#{current_user.provider}.svg", width: 20
/ = icon 'user-round'
span< My
- else
= link_to new_user_session_path
/ = icon 'user-round'
span< Login
- if @moderate_packages
.row.text-center.moderate-bar
span> Please moderate:
- @moderate_packages.first(10).each do |pkg|
=> link_to pkg.name, pkg
- if @moderate_packages.length > 10
'…