Make /_config/*.jst use ES6 superclass calls, fix failure to await the superclass...
[challenger_site.git] / navbar.jst
1 let XDate = require('xdate')
2
3 return async (env, head, body, scripts) => {
4   let globals = await env.site.get_json('/_config/globals.json')
5   let page = await _require('/page.jst')
6
7   await page(
8     env,
9     // head
10     head,
11     // body
12     async _out => {
13       nav.navbar.navbar-default.fixed-left {
14         div.container-fluid.mirobot-control {
15           //  Brand and toggle get grouped for better mobile display 
16           div.navbar-header {
17             button.navbar-toggle.collapsed(type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false") {
18               span.sr-only {'Toggle navigation'}
19               span.icon-bar {}
20               span.icon-bar {}
21               span.icon-bar {}
22             }
23             img.center-block(src="/images/thornbury_high_school.png" height="300px") {}
24           }
25         }
26
27         //  Collect the nav links, forms, and other content for toggling 
28         div.collapse.navbar-collapse#bs-example-navbar-collapse-1 {
29           ul.nav.navbar-nav {
30             let navigation = globals.navigation
31             for (let i = 0; i < navigation.length; ++i) {
32               let page = navigation[i]
33               let title = globals.page_to_title[page] || page
34               if (page === env.parsed_url.pathname)
35                 li.btn-block.active {
36                   a(href=page) {
37                     `${title}`
38                     span.sr-only {'(current)'}
39                   }
40                 }
41               else
42                 li.btn-block {
43                   a(href=page) {`${title}`}
44                 }
45             }
46           }
47           //ul.nav.navbar-nav.navbar-right {
48           //  li.btn-block {
49           //    a#give-feedback {'Give feedback'}
50           //  }
51           //} 
52         }
53       }
54
55       div.header {
56         div.container-fluid {
57           h5 {
58             _out.push('Challenger Disaster') //globals.page_to_breadcrumbs[env.parsed_url.pathname] || globals.page_to_title[env.parsed_url.pathname] || env.parsed_url.pathname)
59           }
60         }
61       }
62       div.container-fluid {
63         await body(_out)
64       }
65       div.footer {
66         div.container-fluid {
67           a(rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/") {
68             img(alt="Creative Commons License" style="border-width:0" src="/images/by-sa_3.0_88x31.png") {}
69           }
70           p {
71             'This website is '
72             a(href="https://git.ndcode.org/public/challenger_site.git") {
73               'open source'
74             }
75             ' and licensed under a '
76             a(rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/") {
77               'Creative Commons Attribution-ShareAlike 3.0 Unported License'
78             }
79             '.'
80           }
81
82           p {`Copyright © ${new XDate().getUTCFullYear()} Oliver Downing.`}
83         }
84       }
85     },
86     // scripts
87     async _out => {
88       scripts(_out)
89     }
90   )
91 }