about summary refs log tree commit diff
path: root/templates
diff options
context:
space:
mode:
authorEmile <git@emile.space>2024-08-16 19:50:26 +0200
committerEmile <git@emile.space>2024-08-16 19:50:26 +0200
commit1a57267a17c2fc17fb6e104846fabc3e363c326c (patch)
tree1e574e3a80622086dc3c81ff9cba65ef7049b1a9 /templates
initial commit
Diffstat (limited to 'templates')
-rw-r--r--templates/battleNew.html79
-rw-r--r--templates/battleSingle.html226
-rw-r--r--templates/battles.html27
-rw-r--r--templates/botNew.html69
-rw-r--r--templates/botSingle.html102
-rw-r--r--templates/bots.html24
-rw-r--r--templates/footer.html6
-rw-r--r--templates/head.html127
-rw-r--r--templates/index.html68
-rw-r--r--templates/login.html41
-rw-r--r--templates/nav.html74
-rw-r--r--templates/register.html40
-rw-r--r--templates/user.html19
-rw-r--r--templates/userProfile.html46
-rw-r--r--templates/users.html17
15 files changed, 965 insertions, 0 deletions
diff --git a/templates/battleNew.html b/templates/battleNew.html
new file mode 100644
index 0000000..0460dc7
--- /dev/null
+++ b/templates/battleNew.html
@@ -0,0 +1,79 @@
+{{ define "battleNew" }}
+
+{{ template "head" . }}
+<body>
+  {{ template "nav" . }}
+
+  <span id="newbattle"></span>
+  <h1><a href="#newbattle">New battle</a></h1>
+  
+  <p>This is the page on which you can create a battle. Select the values you find appropriate.
+   Bots can be added to the battle later.</p>
+
+  <br>
+
+  <table>
+    <form id="battle" method="POST" action="/battle/new">
+      <tr>
+        <td><label for="name">Name:</label></td>
+        <td><input class="border" type="text" id="name" name="name" autofocus></td>
+      </tr>
+
+      <tr>
+        <td>Archs:</td>
+        <td>{{ range $idx, $arch := .archs }}{{ if $idx }},{{ end }}
+          <input
+            type="checkbox"
+            class="check-with-label"
+            name="arch-{{$arch.ID}}"
+            id="arch-{{$arch.ID}}"
+            form="battle"
+            {{if eq $arch.Name "x86-64"}}checked{{end}}
+            {{if eq $arch.Name "ARM"}}checked{{end}}/>
+          <label class="label-for-check" for="arch-{{$arch.ID}}">{{$arch.Name}}</label>
+          {{- end }}
+        </td>
+      </td>
+
+      <tr>
+        <td>Bits:</td>
+        <td>
+          {{ range $idx, $bit := .bits}}{{if $idx}},{{end}}
+          <input
+            type="checkbox"
+            class="check-with-label"
+            name="bit-{{$bit.ID}}"
+            id="bit-{{$bit.ID}}"
+            {{if eq $bit.Name "32"}}checked{{end}}
+            {{if eq $bit.Name "64"}}checked{{end}}/>
+          <label class="label-for-check" for="bit-{{$bit.ID}}">{{$bit.Name}}</label>
+          {{- end }}
+        </td>
+      </td>
+
+      <tr>
+        <td>Public:</td>
+        <td>
+          <input
+            type="checkbox"
+            name="public"
+            id="public"/>
+        </td>
+      </td>
+
+      <tr>
+        <td></td>
+        <td><input class="border" type="submit" value="Create"></td>
+      </tr>
+
+      {{ if .res }}
+      <tr>
+        <td></td>
+        <td>{{ .res }}</td>
+      </tr>
+      {{ end }}
+    </form>
+  </table>
+</body>
+{{ template "footer" . }}
+{{ end }}
diff --git a/templates/battleSingle.html b/templates/battleSingle.html
new file mode 100644
index 0000000..fb53fc2
--- /dev/null
+++ b/templates/battleSingle.html
@@ -0,0 +1,226 @@
+{{ define "battleSingle" }}
+
+{{ template "head" . }}
+<body>
+  {{ template "nav" . }}
+
+  <span id="battle"></span>
+  <h1><a href="#battle">{{ .battle.Name }}</a></h1>
+
+  <pre>
+<a href="#settings">Settings</a>
+<a href="#elimination-ladder">Elimination Ladder</a>
+  <a href="#round-1">Round 1</a>
+  <a href="#round-2">Round 2</a>
+  <a href="#round-3">Round 3</a>
+<a href="#current-standings">Current Standings</a>
+  </pre>
+
+  <span id="settings"></span>
+  <h2><a href="#settings">Settings</a></h2>
+
+  <form id="delete" method="POST" action="/battle/{{ .battle.ID }}/delete">
+  </form>
+
+  <table>
+    <form id="battle" method="POST" action="/battle/{{ .battle.ID }}">
+      <tr>
+        <td><label for="name">Name:</label></td>
+        <td><input class="border" type="text" id="name" name="name" value="{{ .battle.Name }}"></td>
+      </tr>
+
+      <tr>
+        <td><label for="latestBotSubmission">Latest Bot Submission</label></td>
+        <td><input
+              class="border"
+              type="datetime-local"
+              id="latestBotSubmission"
+              name="latestBotSubmission"
+              value="2024-11-08T12:00"
+              ></td>
+      </tr>
+
+      <tr>
+        <td><label for="battleStart">Battle Start</label></td>
+        <td><input
+              class="border"
+              type="datetime-local"
+              id="battleStart"
+              name="battleStart"
+              value="2024-11-08T16:00"
+              ></td>
+      </tr>
+
+<!--
+      <tr>
+        <td><label for="owners">Owners:</label></td>
+        <td>
+          {{ range $idx, $usr := .battle.Owners }}{{if $idx}},{{end}}<a href="/user/{{ $usr.ID }}">{{ $usr.Name }}</a>{{ end }}
+        </td>
+      </tr>
+
+      <tr>
+        <td><label for="bots">Bots:</label></td>
+        <td>
+          {{ range $idx, $bot := .battle.Bots }}{{if $idx}},{{end}}<a href="/bot/{{ $bot.ID }}">{{ $bot.Name }}</a>{{ end }}
+        </td>
+      </tr>
+      -->
+
+      <tr>
+        <td><label for="public">Public?</label></td>
+        <td><input type="checkbox" id="public" name="public" {{ if .battle.Public }}checked{{end}}/></td>
+      </tr>
+
+      <tr>
+        <td>Archs</td>
+        <td>
+          {{ range $idx, $arch := .archs }}{{if $idx}},{{end}}
+            <input
+              type="checkbox"
+              class="check-with-label"
+              name="arch-{{$arch.ID}}"
+              id="arch-{{$arch.ID}}"
+              {{if $arch.Enabled}}checked{{end}}/>
+            <label class="label-for-check" for="arch-{{$arch.ID}}">{{$arch.Name}}</label>
+          {{- end }}
+        </td>
+      </td>
+
+      <tr>
+        <td>Bits</td>
+        <td>{{ range $idx, $bit := .bits }}{{if $idx}},{{end}}
+          <input
+            type="checkbox"
+            class="check-with-label"
+            id="bit-{{$bit.ID}}"
+            name="bit-{{$bit.ID}}"
+            {{if $bit.Enabled}}checked{{end}}/>
+          <label class="label-for-check" for="bit-{{$bit.ID}}">{{$bit.Name}}</label>
+          {{- end }}
+        </td>
+      </td>
+
+      <tr>
+        <td></td>
+        <td>
+          <table>
+            <tr>
+              <td style="width: 33%;"><input class="border" type="submit" value="Save"></td>
+              <td style="width: 33%;"></td>
+              <td style="width: 33%; ">
+                <input type="submit" value="Delete this battle" form="delete" style="border: 1px solid red; ">
+              </td>
+            </tr>
+          </table>
+        </td>
+      </tr>
+
+    </form>
+
+    {{ if .res }}
+    <tr>
+      <td></td>
+      <td>{{ .res }}</td>
+    </tr>
+    {{ end }}
+
+    <tr>
+      <td><br><hr><br></td>
+      <td><br><hr><br></td>
+    </tr>
+
+    {{ if .myBots }}
+
+    <form method="POST" action="/battle/{{ .battle.ID }}/submit">
+      <tr>
+        <td><label for="name">My Bots</label></td>
+        <td style="width: 100%;">
+          <table class="trhover">
+            {{ range $bot := .myBots  }}
+            <tr>
+              <td style="text-align: center; vertical-align: middle; width: 2ex;">
+                <input
+                  type="checkbox"
+                  id="bot-{{$bot.ID}}"
+                  name="bot-{{$bot.ID}}"
+                  value="{{$bot.ID}}" />
+              </td>
+              <td style="vertical-align: middle">
+                <label for="bot-{{$bot.ID}}">
+                  <a href="/bot/{{$bot.ID}}">{{$bot.Name}}</a>
+                </label>
+              </td>
+            </tr>
+            {{ end }}
+          </table>
+        </td>
+      </tr>
+
+      <tr>
+        <td></td>
+        <td><input class="border" type="submit" value="Submit"></td>
+      </tr>
+    </form>
+
+    {{ else }}
+
+    <tr>
+      <td></td>
+      <td><a href='/bot/new'>Upload a bot</a> to get started!</td>
+    </tr>
+
+    {{ end }}
+  <table>
+
+  <span id="elimination-ladder"></span>
+  <h2><a href="#elimination-ladder">Elimination Ladder</a></h2>
+
+  <span id="round-1"></span>
+  <h3><a href="#round-1">Round 1</a></h2>
+
+  <br><a href="">Round 1.1</a>: <a href="">bot1</a> vs <a href="">bot2</a>
+  <br><a href="">Round 1.2</a>: <a href="">bot3</a> vs <a href="">bot4</a>
+  <br>
+  <br><a href="">Round 1.3</a>: <a href="">bot1</a> vs <a href="">bot2</a>
+  <br><a href="">Round 1.4</a>: <a href="">bot3</a> vs <a href="">bot4</a>
+
+  <span id="round-2"></span>
+  <h3><a href="#round-2">Round 2</a></h2>
+
+  <br><a href="">Round 2.1</a>: winner of <a href="">round 1.1</a> vs winner of <a href="">round 1.2</a>
+  <br><a href="">Round 2.2</a>: winner of <a href="">round 1.3</a> vs winner of <a href="">round 1.4</a>
+
+  <span id="round-3"></span>
+  <h3><a href="#round-3">Round 3</a></h2>
+
+  <br><a href="">Round 3.1</a>: winner of <a href="">round 2.1</a> vs winner of <a href="">round 2.2</a>
+
+  <span id="current-standings"></span>
+  <h2><a href="#current-standings">Current Standings</a></h2>
+
+  <p>There are {{ .botAmount }} Bots in this battle, as we're executing each battle two times with all permutations, we're executing {{ .battleCount }} battles.</p>
+
+  <br>What is Lorem Ipsum?
+  <br>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
+
+  <br>Why do we use it?
+  <br>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
+
+
+  <br>Where does it come from?
+  <br>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
+
+  <br>The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.
+
+  <br>Where can I get some?
+  <br>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
+  <br>Where can I get some?
+  <br>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
+  <br>Where can I get some?
+  <br>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
+  <br>Where can I get some?
+  <br>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
+</body>
+{{ template "footer" . }}
+{{ end }}
diff --git a/templates/battles.html b/templates/battles.html
new file mode 100644
index 0000000..bdc4d4b
--- /dev/null
+++ b/templates/battles.html
@@ -0,0 +1,27 @@
+{{ define "battles" }}
+
+{{ template "head" . }}
+<body>
+  {{ template "nav" . }}
+
+  <span id="allbattles"></span>
+  <h1><a href="#allbattles">All Battles</a></h1>
+
+  <p>A battle is a collection of matches. It plays through all matches in the elimination ladder in order to determine an overall winner.</p>
+  <br>
+
+  <table class="trhover">
+  {{ range $battle := .battles }}
+    <tr>
+      <td>
+        - <a href="/battle/{{ $battle.ID }}">{{ $battle.Name }}</a>
+      </td>
+      <td>
+        {{ range $idx, $bot := $battle.Bots }}{{if $idx}},{{end}}<a href="/user/{{ $bot.ID }}">{{ $bot.Name }}</a>{{ end }}
+      </td>
+    </tr>
+  {{ end }}
+  </table>
+</body>
+{{ template "footer" . }}
+{{ end }}
diff --git a/templates/botNew.html b/templates/botNew.html
new file mode 100644
index 0000000..1d6e8a3
--- /dev/null
+++ b/templates/botNew.html
@@ -0,0 +1,69 @@
+{{ define "botNew" }}
+
+{{ template "head" . }}
+<body>
+  {{ template "nav" . }}
+
+  <span id="newbot"></span>
+  <h1><a href="#newbot">New Bot</a></h1>
+  
+  This is the page on which you can submit your bots
+
+  <form method="POST" action="/bot/new">
+    <table>
+      <tr>
+        <td><label for="name">Name:</label></td>
+        <td><input class="border" type="text" id="name" name="name"></td>
+      </tr>
+
+      <tr>
+        <td>Archs</td>
+        <td>
+          {{ range $idx, $arch := .archs }}{{if $idx}},{{end}}
+            <input
+              type="checkbox"
+              class="check-with-label"
+              name="arch-{{$arch.ID}}"
+              id="arch-{{$arch.ID}}"/>
+            <label class="label-for-check" for="arch-{{$arch.ID}}">{{$arch.Name}}</label>
+          {{- end }}
+        </td>
+      </td>
+
+      <tr>
+        <td>Bits</td>
+        <td>{{ range $idx, $bit := .bits }}{{if $idx}},{{end}}
+          <input
+            type="checkbox"
+            class="check-with-label"
+            id="bit-{{$bit.ID}}"
+            name="bit-{{$bit.ID}}"/>
+          <label class="label-for-check" for="bit-{{$bit.ID}}">{{$bit.Name}}</label>
+          {{- end }}
+        </td>
+      </td>
+
+      <tr>
+        <td><label for="source">Source:</label></td>
+        <td><textarea
+              class="border"
+              id="source"
+              name="source"
+              cols="80"
+              rows="15"></textarea></td>
+      </tr>
+
+      <tr>
+        <td></td>
+        <td><input type="submit" value="Submit"></td>
+      </tr>
+
+      <tr>
+        <td></td>
+        <td>{{ .res }}</td>
+      </tr>
+    </table>
+  </form>
+</body>
+{{ template "footer" . }}
+{{ end }}
diff --git a/templates/botSingle.html b/templates/botSingle.html
new file mode 100644
index 0000000..dcb874f
--- /dev/null
+++ b/templates/botSingle.html
@@ -0,0 +1,102 @@
+{{ define "botSingle" }}
+
+{{ template "head" . }}
+<body>
+  {{ template "nav" . }}
+
+  <span id="bot"></span>
+  <h1><a href="#bot">{{ .bot.Name }}</a></h1>
+
+  <form method="POST" action="/bot/{{ .bot.ID }}">
+    <table>
+      {{ if .editable }}
+      <tr>
+        <td><label for="name">Name:</label></td>
+        <td><input class="border" type="text" id="name" name="name" value="{{ .bot.Name }}"></td>
+      </tr>
+      {{ else }}
+      {{ end }}
+
+      <tr>
+        <td>Archs</td>
+        <td>
+          {{ range $idx, $arch := .archs }}{{if $idx}},{{end}}
+            <input
+              type="checkbox"
+              class="check-with-label"
+              name="arch-{{$arch.ID}}"
+              id="arch-{{$arch.ID}}"
+              {{if $arch.Enabled}}checked{{end}}
+              {{if $.editable}}{{else}}disabled="disabled"{{end}}/>
+            <label class="label-for-check" for="arch-{{$arch.ID}}">{{$arch.Name}}</label>
+          {{- end }}
+        </td>
+      </td>
+
+      <tr>
+        <td>Bits</td>
+        <td>{{ range $idx, $bit := .bits }}{{if $idx}},{{end}}
+          <input
+            type="checkbox"
+            class="check-with-label"
+            id="bit-{{$bit.ID}}"
+            name="bit-{{$bit.ID}}"
+            {{if $bit.Enabled}}checked{{end}}
+            {{if $.editable}}{{else}}disabled="disabled"{{end}}/>
+          <label class="label-for-check" for="bit-{{$bit.ID}}">{{$bit.Name}}</label>
+          {{- end }}
+        </td>
+      </td>
+
+      <tr>
+        <td><label for="source">Source:</label></td>
+        <td><textarea
+          id="source"
+          name="source"
+          cols="80"
+          rows="15"
+          {{ if .editable }}{{ else }}readonly{{ end }}
+        >{{ .bot.Source }}</textarea></td>
+      <tr>
+
+      {{ if .editable }}
+      <tr>
+        <td></td>
+        <td><input class="border" type="submit" value="Save"></td>
+      </tr>
+      {{ else }}
+      {{ end }}
+
+      <tr>
+        <td></td>
+        <td>{{ .res }}</td>
+      </tr>
+
+      <tr><td><hr></td><td><hr></td></tr>
+
+      <tr>
+        <td>CMD</td>
+        <td>{{ .bytecode_r2cmd }}</td>
+      </tr>
+      <tr>
+        <td>Bytecode</td>
+        <td>{{ .bytecode }}</td>
+      </tr>
+
+      <tr><td><hr></td><td><hr></td></tr>
+
+      <tr>
+        <td>CMD</td>
+        <td>{{ .disasm_r2cmd }}</td>
+      </tr>
+      <tr>
+        <td>Disasm</td>
+        <td><pre>{{ .disasm }}</pre></td>
+      </tr>
+
+    <table>
+  </form>
+
+</body>
+{{ template "footer" . }}
+{{ end }}
diff --git a/templates/bots.html b/templates/bots.html
new file mode 100644
index 0000000..34fa0c2
--- /dev/null
+++ b/templates/bots.html
@@ -0,0 +1,24 @@
+{{ define "bots" }}
+
+{{ template "head" . }}
+<body>
+  {{ template "nav" . }}
+
+  <span id="allbots"></span>
+  <h1><a href="#allbots">All Bots</a></h1>
+
+  <table class="trhover">
+  {{ range $bot := .bots }}
+    <tr>
+      <td>
+        <a href="/bot/{{ $bot.ID }}">{{ $bot.Name }}</a>
+      </td>
+      <td>
+        {{ range $idx, $usr := $bot.Users }}{{if $idx}},{{end}}<a href="/user/{{ $usr.ID }}">{{ $usr.Name }}</a>{{ end }}
+      </td>
+    </tr>
+  {{ end }}
+  </table>
+</body>
+{{ template "footer" . }}
+{{ end }}
diff --git a/templates/footer.html b/templates/footer.html
new file mode 100644
index 0000000..cb7b0c9
--- /dev/null
+++ b/templates/footer.html
@@ -0,0 +1,6 @@
+{{ define "footer" }}
+{{ if .asd }}
+<br><br><hr><br>
+{{ . }}
+{{ end }}
+{{ end }}
diff --git a/templates/head.html b/templates/head.html
new file mode 100644
index 0000000..3bec2a9
--- /dev/null
+++ b/templates/head.html
@@ -0,0 +1,127 @@
+{{ define "head" }}
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <title>r2wa.rs</title>
+
+  <style>
+* { word-wrap:break-word !important; font-family: monospace; margin: 0; padding: 0; }
+
+/* light/darktheme specific foo */
+@media (prefers-color-scheme: light) {
+  html { background: #fafafa; color: #040404; }
+  a:hover { color: #fafafa; background: #040404 }
+  a:not([href*="webring.xxiivv.com"]):hover, nav a:active { color: #fafafa; background: #040404 }
+  a { color: #040404; background: #fafafa; text-decoration: none;}
+  nav a:hover, a:active { color: #fafafa; background: #040404 }
+  nav { margin: 1ex 0; background: #eeeeee; }
+  nav a { display:block; background: #eeeeee; }
+  h1 { margin: 3ex 0 1ex 0; width: 100%; background-color: #eeeeee}
+  h2 { margin: 2ex 0 1ex 0; width: 100%; background-color: #eeeeee}
+  h3 { margin: 1ex 0 1ex 0; width: 100%; font-size: 1em; background-color: #eeeeee}
+  h4 { margin: 1ex 0 1ex 0; width: 100%; font-size: 1em; /*background-color: #fafafa*/}
+  h5 { margin: 1ex 0 1ex 0; width: 100%; font-size: 1em; /*background-color: #fafafa*/}
+  .code { border-left: 1px solid #040404; margin-left: 2ex; padding-left: 1ex; }
+  .trhover tr:hover { border-bottom: 1px solid #dddddd; }
+
+  /* add an outline while hovering, the !important makes hovering on checked elements still visible */
+  .check-with-label:checked + .label-for-check { background-color: #040404; color: #eeeeee !important; }
+  .check-with-label:hover + .label-for-check { outline: 1px solid #040404; color: #040404; }
+
+  .border { outline: 1px solid #040404; border: none; }
+}
+@media (prefers-color-scheme: dark) {
+  html { background: #040404; color: #c0c0c0; }
+  a:hover { color: #040404; background: #c0c0c0 }
+  body nav a:not([href*="webring.xxiivv.com"]):hover, nav a:active { color: #c0c0c0; background: #040404 }
+  a { color: #c0c0c0; background: #040404; text-decoration: none; }
+  nav a:hover, a:active { color: #040404; background: #c0c0c0 }
+  nav { margin: 1ex 0; background: #c0c0c0; }
+  nav a { display:block; background: #c0c0c0; }
+  h1 { margin: 3ex 0 1ex 0; width: 100%; background-color: #c0c0c0}
+  h2 { margin: 2ex 0 1ex 0; width: 100%; background-color: #c0c0c0}
+  h3 { margin: 1ex 0 1ex 0; width: 100%; font-size: 1em; background-color: #c0c0c0}
+  h4 { margin: 1ex 0 1ex 0; width: 100%; font-size: 1em; /*background-color: #c0c0c0*/}
+  h5 { margin: 1ex 0 1ex 0; width: 100%; font-size: 1em; /*background-color: #c0c0c0*/}
+  .code { border-left: 1px solid #c0c0c0; margin-left: 2ex;  padding-left: 1ex; }
+  .webring { -webkit-filter: invert(100%); filter: invert(100%); }
+  .trhover tr:hover { background: #c0c0c0; color: #040404; }
+
+  /* add an outline while hovering, the !important makes hovering on checked elements still visible */
+  .check-with-label:checked + .label-for-check { background-color: #c0c0c0; color: #040404 !important; }
+  .check-with-label:hover + .label-for-check { outline: 1px solid #c0c0c0; color: #c0c0c0; }
+
+  input, textarea { background-color: #c0c0c0; }
+  .border { outline: 1px solid #c0c0c0; border: none; }
+}
+
+/* settings for mobile devices*/
+@media only screen and (max-width: 768px) {
+  body { margin: 1ex; width: calc(100% - 2ex) !important; }
+  img { max-width: 100% !important; max-height: 500px; }
+}
+img { max-width: 100ex; max-height: 500px; }
+
+body { margin-left: auto; margin-right: auto; margin-top: 1ex; margin-bottom: 1ex; width: 100ex; }
+
+.webring { align: right; }
+a .webring { float: right; }
+
+/* display local links using [] and external links using {} */
+body a:not(h1 a, h2 a, h3 a,h4 a):not([href*="webring.xxiivv.com"]):not([class*="local"]):before { content: "["; }
+body a:not(h1 a, h2 a, h3 a,h4 a):not([href*="webring.xxiivv.com"]):not([class*="local"]):after { content: "]"; }
+a[href*="//"]:not([href*="r2wa.rs"]):not([class*="icon"]):before { content: '{'; }
+a[href*="//"]:not([href*="r2wa.rs"]):not([class*="icon"]):after { content: '}'; }
+
+table { width: 100%; }
+input, textarea { width: 100%; }
+textarea { padding: 0.5ex; }
+
+ul { list-style-type: none; }
+
+/* navigation bar magic */
+nav * { color: #040404; }
+nav ul { list-style: none; position: relative; display: inline-block; }
+nav ul li { display:inline-block; }
+nav ul ul { display: none; position: absolute; outline: 1px solid #040404; background-color: #ff0; }
+nav ul ul li { width: 100%; padding-right: 1ex; float:none; display:list-item; position: relative; }
+nav + ul li { display: inline-block;}
+
+/* only display the hover dropdown on non-mobile devices */
+@media only screen and (min-width: 768px) {
+  nav ul li:hover a + ul { display: inherit; white-space: nowrap; }
+}
+
+/* nav bar spacing char */
+nav ul li > a::after { content: " /"; }
+nav ul li > a:only-child::after { content: ""; }
+nav ul li:last-of-type a::after { content: ""; }
+
+h1 a, h2 a, h3 a { padding-right: 1ex; }
+
+pre { white-space: pre-wrap; hyphens: auto; }
+pre.code { white-space: pre-wrap; hyphens: none; }
+
+/* display the list of folders in the current one as a vertical list, if the
+ * .vert class is present */
+nav + ul.vert li { display: block; }
+
+.w-100 { width: 100%; }
+
+.check-with-label { display: none; }
+
+body table tbody tr td { padding-bottom: 0.5ex; vertical-align: top; }
+body table tbody tr td:not(:last-child) { padding-right: 1ex; }
+
+tr { text-wrap: wrap;}
+
+input { padding-left: 0.5ex; }
+input:focus { outline-offset: 0px; }
+textarea:focus { outline-offset: 0px; }
+
+  </style>
+</head>
+{{ end }}
diff --git a/templates/index.html b/templates/index.html
new file mode 100644
index 0000000..9184a9c
--- /dev/null
+++ b/templates/index.html
@@ -0,0 +1,68 @@
+{{ define "index" }}
+
+{{ template "head" . }}
+<body>
+  {{ template "nav" . }}
+  {{ if .logged_in }}{{ else }}
+  {{ end }}
+
+  <span id="r2wars"></span>
+  <h1><a href="#r2wars">r2wa.rs</a></h1>
+
+  {{ if .err }}
+    <div class="error">{{ .err }}</div>
+  {{ end }}
+
+
+  This is the r2wars web platform. Here, you can manage your bots and let them
+  "fight" (be executed) in the same memory space as others.
+
+  Under the hood, the <a href="https://radare.org/n/">radare2</a> <a href="https://book.rada.re/emulation/intro.html">ESIL Emulation</a> is used to allow all fun combinations!
+
+  <span id="r2wars"></span>
+  <h2><a href="#r2wars">What is it and how does it work?</a></h2>
+
+  Essentially
+  <br><br>
+
+  <pre class="code">
+  ; r2 malloc://1024                           # allocate 1KB of memory
+  [0x00000000]> e asm.arch = x86               # define the arch to use
+  [0x00000000]> e asm.bits = 32                # define the bits to use
+  [0x00000000]> aei                            # init vm
+  [0x00000000]> aeim                           # init staack
+  [0x00000000]> waf bot.asm                    # write bot to memory
+  [0x00000000]> aer PC = 0x100                 # set program counter
+  [0x00000000]> aer SP = SP + 0x100            # set stack pointer
+  [0x00000000]> e cmd.esil.todo=f theend=1     # define end condition
+  [0x00000000]> e cmd.esil.trap=f theend=1     # define end condition
+  [0x00000000]> e cmd.esil.intr=f theend=1     # define end condition
+  [0x00000000]> e cmd.esil.ioer=f theend=1     # define end condition
+  [0x00000000]> f theend=0                     # set the end flag to 0
+  [0x00000000]> aes                            # step
+  [0x00000000]> ?v 1+theend                    # check if the end cond. is met
+  ..                                           # in a loop
+  [0x00000000]> aes                            # step
+  [0x00000000]> ?v 1+theend                    # check if the end cond. is met
+  </pre>
+
+  <br>
+  More info in the following blogpost: <a href="https://emile.space/blog/2020/r2wars/">https://emile.space/blog/2020/r2wars/</a>
+  <br>
+  <br>
+
+  <pre>
+╭──╮    ╭──────────────────────╮
+│ _│_   │                      │
+│ O O  <  LET THE GAMES BEGIN! │
+│  │╷   │                      │
+│  ││   ╰──────────────────────╯
+│ ─╯│
+╰───╯
+  </pre>
+
+
+
+</body>
+{{ template "footer" . }}
+{{ end }}
diff --git a/templates/login.html b/templates/login.html
new file mode 100644
index 0000000..a4fc358
--- /dev/null
+++ b/templates/login.html
@@ -0,0 +1,41 @@
+{{ define "login" }}
+
+{{ template "head" . }}
+<body>
+  {{ template "nav" . }}
+
+  <span id="login"></span>
+  <h1><a href="#login">Login</a></h1>
+
+  {{ if .err }}{{ .err }}{{ end }}
+  {{ if .logged_in }}
+  Already logged in! <a href="/">Return home</a>
+  {{ else }}
+  <form method="POST" action="/login">
+
+    <table>
+      <tr>
+        <td><label for="username">Name:</label></td>
+        <td><input class="border" type="text" id="username" name="username" autofocus></td>
+      </tr>
+      <tr>
+        <td><label for="password">Password:</label></td>
+        <td><input class="border" type="password" id="password" name="password"></td>
+      </tr>
+      <tr>
+        <td></td>
+        <td><input class="border" type="submit" value="Login"></td>
+      </tr>
+      <tr>
+        <td></td>
+        <td>{{ .res }}</td>
+      </tr>
+    </table>
+  </form>
+  Not registered yet? <a href="/register">Register Now!</a>
+  {{ end }}
+
+  
+</body>
+{{ template "footer" . }}
+{{ end }}
diff --git a/templates/nav.html b/templates/nav.html
new file mode 100644
index 0000000..b28bf38
--- /dev/null
+++ b/templates/nav.html
@@ -0,0 +1,74 @@
+{{ define "nav" }}
+  <header>
+    <p style="margin: 1ex 0; display: block; width: 100%; background-color: red; color: white;">
+      EARLY BETA - Data can be deleted at random!
+    </p>
+
+    <a href="/">r2wa.rs</a>
+    <a class="local" href="https://emile.space">emile.space</a>
+  </header>
+  <nav>
+  
+    <ul>
+      {{ if .pagelink1 }}
+      <li>
+        <a class="local" href="{{ .pagelink1.Target }}">{{ .pagelink1.Name }}</a>
+        <ul>
+          {{ if .pagelink1options }}
+          {{ range $opt := .pagelink1options }}
+          <li><a class="local" href="{{ $opt.Target }}">{{ $opt.Name }}</a></li>
+          {{ end }}
+          {{ end }}
+        </ul>
+      </li>
+      {{ end }}
+      {{ if .pagelink2 }}
+      <li>
+        <a class="local" href="{{ .pagelink1.Target }}{{ .pagelink2.Target }}">{{ .pagelink2.Name }}</a>
+        <ul>
+          {{ if .pagelink2options }}
+          {{ range $opt := .pagelink2options }}
+          <li><a class="local" href="{{ $.pagelink1.Target }}{{ $opt.Target }}">{{ $opt.Name }}</a></li>
+          {{ end }}
+          {{ end }}
+        </ul>
+      </li>
+      {{ end }}
+      {{ if .pagelink3 }}
+      <li>
+        <a class="local" href="{{ .pagelink1.Target }}{{ .pagelink2.Target }}{{ .pagelink3.Target }}">{{ .pagelink3.Name }}</a>
+        <ul>
+          {{ if .pagelink3options }}
+          {{ range $opt := .pagelink3options }}
+          <li><a class="local" href="{{ $.pagelink1.Target }}{{ $.pagelink2.Target }}{{ $opt.Target }}">{{ $opt.Name }}</a></li>
+          {{ end }}
+          {{ end }}
+        </ul>
+      </li>
+      {{ end }}
+    </ul>
+    <ul style="float: right">
+        <li>
+            <a href="https://git.emile.space/r2wars-web">src</a>
+        </li>
+    </ul>
+  </nav>
+  <ul>
+    {{ if .user }}
+    {{ if .pagelinknext }}{{ range $opt := .pagelinknext }}
+  	  <li><a class="local" href="{{ if $.pagelink1}}{{ $.pagelink1.Target }}{{ end }}{{ if $.pagelink2 }}{{ $.pagelink2.Target }}{{ end }}{{ if $.pagelink3 }}{{ $.pagelink3.Target }}{{ end }}{{ $opt.Target }}">{{ $opt.Name }}</a></li></li>
+    {{ end }}{{ end }}
+    {{ else }}
+    {{ if .pagelinkauth }}{{ range $opt := .pagelinkauth}}
+  	  <li><a class="local" href="{{ $opt.Target }}">{{ $opt.Name }}</a></li></li>
+    {{ end }}{{ end }}
+    {{ end }}
+
+    {{ if .user }}
+    <li style="float: right"><form method="POST" action="/logout"><input class="border" type="submit" value="Logout"></form></li>
+	  <li style="float: right; padding-right: 1ex"><a href="/user/{{ .user.ID }}/profile">{{ .user.Name }}</a></li></li>
+    {{ end }}
+  </ul>
+	<br>
+{{ end }}
+
diff --git a/templates/register.html b/templates/register.html
new file mode 100644
index 0000000..ea5094f
--- /dev/null
+++ b/templates/register.html
@@ -0,0 +1,40 @@
+{{ define "register" }}
+
+{{ template "head" . }}
+<body>
+  {{ template "nav" . }}
+
+  <span id="register"></span>
+  <h1><a href="#register">Register</a></h1>
+
+  {{ if .logged_in }}
+  Already logged in! <a href="/">Return home</a>
+  {{ else }}
+  <form method="POST" action="/register">
+    <table>
+      <tr>
+        <td><label for="username">Name:</label></td>
+        <td><input class="border" type="text" id="username" name="username" autofocus></td>
+      </tr>
+
+      <tr>
+        <td><label for="password1">Password:</label></td>
+        <td><input class="border" type="password" id="password1" name="password1"></td>
+      </tr>
+
+      <tr>
+        <td><label for="password2">Repeat Password:</label></td>
+        <td><input class="border" type="password" id="password2" name="password2"></td>
+      </tr>
+
+      <tr>
+        <td></td>
+        <td><input class="border" type="submit" value="Register"></td>
+      </tr>
+    </table>
+  </form>
+  Already registerd? <a href="/login">Login!</a>
+  {{ end }}
+</body>
+{{ template "footer" . }}
+{{ end }}
diff --git a/templates/user.html b/templates/user.html
new file mode 100644
index 0000000..c2e827a
--- /dev/null
+++ b/templates/user.html
@@ -0,0 +1,19 @@
+{{ define "user" }}
+
+{{ template "head" . }}
+<body>
+  {{ template "nav" . }}
+
+  <span id="user"></span>
+  <h1><a href="#user">{{ .targetUser.Name }}'s Bots</a></h1>
+
+  This is just a list of all bots belonging to the given user
+
+  <ul>
+  {{ range $bot := .bots }}
+    <li>- <a href="/bot/{{ $bot.ID }}">{{ $bot.Name }}</a></li>
+  {{ end }}
+  </ul>
+</div>
+{{ template "footer" . }}
+{{ end }}
diff --git a/templates/userProfile.html b/templates/userProfile.html
new file mode 100644
index 0000000..05aa01d
--- /dev/null
+++ b/templates/userProfile.html
@@ -0,0 +1,46 @@
+{{ define "profile" }}
+
+{{ template "head" . }}
+<body>
+  {{ template "nav" . }}
+
+  <span id="profile"></span>
+  <h1><a href="#profile">Profile</a></h1>
+
+  {{ if .err }}
+    ERROR: {{ .err }}!
+    <a href="/user/{{ .user.ID }}/profile">Edit your userpage here</a>
+    or 
+    <a href="/user/{{ .target_user.ID }}">Visit the userpage of that user</a>
+  {{ else }}
+  You can edit your profile below:
+  <br> <br>
+  <form method="POST" action="/user/{{ .user.ID }}/profile">
+    <table>
+
+    <tr>
+      <td><label for="username">Name:</label></td>
+      <td><input type="text" id="username" name="username" value={{ .user.Name }}><br><br></td>
+    </tr>
+
+    <tr>
+      <td><label for="password1">Password</label></td>
+      <td><input type="password" id="password1" name="password1"><br></td>
+    </tr>
+
+    <tr>
+      <td><label for="password2">Repeat Password</label></td>
+      <td><input type="password2" id="password2" name="password2"><br></td>
+    </tr>
+
+    <tr>
+      <td></td>
+      <td><br><input type="submit" value="Submit"></td>
+    </tr>
+
+    </table>
+  </form>
+  {{ end }}
+</div>
+{{ template "footer" . }}
+{{ end }}
diff --git a/templates/users.html b/templates/users.html
new file mode 100644
index 0000000..8002d2f
--- /dev/null
+++ b/templates/users.html
@@ -0,0 +1,17 @@
+{{ define "users" }}
+
+{{ template "head" . }}
+<body>
+  {{ template "nav" . }}
+
+  <span id="users"></span>
+  <h1><a href="#users">All users</a></h1>
+
+  <ul>
+  {{ range $user := .users }}
+    <li>- <a href="/user/{{ $user.ID }}">{{ $user.Name }}</a></li>
+  {{ end }}
+  </ul>
+</div>
+{{ template "footer" . }}
+{{ end }}