Make /_config/*.jst use ES6 superclass calls, fix failure to await the superclass...
[olly_site.git] / trapezium.html.jst
1 return async env => {
2   let _out = []
3   _out.push('<!DOCTYPE html>')
4   html {
5     head {
6       link(rel="stylesheet" type="text/css" href="olly.css") {}
7       title {
8         'Trapezium Area Calculator'
9       }
10       style {
11         form div + div {
12           margin-top: 1em
13         }
14         label {
15           display: inline-block;
16           width: 90px;
17           text-align: right
18         }
19         input,
20         textarea {
21           font: 1em sans-serif;
22           width: 300px;
23           box-sizing: border-box;
24           border: 1px solid #999
25         }
26         input:focus,
27         textarea:focus {
28           border-color: #000
29         }
30         textarea {
31           vertical-align: top;
32           height: 5em
33         }
34         .button {
35           padding-left: 90px
36         }
37         button {
38           margin-left: .5em
39         }
40       }
41     }
42     body.olly {
43       h1 {
44         'Trapezium Area Calculator'
45       }
46       img(src="drawing.svg") {}
47       form(action="/calculate_button_trapezium.html" method="post") {
48         div {
49           label(for="height") {
50             'Height:'
51           }
52           ' '
53           input#height(type="text" name="height") {}
54           ' units'
55         }
56         div {
57           label(for="a_length") {
58             'A:'
59           }
60           ' '
61           input#a_length(type="text" name="a_length") {}
62           ' units'
63         }
64         div {
65           label(for="b_length") {
66             'B:'
67           }
68           ' '
69           input#b_length(type="text" name="b_length") {}
70           ' units'
71         }
72         div.button {
73           button(type="submit") {
74             'Calculate'
75           }
76         }
77       }
78     }
79   }
80   env.site.serve(env, 200, Buffer.from(_out.join('')), 'trapezium.html.jst')
81 }