summaryrefslogtreecommitdiff
path: root/web/templates/event.html
diff options
context:
space:
mode:
authorDominic DiTaranto <domdit@gmail.com>2024-10-28 11:36:09 -0400
committerDominic DiTaranto <domdit@gmail.com>2024-10-28 11:36:09 -0400
commit286161b0912007c6f3859868a006e9818752a4aa (patch)
treed016592f7fa38b93f15e818586a9d294d80b6f3c /web/templates/event.html
init commit
Diffstat (limited to 'web/templates/event.html')
-rw-r--r--web/templates/event.html91
1 files changed, 91 insertions, 0 deletions
diff --git a/web/templates/event.html b/web/templates/event.html
new file mode 100644
index 0000000..60535c7
--- /dev/null
+++ b/web/templates/event.html
@@ -0,0 +1,91 @@
+{% extends 'base.html' %}
+
+{% block content %}
+
+<h4>{{event.name}}</h4>
+<form action="/event/{{event.id}}" method="post"> {% csrf_token %}
+
+ <div class="table-responsive-lg">
+ <table class="table">
+ <thead>
+ <tr>
+ <th scope="col">#</th>
+ {% for datetime, day in morning.items %}
+ <td><small>{{ datetime }}</small></td>
+ {% endfor %}
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <th scope="row"><small>Morning</small></th>
+ {% for datetime, day in morning.items %}
+ <td>
+ <input id="{{day.0}}" type="checkbox" name="{{day.0}}"/><br>
+ {{ day.1 }}
+ </td>
+
+ {% endfor %}
+ </tr>
+ <tr>
+ <th scope="row"><small>Afternoon</small></th>
+ {% for datetime, day in noon.items %}
+ <td>
+ <input id="{{day.0}}" type="checkbox" name="{{day.0}}"/><br>
+ {{ day.1 }}
+ </td>
+ {% endfor %}
+ </tr>
+ <tr>
+ <th scope="row"><small>Night</small></th>
+ {% for datetime, day in night.items %}
+ <td>
+ <input id="{{day.0}}" type="checkbox" name="{{day.0}}"/><br>
+ {{ day.1 }}
+ </td>
+ {% endfor %}
+ </tr>
+ </tbody>
+ </table>
+ </div>
+
+ <div style="margin-top:10px;">
+ <div style="float:left">
+ Responses: {{user_responses}} / {{event.participants}}
+ </div>
+ <div style="float:right">
+ <button class="btn btn-success" type="submit">Submit</button>
+ </div>
+ </div>
+
+</form>
+
+<div style="clear:both;"></div>
+<hr>
+<div>
+ <h4>Best Times</h4>
+ {{ no_overlap_message }}
+ {% for day, users in best_days.items %}
+ <div class="row">
+ <div class="col-3" style="border: dotted black 1px;">{{day}}</div>
+ <div class="col-4" style="border: dotted black 1px;">{{users}}</div>
+ </div>
+ {% endfor %}
+</div>
+
+
+
+
+
+<script>
+ active_dates = {{ active_dates|safe }};
+ if (active_dates) {
+ for (let i = 0; i < active_dates.length; i++) {
+ document.getElementById(active_dates[i]).checked = true;
+ }
+ }
+</script>
+
+<br><br>
+
+
+{% endblock %}