Rewritten outputs.
[dive.git] / templates / xhtml.vm
blob3bdca573583d6fc604cd751a47111554232beca6
1 <?xml version="1.0" encoding="UTF-8"?>
2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3 <head>
4 <title>Muppet Plans</title>
5 <style type="text/css">
6 #include ("style.css")
7 </style>
8 <link rel="stylesheet" type="text/css" href="style.css"/>
9 <link rel="stylesheet" media="print" type="text/css" href="print.css"/>
10 </head>
11 <body>
12 #foreach ($depth in $depths)
13 <table class="dives">
14 <tr class="depth">
15 #set ($span = 2 + 2 * $dives.get($depth).size())
16 <td class="depth" colspan="${span}">${depth}m</div>
17 </tr>
18 <tr class="titles">
19 <td class="gas">Gas</td>
20 <td class="drt">D\RT</td>
21 #foreach ($dive in $dives.get($depth))
22 <td class="duration" colspan="2">${dive.duration}</td>
23 #end
24 </tr> <!-- titles -->
25 #foreach ($stopKey in $stopKeys.get($depth))
26 #if (0 == $foreach.count % 2)
27 #set ($class = "stop_even")
28 #else
29 #set ($class = "stop_odd")
30 #end
31 <tr class="${class}">
32 <td class="gas">${this.format(${stopKey.gas})}</td>
33 <td class="depth">${stopKey.depth}m</td>
34 #foreach ($dive in $dives.get($depth))
35 #set ($stop = ${dive.getStop($stopKey)})
36 #if ($stop)
37 <td class="duration">
38 $stop.duration
39 </td>
40 <td class="volume">
41 ${this.ceil($stop.gasVolume)}
42 </td>
43 #else
44 <td class="empty" colspan="2"/>
45 #end
46 #end
47 </tr> <!-- stop at ${stopKey.depth}m on >${stopKey.gas} -->
48 #end
49 <tr class="runtimes">
50 <td class="title" colspan="2">Run time</td>
51 #foreach ($dive in $dives.get($depth))
52 <td class="duration" colspan="2">${dive.tripTime}</td>
53 #end
54 </tr> <!-- runtimes -->
55 #foreach ($gas in $gases.get($depth))
56 <tr class="gastotals">
57 <td class="title" colspan="2">${this.format(${gas})}</td>
58 #foreach ($dive in $dives.get($depth))
59 <td class="volume" colspan="2">
60 ${this.ceil(${dive.getAscentVolume($gas)})}
61 </td>
62 #end
63 </tr> <!-- gastotals for $gas -->
64 #end
65 </table> <!-- dives to ${depth}m -->
66 #end
67 </body>
68 </html>