mixin navBarLink(href, title)
  if href === req.path
    a.is-active.navbar-item(href=href)= title
  else
    a.navbar-item(href=href)= title

nav.navbar.is-fixed-top(role='navigation', aria-label='main navigation', style='box-shadow: 0px 0px 7px rgb(14, 15, 17);')
  .navbar-brand
    if _CC.config.base === req.path
      a.is-active.navbar-item(href=_CC.config.base)
        img(src=`${_CC.config.base}img/logo.png`, alt='Castro Christmas')
    else
      a.navbar-item(href=_CC.config.base)
        img(src=`${_CC.config.base}img/logo.png`, alt='Castro Christmas')
    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-end
      if req.isAuthenticated()
        if req.user._id === '_CCUNKNOWN'
          .navbar-item
            a.button.is-primary(href=`${_CC.config.base}login`)= lang('NAVBAR_LOGIN')
        else
          .navbar-item
            +navBarLink(`${_CC.config.base}wishlist/${req.user._id}`, lang('NAVBAR_WISHLIST'))
          .navbar-item
            +navBarLink(`${_CC.config.base}profile`, lang('NAVBAR_PROFILE'))
          if req.user.admin
            .navbar-item
              +navBarLink(`${_CC.config.base}admin-settings`, lang('NAVBAR_ADMIN'))
          .navbar-item
            +navBarLink(`${_CC.config.base}logout`, lang('NAVBAR_LOGOUT'))

script(src=`${_CC.config.base}js/nav.js`)
