1 let XDate = require('xdate')
3 return async (env, head, body) => {
4 let feedback_form = await _require('/feedback_form.jst')
5 let globals = await env.site.get_json('/_config/globals.json')
6 let icon_search = await env.site.get_min_svg('/_svg/icon_search.svg')
7 let logo_large = await env.site.get_min_svg('/_svg/logo_large.svg')
8 let page = await _require('/page.jst')
15 div(style="padding-left: calc(100vw - 100%);") {
16 div.container(style="margin-top: 15px; margin-bottom: 15px;") {
18 // div.col-sm-12(style="text-align: right;") {
19 // a(href="/login.html") {'Login'}
23 div.'col-sm-8'.vbottom {
26 div.'col-sm-4'.vbottom(style="padding-bottom: 15px;") {
27 form(action="/search.html") {
29 input.form-control(name="query" type="text" placeholder="Search") {}
30 span.input-group-btn {
31 button.btn.btn-default(type="submit") {
32 _out.push(icon_search)
41 nav.navbar.navbar-default(style="margin-top: 0px; margin-bottom: 0px;") {
42 div(style="padding-left: calc(100vw - 100%);") {
43 div.container { //-fluid") {
44 // Brand and toggle get grouped for better mobile display
46 button.navbar-toggle.collapsed(type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false") {
47 span.sr-only {'Toggle navigation'}
52 //a.navbar-brand(href="#") {'Brand'}
55 // Collect the nav links, forms, and other content for toggling
56 div.collapse.navbar-collapse#bs-example-navbar-collapse-1 {
58 let navigation = globals.navigation
59 for (let i = 0; i < navigation.length; ++i) {
60 let page = navigation[i]
61 let title = globals.page_to_title[page] || page
62 if (page === env.parsed_url.pathname)
66 span.sr-only {'(current)'}
71 a(href=page) {`${title}`}
75 ul.nav.navbar-nav.navbar-right {
77 a#give-feedback {'Give feedback'}
84 div(style="padding-left: calc(100vw - 100%);") {
90 div.footer(style="padding-left: calc(100vw - 100%);") {
91 div.container { //-fluid") {
92 div(style="height: 16px;") {}
93 a(rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/") {
94 img(alt="Creative Commons License" style="border-width:0" src="images/by-sa_3.0_88x31.png") {}
97 'This work is licensed under a '
98 a(rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/") {
99 'Creative Commons Attribution-ShareAlike 3.0 Unported License'
104 p {'Code samples within the page are placed in the public domain unless otherwise noted.'}
106 p {`Copyright © ${new XDate().getUTCFullYear()} Integration Logic Pty Ltd trading as NDCODE and contributors.`}
111 div#feedback-modal.modal.fade(role="dialog") {
115 button.close(type="button" data-dismiss="modal") {
124 'Did you notice something not quite right, or just want to share your impression of this page?'
126 await feedback_form(env, _out)
129 button.btn.btn-primary(type="submit" form="feedback-form") {
132 button.btn.btn-default(type="button" data-dismiss="modal") {
140 div#message-modal.modal.fade(role="dialog") {
144 button.close(type="button" data-dismiss="modal") {
152 p#message-modal-message {}
155 button.btn.btn-default(type="button" data-dismiss="modal") {
165 // when feedback form is submitted, do not reload the page
167 $(document).ready(function() {
168 $('#give-feedback').click(function() {
169 $('#feedback-modal').modal('show')
170 $('#feedback-form-message').text('')
172 $('#feedback-modal').on('shown.bs.modal', function() {
173 $('#feedback-form-message').focus()
175 $(document).on('submit', '#feedback-form', function(e) {
178 url: '/feedback.html',
181 page: window.location.href,
182 message: $('#feedback-form-message').val()
184 success: function(data, textStatus, jqXHR) {
185 $('#feedback-modal').modal('hide')
186 $('#message-modal-message').text(data)
187 $('#message-modal').modal('show')
189 error: function(jqXHR, textStatus, errorThrown) {
190 $('#feedback-modal').modal('hide')
191 $('#message-modal-message').text(errorThrown)
192 $('#message-modal').modal('show')