about summary refs log tree commit diff
path: root/templates/battleQuick.html
diff options
context:
space:
mode:
authorEmile <git@emile.space>2024-11-06 19:02:14 +0100
committerEmile <git@emile.space>2024-11-06 19:02:14 +0100
commitfbfee6c9d2d7bb6b40ed0defbc5a94d15182171f (patch)
tree68b27051eb0f256d815cad83836fc3934d1a4644 /templates/battleQuick.html
parentc26dbb85981aee7c1f1fa1f37972126e5ac15e49 (diff)
battle updates
Diffstat (limited to 'templates/battleQuick.html')
-rw-r--r--templates/battleQuick.html57
1 files changed, 57 insertions, 0 deletions
diff --git a/templates/battleQuick.html b/templates/battleQuick.html
new file mode 100644
index 0000000..e309346
--- /dev/null
+++ b/templates/battleQuick.html
@@ -0,0 +1,57 @@
+{{ define "battleQuick" }}
+
+{{ template "head" . }}
+<body>
+  {{ template "nav" . }}
+
+  <span id="quickbattle"></span>
+  <h1><a href="#quickbattle">Quick battle</a></h1>
+  
+  <p>Just quickly want to try out two bots? Select them here and we'll let them fight quickly!</p>
+
+  <br>
+
+  <form id="battle" method="POST" action="/battle/quick">
+    <table class="trhover">
+    {{ range $bot := .bots }}
+      <tr>
+
+        <!-- The name of the bot with the link to the bot's page -->
+        <td>
+          <a href="/bot/{{ $bot.ID }}">{{ $bot.Name }}</a>
+        </td>
+
+        <!-- A checkbox allowing the user to select the bot -->
+              <!-- class="check-with-label" -->
+        <td>
+            <input
+              type="checkbox"
+              name="bot-{{$bot.ID}}"
+              id="bot-{{$bot.ID}}"
+              />
+            <label class="label-for-check" for="bot-{{$bot.ID}}"></label>
+        <td>
+
+        <!-- The list of users the bot belongs to-->
+        <td>
+          {{ range $idx, $usr := $bot.Users }}{{if $idx}},{{end}}<a href="/user/{{ $usr.ID }}">{{ $usr.Name }}</a>{{ end }}
+        </td>
+
+      </tr>
+    {{ end }}
+      <tr>
+        <td></td>
+        <td>{{ .res }}</td>
+      </tr>
+    </table>
+
+    <br>
+    <div class=".w-100"><input class="border" type="submit" value="Fight!"></div>
+    
+  </form>
+
+  <!-- {{ . }} -->
+
+</body>
+{{ template "footer" . }}
+{{ end }}