header
  // Fixed navbar
  nav.navbar.navbar-expand-lg.navbar-dark.bg-primary.fixed-top
    a.navbar-brand(href='/')= public.app_name
    button.navbar-toggler(type='button', data-toggle='collapse', data-target='#navbarCollapse', aria-controls='navbarColor01', aria-expanded='false', aria-label='Toggle navigation')
      span.navbar-toggler-icon
    #navbarCollapse.collapse.navbar-collapse
      ul.navbar-nav.mr-auto
        li.nav-item(class=(title == 'Startseite') ? 'active' : null)
          a.text-nowrap.nav-link.ion-md-home(href='/') &nbsp;Startseite
        li.nav-item(class=(title == 'Alarmmonitor') ? 'active' : null)
          a.text-nowrap.nav-link.ion-md-desktop(href='/waip') &nbsp;Alarmmonitor
        li.nav-item(class=(title == 'Dashboard') ? 'active' : null)
          a.text-nowrap.nav-link.ion-md-clipboard(href='/dbrd') &nbsp;Dashboard    
      ul.navbar-nav.ml-auto
        li.text-nowrap.nav-item.dropdown
          a#navbarWeiteresDropdown.text-nowrap.nav-link.dropdown-toggle.ion-md-information-circle-outline(href='#', role='button', data-toggle='dropdown', aria-haspopup='true', aria-expanded='false')
            | &nbsp;Info
          .dropdown-menu(aria-labelledby='navbarWeiteresDropdown')
            a.text-nowrap.dropdown-item(href='/impressum') &nbsp;Impressum
            a.text-nowrap.dropdown-item(href='/datenschutz') &nbsp;Datenschutzerkl&auml;ung
            .dropdown-divider
            a.text-nowrap.dropdown-item(href='/about') &nbsp;&Uuml;ber diese Anwendung     
        if user
          if user.permissions == 'admin'
            li.text-nowrap.nav-item.dropdown
              a#navbarAdminDropdown.text-nowrap.nav-link.dropdown-toggle.ion-md-build(href='#', role='button', data-toggle='dropdown', aria-haspopup='true', aria-expanded='false')
                | &nbsp;Administration
              .dropdown-menu(aria-labelledby='navbarAdminDropdown')
                a.text-nowrap.dropdown-item.ion-md-contacts(href='/adm_edit_users') &nbsp;Benutzer und Rechte verwalten
                .dropdown-divider
                a.text-nowrap.dropdown-item.ion-md-globe(href='/adm_show_clients') &nbsp;Verbundene PCs und Benutzer anzeigen
                a.text-nowrap.dropdown-item.ion-md-list(href='/adm_show_missions') &nbsp;laufende Eins&auml;tze anzeigen
                .dropdown-divider
                a.text-nowrap.dropdown-item.text-danger.ion-md-warning(href='/adm_run_alert') &nbsp;Test-Alarm versenden
                a.text-nowrap.dropdown-item.ion-md-book(href='/adm_show_log') &nbsp;Log-Datei einsehen
          li.nav-item.pr-3(class=(title == 'Einstellungen') ? 'active' : null)
            a.text-nowrap.ion-md-settings.nav-link(href='/config') &nbsp;Einstellungen                 
          li.nav-item
            form(action='/logout', method='POST')
              button.btn.btn-dark.text-nowrap.ion-md-log-out(type='submit')=' \''+user.user +'\' abmelden'         
        else 
          li.nav-item(class=(title == 'Login') ? 'active' : null)
            a.text-nowrap.nav-link.ion-md-log-in(href='/login')  Anmelden
