]> git.rustad.me Git - duplo/commitdiff
Add ttt template
authorBjørn Rustad <rustadbjornen@gmail.com>
Wed, 21 Aug 2013 18:20:18 +0000 (20:20 +0200)
committerBjørn Rustad <rustadbjornen@gmail.com>
Wed, 21 Aug 2013 18:20:18 +0000 (20:20 +0200)
templates/stage/ttt.html.ep [new file with mode: 0644]

diff --git a/templates/stage/ttt.html.ep b/templates/stage/ttt.html.ep
new file mode 100644 (file)
index 0000000..c30632f
--- /dev/null
@@ -0,0 +1,68 @@
+% layout 'default';
+% title 'Stage';
+
+<h2><%= $stage->{'stage_name'} %></h2>
+<dl class="dl-horizontal">
+  <dt>Race</dt>
+  <dd>
+    <a href="<%== url_for 'race', race => $stage->{'race'} %>"><%= $stage->{'race_name'} %></a>
+  </dd>
+  <dt>Date and time</dt>
+  <dd><%= $stage->{'date'} %> <%= $stage->{'start'} %> - <%= $stage->{'finish'} %></dd>
+  <dt>Type</dt>
+  <dd><%= $stage->{'type'} %></dd>
+  <dt>Prologue</dt>
+  % if ($stage->{'prologue'}) {
+  <dd>Yes</dd>
+  % } else {
+  <dd>No</dd>
+  % }
+  </dt>
+</dl>
+
+<h3>Stage results</h3>
+<table class="table table-condensed">
+  <tr>
+    <th>#</th>
+    <th>Name</th>
+    <th>Time</th>
+  </tr>
+  % for my $team (@{ $results }) {
+  <tr>
+    <td><%= $team->{'number'} %></td>
+    <td><%= $team->{'name'} %></td>
+    <td><%= $team->{'time'} %></td>
+  </tr>
+  % }
+</table>
+
+% if ($is_admin) {
+<form class="form-inline" action="<%== url_for 'line_new' %>" method="post">
+  <input type="hidden" name="stage" value="<%= $stage->{'stage'} %>" />
+  <label for="name">Name:</label><input type="text" name="name" />
+  <select name="type">
+    <option value="" disabled selected>Line type</option>
+    <option value="FINISH">Finish</option>
+    <option value="SPRINT">Sprint</option>
+    <option value="MOUNTAIN">Mountain</option>
+  </select>
+  <select name="category">
+    <option value="" disabled selected>Category</option>
+    <option value="0">HC</option>
+    <option value="1">1</option>
+    <option value="2">2</option>
+    <option value="3">3</option>
+    <option value="4">4</option>
+  </select>
+  <label for="length">Length:</label><input type="text" name="length" />
+  <input type="submit" value="Create" />
+</form>
+% }
+
+% if ($is_admin) {
+<form class="form-inline" action="<%== url_for 'points_calculate' %>" method="post">
+  <input type="hidden" name="stage" value="<%= $stage->{'stage'} %>" />
+  <input type="submit" value="Calculate points" />
+</form>
+% }
+