summaryrefslogtreecommitdiff
path: root/templates/staff.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/staff.html')
-rw-r--r--templates/staff.html134
1 files changed, 134 insertions, 0 deletions
diff --git a/templates/staff.html b/templates/staff.html
new file mode 100644
index 0000000..a8bab1a
--- /dev/null
+++ b/templates/staff.html
@@ -0,0 +1,134 @@
+{{- define "staff" -}}
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <title>
+ Staff Home &ndash; CCA Selection System
+ </title>
+ <link rel="stylesheet" href="/static/style.css" />
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <meta name="description" content="YK Pao School CCA Selection System" />
+ </head>
+ <body>
+ <div style="font-size: 150%; color: red; font-weight: bold;" class="broken-styling-warning">
+ The fact that you see this message means that the CSS styling information for this site is not loading correctly, and usability would be severely impacted. Check your network connection, and if this issue persists, you should contact the system administrator.
+ </div>
+ <header>
+ <div class="header-content">
+ <div class="header-left">
+ <h1><a id="site-title" href="./">CCA Selection System</a></h1>
+ </div>
+ <div class="header-middle">
+ <nav>
+ <ul>
+ <li>
+ <a href="./">Home</a>
+ </li>
+ <li>
+ <a href="./docs/">Docs</a>
+ </li>
+ <li>
+ <a href="./iadocs/">IA</a>
+ </li>
+ <li>
+ <a href="./src/">Source</a>
+ </li>
+ </ul>
+ </nav>
+ </div>
+ <div class="header-right">
+ <p>{{- .Name }} (Staff)</p>
+ </div>
+ </div>
+ </header>
+ <div class="reading-width" id="wip-notice">
+ <p>
+ This site is still a work in progress and may contain bugs! Please contact <a href="mailto:s22537@stu.ykpaoschool.cn">Runxi Yu</a> for any issues.
+ </p>
+ </div>
+ <div class="reading-width">
+ <p><a href="./export" class="btn-normal btn">Export all choices as a spreadsheet</a></p>
+ {{- if ge .State 1 }}
+ <p><a href="./state/0" class="btn-danger btn">Disable student access</a></p>
+ {{- if ge .State 2 }}
+ <p><a href="./state/1" class="btn-danger btn">Stop course selections</a></p>
+ {{- else }}
+ <p><a href="./state/2" class="btn-primary btn">Start course selections</a></p>
+ {{- end }}
+ {{- else }}
+ <p><a href="./state/1" class="btn-primary btn">Enable student access</a></p>
+ {{- end }}
+ <table class="table-of-courses">
+ <thead>
+ <tr>
+ <th scope="col">ID</th>
+ <th scope="col">Selected</th>
+ <th scope="col">Max</th>
+ <th scope="col">Name</th>
+ <th scope="col">Type</th>
+ <th scope="col">Teacher</th>
+ <th scope="col">Location</th>
+ </tr>
+ <tr>
+ <th colspan="7" class="tdinput">
+ <input type="text" id="search" placeholder="Search..." />
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ {{- range .Groups }}
+ <tr><th colspan="7">{{ .Name }}</th></tr>
+ {{- range .Courses }}
+ <tr class="courseitem" id="course{{.ID}}" data-group="{{.Group}}">
+ <th scope="row">
+ {{.ID}}
+ </th>
+ <td>
+ <span id="selected{{.ID}}">{{.Selected}}</span>
+ </td>
+ <td>
+ <span id="max{{.ID}}">{{.Max}}</span>
+ </td>
+ <td>{{.Title}}</td>
+ <td id="type{{.ID}}">{{.Type}}</td>
+ <td>{{.Teacher}}</td>
+ <td>{{.Location}}</td>
+ </tr>
+ {{- end }}
+ {{- end }}
+ </tbody>
+ {{- if eq .State 0 }}
+ <tfoot>
+ <tr>
+ <td class="th-like" colspan="7">
+ <form method="POST" enctype="multipart/form-data" action="/newcourses">
+ <div class="flex-justify">
+ <div class="left">
+ </div>
+ <div class="right">
+ <input title="Upload course list (CSV)" type="file" id="coursecsv" name="coursecsv" accept=".csv" />
+ <input type="submit" value="Delete all choices and reset courses" class="btn btn-danger" />
+ </div>
+ </div>
+ </form>
+ </td>
+ </tr>
+ </tfoot>
+ {{- end }}
+ </table>
+ </div>
+ <script>
+ document.addEventListener("DOMContentLoaded", () => {
+ const search = document.getElementById("search")
+ search.addEventListener("input", () => {
+ const s = search.value.toLowerCase().trim().normalize('NFD')
+ document.querySelectorAll(".courseitem").forEach(c => {
+ c.hidden = (!c.textContent.toLowerCase().normalize('NFD').includes(s)) && (s.length > 0)
+ })
+ })
+ })
+ </script>
+ </body>
+</html>
+{{- end -}}