christmas/views/includes/navbar.pug

40 lines
1.6 KiB
Text
Raw Normal View History

2018-11-20 11:19:58 -08:00
mixin navBarLink(href, title)
if href === req.path
a.is-active.navbar-item(href=href)= title
else
a.navbar-item(href=href)= title
2021-12-03 08:13:43 -08:00
2019-11-17 15:22:35 -08:00
nav.navbar.is-fixed-top(role='navigation', aria-label='main navigation',style='box-shadow: 0px 0px 7px rgb(14, 15, 17);')
2018-11-20 11:19:58 -08:00
.navbar-brand
2020-10-29 11:14:38 -07:00
if _CC.config.base === req.path
a.is-active.navbar-item(href=_CC.config.base)
img(src=`${_CC.config.base}img/logo.png`, alt='')
2018-11-20 11:19:58 -08:00
span #{config.siteTitle}
else
2020-10-29 11:14:38 -07:00
a.navbar-item(href=_CC.config.base)
img(src=`${_CC.config.base}img/logo.png`, alt='')
2018-11-20 11:19:58 -08:00
span #{config.siteTitle}
a.navbar-burger#navBarBurger(role='button', aria-label='menu', aria-expanded='false')
span(aria-hidden='true')
span(aria-hidden='true')
span(aria-hidden='true')
.navbar-menu#navBarMenu
.navbar-start
if req.isAuthenticated()
2022-10-03 07:49:36 -07:00
if req.user._id === '_CCUNKNOWN'
2020-11-08 14:23:51 -08:00
.navbar-item
2021-12-05 11:38:28 -08:00
a.button.is-primary(href='/login')= lang('NAVBAR_LOGIN')
2020-11-08 14:23:51 -08:00
else
.navbar-item.has-dropdown.is-hoverable
a.navbar-link= req.user._id
.navbar-dropdown
2021-12-03 08:13:43 -08:00
+navBarLink(`${_CC.config.base}wishlist/${req.user._id}`, lang('NAVBAR_WISHLIST'))
+navBarLink(`${_CC.config.base}profile`, lang('NAVBAR_PROFILE'))
2020-11-08 14:23:51 -08:00
if req.user.admin
2021-12-03 08:13:43 -08:00
+navBarLink(`${_CC.config.base}admin-settings`, lang('NAVBAR_ADMIN'))
2020-11-08 14:23:51 -08:00
hr.navbar-divider
.navbar-item
form#logoutForm(action=`${_CC.config.base}logout`, method='POST')
2021-12-03 08:13:43 -08:00
button.button.is-warning(type='submit')= lang('NAVBAR_LOGOUT')
2020-10-29 11:14:38 -07:00
script(src=`${_CC.config.base}js/nav.js`)