aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/admin/templates
diff options
context:
space:
mode:
Diffstat (limited to 'backend/admin/templates')
-rw-r--r--backend/admin/templates/game_edit.html3
-rw-r--r--backend/admin/templates/games.html1
-rw-r--r--backend/admin/templates/submission_detail.html37
-rw-r--r--backend/admin/templates/submissions.html35
4 files changed, 76 insertions, 0 deletions
diff --git a/backend/admin/templates/game_edit.html b/backend/admin/templates/game_edit.html
index b171343..a6900e8 100644
--- a/backend/admin/templates/game_edit.html
+++ b/backend/admin/templates/game_edit.html
@@ -66,4 +66,7 @@
<button type="submit" formaction="{{ .BasePath }}admin/games/{{ .Game.GameID }}/start">Start</button>
</div>
</form>
+<div>
+ <a href="{{ .BasePath }}admin/games/{{ .Game.GameID }}/submissions">View Submissions</a>
+</div>
{{ end }}
diff --git a/backend/admin/templates/games.html b/backend/admin/templates/games.html
index d642f07..63f27b7 100644
--- a/backend/admin/templates/games.html
+++ b/backend/admin/templates/games.html
@@ -21,6 +21,7 @@
{{ if .IsPublic }}
<li><a href="{{ $.BasePath }}golf/{{ .GameID }}/watch">Watch</a></li>
{{ end }}
+ <li><a href="{{ $.BasePath }}admin/games/{{ .GameID }}/submissions">Submissions</a></li>
</ul>
</li>
{{ end }}
diff --git a/backend/admin/templates/submission_detail.html b/backend/admin/templates/submission_detail.html
new file mode 100644
index 0000000..406c0b4
--- /dev/null
+++ b/backend/admin/templates/submission_detail.html
@@ -0,0 +1,37 @@
+{{ template "base.html" . }}
+
+{{ define "breadcrumb" }}
+<a href="{{ .BasePath }}admin/dashboard">Dashboard</a> |
+<a href="{{ .BasePath }}admin/games">Games</a> |
+<a href="{{ .BasePath }}admin/games/{{ .GameID }}">Game {{ .GameID }}</a> |
+<a href="{{ .BasePath }}admin/games/{{ .GameID }}/submissions">Submissions</a>
+{{ end }}
+
+{{ define "content" }}
+<h2>Submission {{ .Submission.SubmissionID }}</h2>
+
+<h3>Basics</h3>
+<ul>
+ <li>User: {{ .Submission.UserID }}</li>
+ <li>Status: {{ .Submission.Status }}</li>
+ <li>Code Size: {{ .Submission.CodeSize }}</li>
+ <li>Created At: {{ .Submission.CreatedAt }}</li>
+</ul>
+
+<h3>Code</h3>
+<pre><code>{{ .Submission.Code }}</code></pre>
+
+<h3>Testcase Results</h3>
+{{ range .TestcaseResults }}
+ <h4>Testcase Result {{ .TestcaseResultID }}</h4>
+ <ul>
+ <li>Testcase ID: {{ .TestcaseID }}</li>
+ <li>Status: {{ .Status }}</li>
+ <li>Created At: {{ .CreatedAt }}</li>
+ </ul>
+ <h5>Stdout</h5>
+ <pre><code>{{ .Stdout }}</code></pre>
+ <h5>Stderr</h5>
+ <pre><code>{{ .Stderr }}</code></pre>
+{{ end }}
+{{ end }}
diff --git a/backend/admin/templates/submissions.html b/backend/admin/templates/submissions.html
new file mode 100644
index 0000000..6870c2a
--- /dev/null
+++ b/backend/admin/templates/submissions.html
@@ -0,0 +1,35 @@
+{{ template "base.html" . }}
+
+{{ define "breadcrumb" }}
+<a href="{{ .BasePath }}admin/dashboard">Dashboard</a> |
+<a href="{{ .BasePath }}admin/games">Games</a> |
+<a href="{{ .BasePath }}admin/games/{{ .GameID }}">Game {{ .GameID }}</a>
+{{ end }}
+
+{{ define "content" }}
+<h2>Submissions for Game {{ .GameID }}</h2>
+<table>
+ <thead>
+ <tr>
+ <th>ID</th>
+ <th>User</th>
+ <th>Status</th>
+ <th>Code Size</th>
+ <th>Created At</th>
+ <th>View</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{ range .Submissions }}
+ <tr>
+ <td>{{ .SubmissionID }}</td>
+ <td>{{ .UserID }}</td>
+ <td>{{ .Status }}</td>
+ <td>{{ .CodeSize }}</td>
+ <td>{{ .CreatedAt }}</td>
+ <td><a href="{{ $.BasePath }}admin/games/{{ $.GameID }}/submissions/{{ .SubmissionID }}">View</a></td>
+ </tr>
+ {{ end }}
+ </tbody>
+</table>
+{{ end }}