overleaf/services/web/app/views/layout/navbar.pug

85 lines
2.6 KiB
Text
Raw Normal View History

nav.navbar.navbar-default.navbar-main
.container-fluid
.navbar-header
2014-07-22 10:50:15 +00:00
button.navbar-toggle(ng-init="navCollapsed = true", ng-click="navCollapsed = !navCollapsed", ng-class="{active: !navCollapsed}")
2014-06-04 16:46:22 +00:00
i.fa.fa-bars
if settings.nav.custom_logo
a(href='/', aria-label=settings.appName, style='background-image:url("'+settings.nav.custom_logo+'")').navbar-brand
else if (nav.title)
a(href='/', aria-label=settings.appName).navbar-title #{nav.title}
2015-02-05 16:56:35 +00:00
else
a(href='/', aria-label=settings.appName).navbar-brand
2014-07-22 10:50:15 +00:00
.navbar-collapse.collapse(collapse="navCollapsed")
2014-06-04 16:46:22 +00:00
ul.nav.navbar-nav.navbar-right
2016-09-06 14:22:13 +00:00
if (getSessionUser() && getSessionUser().isAdmin)
li.dropdown(class="subdued", dropdown)
a.dropdown-toggle(href, dropdown-toggle)
| Admin
b.caret
ul.dropdown-menu
li
a(href="/admin") Manage Site
li
a(href="/admin/user") Manage Users
// loop over header_extras
each item in nav.header_extras
2016-09-06 14:22:13 +00:00
if ((item.only_when_logged_in && getSessionUser()) || (item.only_when_logged_out && (!getSessionUser())) || (!item.only_when_logged_out && !item.only_when_logged_in))
2014-06-20 20:35:42 +00:00
if item.dropdown
li.dropdown(class=item.class, dropdown)
a.dropdown-toggle(href, dropdown-toggle)
| !{translate(item.text)}
2014-06-20 20:35:42 +00:00
b.caret
ul.dropdown-menu
each child in item.dropdown
if child.divider
li.divider
else
li
if child.url
a(href=child.url, class=child.class) !{translate(child.text)}
2014-06-20 20:35:42 +00:00
else
| !{translate(child.text)}
2014-06-20 20:35:42 +00:00
else
li(class=item.class)
if item.url
a(href=item.url, class=item.class) !{translate(item.text)}
2014-06-20 20:35:42 +00:00
else
| !{translate(item.text)}
2014-02-12 10:23:40 +00:00
// logged out
if !getSessionUser()
// register link
if hasFeature('registration')
li
a(href="/register") #{translate('register')}
// login link
li
a(href="/login") #{translate('log_in')}
// projects link and account menu
if getSessionUser()
li
2017-01-11 10:39:34 +00:00
a(href="/project") #{translate('Projects')}
li.dropdown(dropdown)
a.dropbodw-toggle(href, dropdown-toggle)
| #{translate('Account')}
b.caret
ul.dropdown-menu
li
div.subdued #{getUserEmail()}
li.divider
li
a(href="/user/settings") #{translate('Account Settings')}
if nav.showSubscriptionLink
li
a(href="/user/subscription") #{translate('subscription')}
li.divider
li
a(href="/logout") #{translate('log_out')}