debshots/app/views/layouts/_topbar.slim
2018-08-06 22:56:54 +02:00

55 lines
2.1 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="/" Home
li.menu-text class=('active' if controller_name=='packages')
a href="/packages" Browse
/ TODO: highlights the "Browse" tab (even) when you click on Contribute
li.menu-text
=link_to 'Contribute', :packages_without
//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" About/Privacy
// Add link if user has uploaded screenshots
- if @current_users_screenshots and @current_users_screenshots.any?
li.menu-text class=('active' if controller_name=='my' and action_name=='uploads')
= link_to my_uploads_path
' My uploads
span.badge.secondary
= @current_users_screenshots.count
// TODO: Check correct classes in Zurb/Foundation for top bar!
- if user_signed_in? and current_user.is_admin?
li.menu-text
a href='#' Admin
/ ul.menu.vertical
/ li = link_to 'Moderate', moderate_path
/ li = link_to 'Logs', logs_path
.top-bar-right
ul.menu
li.menu-text class=('active' if controller_name=='my')
- if user_signed_in?
= link_to "My", my_profile_path
- else
= link_to 'Login', new_user_session_path