summaryrefslogtreecommitdiff
path: root/web/templates/event.html
blob: 60535c7071df5b2aeac0602c68b6dc1784634667 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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 %}