2021-09-08 05:26:18 -04:00
|
|
|
nav.navbar.navbar-default.navbar-main
|
|
|
|
.container-fluid
|
|
|
|
.navbar-header
|
|
|
|
button.navbar-toggle.collapsed(
|
|
|
|
type="button",
|
|
|
|
data-toggle="collapse",
|
|
|
|
data-target="[data-ol-navbar-main-collapse]"
|
|
|
|
aria-label="Toggle " + translate('navigation')
|
|
|
|
)
|
|
|
|
i.fa.fa-bars(aria-hidden="true")
|
|
|
|
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}
|
|
|
|
else
|
|
|
|
a(href='/', aria-label=settings.appName).navbar-brand
|
|
|
|
|
2022-03-31 06:34:49 -04:00
|
|
|
- var canDisplayAdminMenu = hasAdminAccess()
|
2022-03-31 06:37:49 -04:00
|
|
|
- var canDisplayAdminRedirect = canRedirectToAdminDomain()
|
2022-02-10 10:39:37 -05:00
|
|
|
- var canDisplaySplitTestMenu = hasFeature('saas') && (canDisplayAdminMenu || (getSessionUser() && getSessionUser().staffAccess && (getSessionUser().staffAccess.splitTestMetrics || getSessionUser().staffAccess.splitTestManagement)))
|
2022-02-15 04:58:45 -05:00
|
|
|
.navbar-collapse.collapse(data-ol-navbar-main-collapse)
|
2021-09-08 05:26:18 -04:00
|
|
|
ul.nav.navbar-nav.navbar-right
|
2022-03-31 06:37:49 -04:00
|
|
|
if (canDisplayAdminMenu || canDisplayAdminRedirect || canDisplaySplitTestMenu)
|
2021-09-08 05:26:18 -04:00
|
|
|
li.dropdown.subdued
|
|
|
|
a.dropdown-toggle(
|
|
|
|
href="#",
|
|
|
|
role="button",
|
|
|
|
aria-haspopup="true",
|
|
|
|
aria-expanded="false",
|
|
|
|
data-toggle="dropdown"
|
|
|
|
)
|
|
|
|
| Admin
|
|
|
|
span.caret
|
|
|
|
ul.dropdown-menu
|
2022-02-10 10:39:37 -05:00
|
|
|
if canDisplayAdminMenu
|
|
|
|
li
|
|
|
|
a(href="/admin") Manage Site
|
|
|
|
li
|
|
|
|
a(href="/admin/user") Manage Users
|
2022-03-31 06:36:12 -04:00
|
|
|
li
|
|
|
|
a(href="/admin/project") Project URL Lookup
|
2022-03-31 06:37:49 -04:00
|
|
|
if canDisplayAdminRedirect
|
|
|
|
li
|
|
|
|
a(href=settings.adminUrl) Switch to Admin
|
2022-02-10 10:39:37 -05:00
|
|
|
if canDisplaySplitTestMenu
|
2022-01-28 05:44:10 -05:00
|
|
|
li
|
|
|
|
a(href="/admin/split-test") Manage Split Tests
|
2021-09-08 05:26:18 -04:00
|
|
|
|
|
|
|
// loop over header_extras
|
2021-12-02 05:14:44 -05:00
|
|
|
each item in ((splitTestVariants && (splitTestVariants['unified-navigation'] === 'show-unified-navigation')) ? nav.header_extras_unified : nav.header_extras)
|
2021-09-08 05:26:18 -04:00
|
|
|
-
|
|
|
|
if ((item.only_when_logged_in && getSessionUser())
|
|
|
|
|| (item.only_when_logged_out && (!getSessionUser()))
|
|
|
|
|| (!item.only_when_logged_out && !item.only_when_logged_in && !item.only_content_pages)
|
|
|
|
|| (item.only_content_pages && (typeof(suppressNavContentLinks) == "undefined" || !suppressNavContentLinks))
|
|
|
|
){
|
|
|
|
var showNavItem = true
|
|
|
|
} else {
|
|
|
|
var showNavItem = false
|
|
|
|
}
|
|
|
|
|
|
|
|
if showNavItem
|
|
|
|
if item.dropdown
|
|
|
|
li.dropdown(class=item.class)
|
|
|
|
a.dropdown-toggle(
|
|
|
|
href="#",
|
|
|
|
role="button",
|
|
|
|
aria-haspopup="true",
|
|
|
|
aria-expanded="false",
|
|
|
|
data-toggle="dropdown"
|
|
|
|
)
|
|
|
|
| !{translate(item.text)}
|
|
|
|
span.caret
|
|
|
|
ul.dropdown-menu
|
|
|
|
each child in item.dropdown
|
|
|
|
if child.divider
|
|
|
|
li.divider
|
|
|
|
else
|
|
|
|
li
|
|
|
|
if child.url
|
2021-12-02 05:14:44 -05:00
|
|
|
a(
|
|
|
|
href=child.url,
|
|
|
|
class=child.class,
|
|
|
|
event-tracking=child.event
|
|
|
|
event-tracking-mb="true"
|
|
|
|
event-tracking-trigger="click"
|
|
|
|
) !{translate(child.text)}
|
2021-09-08 05:26:18 -04:00
|
|
|
else
|
|
|
|
| !{translate(child.text)}
|
|
|
|
else
|
|
|
|
li(class=item.class)
|
|
|
|
if item.url
|
2021-12-02 05:14:44 -05:00
|
|
|
a(
|
|
|
|
href=item.url,
|
|
|
|
class=item.class,
|
|
|
|
event-tracking=item.event
|
|
|
|
event-tracking-mb="true"
|
|
|
|
event-tracking-trigger="click"
|
|
|
|
) !{translate(item.text)}
|
2021-09-08 05:26:18 -04:00
|
|
|
else
|
|
|
|
| !{translate(item.text)}
|
|
|
|
|
|
|
|
// logged out
|
|
|
|
if !getSessionUser()
|
|
|
|
// register link
|
|
|
|
if hasFeature('registration-page')
|
|
|
|
li
|
|
|
|
a(href="/register") #{translate('register')}
|
|
|
|
|
|
|
|
// login link
|
|
|
|
li
|
|
|
|
a(href="/login") #{translate('log_in')}
|
|
|
|
|
|
|
|
// projects link and account menu
|
|
|
|
if getSessionUser()
|
|
|
|
li
|
|
|
|
a(href="/project") #{translate('Projects')}
|
|
|
|
li.dropdown
|
|
|
|
a.dropdown-toggle(
|
|
|
|
href="#",
|
|
|
|
role="button",
|
|
|
|
aria-haspopup="true",
|
|
|
|
aria-expanded="false",
|
|
|
|
data-toggle="dropdown"
|
|
|
|
)
|
|
|
|
| #{translate('Account')}
|
|
|
|
span.caret
|
|
|
|
ul.dropdown-menu
|
|
|
|
li
|
|
|
|
div.subdued #{getSessionUser().email}
|
|
|
|
li.divider.hidden-xs.hidden-sm
|
|
|
|
li
|
|
|
|
a(href="/user/settings") #{translate('Account Settings')}
|
|
|
|
if nav.showSubscriptionLink
|
|
|
|
li
|
|
|
|
a(href="/user/subscription") #{translate('subscription')}
|
|
|
|
li.divider.hidden-xs.hidden-sm
|
|
|
|
li
|
|
|
|
form(method="POST" action="/logout")
|
|
|
|
input(name='_csrf', type='hidden', value=csrfToken)
|
|
|
|
button.btn-link.text-left.dropdown-menu-button #{translate('log_out')}
|