zuzak/gov.zk

View on GitHub
views/skeleton.pug

Summary

Maintainability
Test Coverage
//- Used for testing: [squeamish ossifrage]
doctype html
html
  head
    block title
      if zuzakistan
        title #{__('gov-zk')}
      title= req.hostname.toUpperCase()
    block css
      meta(name="viewport" content="width=device-width, initial-scale=1.0")
      link(rel='stylesheet', href='/index.css')
    block js
    if req
      // if req.user
      //- if req.user
      if true
        link(rel="shortcut icon" href="/figroll.png")
        link(rel="stylesheet", href="https://govuk-elements.herokuapp.com/public/stylesheets/fonts.css")
      else
        link(rel="shortcut icon" href="/favicon.png")
  body(class=zuzakistan ? 'zuzakistan' : 'white-label')
    if req && req.get('DNT') !== '1'
      if req.user
        script.
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

          ga('create', 'UA-20878451-7', 'auto');
          ga('send', 'pageview');
          ga('set', 'userId', '#{req.user}');
          ga('set', 'language', '#{getLocale()}');
      else
        script.
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

          ga('create', 'UA-20878451-7', 'auto');
          ga('send', 'pageview');
    header
      .header
        .grid-row
          .column-two-thirds.font-large
            block header
              if zuzakistan
                a.logo(href='/') ♛ #{__('gov-zk')}
              else
                a.logo(href='/') ♛ #{req.hostname.replace(/\..*\./, '.').toUpperCase()}
          .columns-one-third
            block login
              if req
                if req.user
                  //-
                    div.login
                     span Hello, #{req.user} 
                     a(href=__('/log-out')) #{__(log-out')}
                else
                  a.button.login(href=__('/log-in')) #{__('log-in')}
    #content
      block banner
        .accent-bar
        include banner.pug
      block breadcrumbs
        .breadcrumbs
          ol
            li
              a(href="/") #{__('home')}
            block breadcrumb
      block content
    footer
      .footer
        block footer
          .grid-row
            div.column-two-thirds.languages
              block languages
              h2 #{__('languages')}
              ul
                each locale in __h('autonym')
                  each autonym, skeleton_code in locale
                    if skeleton_code !== 'qqx' && req
                      li
                        a(href='/change-lang/'+skeleton_code+'?returnTo='+req.originalUrl) #{autonym}
            p.column-one-third.center
              a(href=__('/about-this-website')) #{__('about-link')}