overleaf/services/web/app/views/layout/navbar-marketing.pug
Thomas abd2974469 Merge pull request #16254 from overleaf/tm-website-redesign-navbar-footer-base
Implement navbar and footer changes for website redesign, and for existing pages for treatment users

GitOrigin-RevId: d91328e3928bc0e249e19eff34c6f9423784ccbf
2023-12-18 09:05:08 +00:00

203 lines
7.1 KiB
Text

- var websiteRedesignActive = splitTestVariants && (splitTestVariants['website-redesign'] === 'new-design' || splitTestVariants['website-redesign'] === 'new-design-registration')
nav.navbar.navbar-default.navbar-main
.container-fluid
.navbar-header
if (typeof(suppressNavbarRight) == "undefined")
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")
- var enableUpgradeButton = projectDashboardReact && usersBestSubscription && usersBestSubscription.type === 'free'
if (enableUpgradeButton)
a.btn.btn-primary.pull-right.me-2.visible-xs(
href="/user/subscription/plans"
event-tracking="upgrade-button-click"
event-tracking-mb="true"
event-tracking-label="upgrade"
event-tracking-trigger="click"
event-segmentation='{"source": "dashboard-top", "project-dashboard-react": "enabled", "is-dashboard-sidebar-hidden": "true", "is-screen-width-less-than-768px": "true"}'
) #{translate("upgrade")}
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
- var canDisplayAdminMenu = hasAdminAccess()
- var canDisplayAdminRedirect = canRedirectToAdminDomain()
- var canDisplaySplitTestMenu = hasFeature('saas') && (canDisplayAdminMenu || (getSessionUser() && getSessionUser().staffAccess && (getSessionUser().staffAccess.splitTestMetrics || getSessionUser().staffAccess.splitTestManagement)))
- var canDisplaySurveyMenu = hasFeature('saas') && canDisplayAdminMenu
if (typeof(suppressNavbarRight) == "undefined")
.navbar-collapse.collapse(data-ol-navbar-main-collapse)
ul.nav.navbar-nav.navbar-right
if (canDisplayAdminMenu || canDisplayAdminRedirect || canDisplaySplitTestMenu)
li.dropdown.subdued
a.dropdown-toggle(
href="#",
role="button",
aria-haspopup="true",
aria-expanded="false",
data-toggle="dropdown"
)
| Admin
span.caret
ul.dropdown-menu
if canDisplayAdminMenu
li
a(href="/admin") Manage Site
li
a(href="/admin/user") Manage Users
li
a(href="/admin/project") Project URL Lookup
if canDisplayAdminRedirect
li
a(href=settings.adminUrl) Switch to Admin
if canDisplaySplitTestMenu
li
a(href="/admin/split-test") Manage Feature Flags
if canDisplaySurveyMenu
li
a(href="/admin/survey") Manage Surveys
// loop over header_extras
- var headerExtras = websiteRedesignActive ? nav.header_extras_website_redesign : nav.header_extras
each item in headerExtras
-
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 if child.isContactUs
li
a(data-ol-open-contact-form-modal="contact-us" href)
span(event-tracking="menu-clicked-contact" event-tracking-mb="true" event-tracking-trigger="click")
| #{translate("contact_us")}
else
li
if child.url
a(
href=child.url,
class=child.class,
event-tracking=child.event
event-tracking-mb="true"
event-tracking-trigger="click"
event-segmentation=child.eventSegmentation
) !{translate(child.text)}
else
| !{translate(child.text)}
else
li(class=item.class)
if item.url
a(
href=item.url,
class=item.class,
event-tracking=item.event
event-tracking-mb="true"
event-tracking-trigger="click"
) !{translate(item.text)}
else
| !{translate(item.text)}
// logged out
if !getSessionUser()
// register link
if hasFeature('registration-page')
if websiteRedesignActive
li.primary
a(
href="/register"
event-tracking="menu-clicked-register"
event-tracking-action="clicked"
event-tracking-trigger="click"
event-tracking-mb="true"
event-segmentation={ page: currentUrl }
) #{translate('sign_up')}
else
li
a(
href="/register"
event-tracking="menu-clicked-register"
event-tracking-action="clicked"
event-tracking-trigger="click"
event-tracking-mb="true"
event-segmentation={ page: currentUrl }
) #{translate('Register')}
// login link
if websiteRedesignActive
li
a(
href="/login"
event-tracking="menu-clicked-login"
event-tracking-action="clicked"
event-tracking-trigger="click"
event-tracking-mb="true"
event-segmentation={ page: currentUrl }
) #{translate('log_in')}
else
li
a(
href="/login"
event-tracking="menu-clicked-login"
event-tracking-action="clicked"
event-tracking-trigger="click"
event-tracking-mb="true"
event-segmentation={ page: currentUrl }
).text-capitalize #{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')}