-
Notifications
You must be signed in to change notification settings - Fork 730
/
QueueFilter.twig
113 lines (108 loc) · 5.85 KB
/
QueueFilter.twig
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
{% extends 'generic/Popup.twig' %}
{% block popup_id %}filter-settings{% endblock %}
{% block title %}Edit Existing Queue{% endblock %}
{% block body %}
<span class="option-title">Modify access code</span>
<form method="post" id="change_queue_token" action="{{base_url}}/no_code_added/change_token" style="height:auto;">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}"/>
<select id="old_queue_code" class="form-control" name="code" aria-label="Access Code" required="required">
<option value="">Queue Name</option>
{% for queue in viewer.getAllQueues() %}
<option value="{{queue['code']}}">{{queue['code']}}</option>
{% endfor %}
</select>
<input type="text" id="old_queue_token" name="token" placeholder="New Access Code" aria-label="New Access Code" required="required">
<a id="old_queue_rand_token" onclick="genRandCode('old_queue_token')" onkeypress="genRandCode('old_queue_token')" title="Generate random access code" aria-label="Generate random access code" tabindex="0" style="padding:.5rem;">
<i class="fas fa-dice"></i>
</a>
<button id="change_code_btn" type="submit" class="btn btn-primary">Change Queue Access Code</button>
</form>
<br>
<hr>
<span class="option-title">Modify Contact Information</span>
<form method="post" id="change_queue_contact_information" action="{{base_url}}/no_code_added/change_contact_information" style="height:auto;">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}"/>
<select id="old_queue_code_1" class="form-control" name="code" aria-label="Access Code" required="required">
<option value="">Queue Name</option>
{% for queue in viewer.getAllQueues() %}
<option value="{{queue['code']}}">{{queue['code']}}</option>
{% endfor %}
</select>
<select id="old_queue_contact_information" name="contact_information" aria-label="New Access Code" required="required">
<option value="">choose option</option>
<option value="true"> On </option>
<option value="false"> Off </option>
</select>
<button id="change_contact_information_btn" type="submit" class="btn btn-primary">Change Queue Contact Information</button>
</form>
<br>
<form method="post" id="change_queue_regex" action="{{base_url}}/no_code_added/change_regex" style="height:auto;">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}"/>
<select id="old_queue_code_2" class="form-control" name="code" aria-label="Access Code" required="required">
<option value="">Queue Name</option>
{% for queue in viewer.getAllQueues() %}
<option value="{{queue['code']}}">{{queue['code']}}</option>
{% endfor %}
</select>
<input type="text" id="old_queue_regex" name="regex" placeholder="Contact Info Regex Pattern" aria-label="New Access Code" required="required" style="min-width: 40%;">
<button id="change_regex_btn" type="submit" class="btn btn-primary">Change Queue Regex Pattern </button>
</form>
<hr>
<br>
<span class="option-title"> Modify queue status </span>
<table class="table table-striped" style="width:100%;">
<thead>
<tr>
<th scope="col" style="text-align: left;"> Queue Name/Access Code </th>
<th scope="col">Open?</th>
<th scope="col">Empty</th>
<th scope="col">Delete</th>
</tr>
</thead>
<tbody>
{% for queue in viewer.getAllQueues() %}
<tr>
<td style="text-align: left;">
<b>Name: </b>{{queue['code']}}<br>
<b>Access Code: </b>{{queue['token']}}<br>
<b>Contact Information: </b>{{ queue['contact_information'] ? "On" : "Off" }}<br>
{% if queue['regex_pattern'] is defined and queue['regex_pattern'] != '' and queue['contact_information'] %}
<b>Regex Pattern: </b>{{queue['regex_pattern']}}</td>
{% endif %}
<td>
<input type="checkbox" class="toggle-queue-checkbox" aria-label="Toggle open/close for: {{queue['code']|upper}}" id="toggle-queue-{{loop.index}}" onchange="toggleQueue({{loop.index}}, '{{queue['code']}}')" {% if queue['open'] %} checked {% endif %} />
</td>
<td>
<form method="post" action="{{base_url}}/{{queue['code'] | url_encode}}/empty" onsubmit="return confirm('Are you sure you want to empty the queue? This will kick everyone out of the queue.');">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}"/>
<input type="hidden" name="queue_code" value="{{queue['code']}}"/>
<button type="submit" class="btn btn-danger filter_settings_btn empty_queue_btn">Empty</button>
</form>
</td>
<td>
<form method="post" action="{{base_url}}/{{queue['code'] | url_encode}}/deleteQueue" onsubmit="return confirm('Are you sure you want to delete the queue? This will remove all students currently in that queue and remove the queue from your list of queues');">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}"/>
<input type="hidden" name="queue_code" value="{{queue['code']}}"/>
<button type="submit" class="btn btn-danger filter_settings_btn delete_queue_btn">Delete</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}
{% block form %}
<div style="height: 100%">
{{ parent() }}
</div>
{% endblock %}
{% block buttons %}
<button type="button" class="btn btn-primary" onclick="window.location.reload()">Close</button>
<script>
$(document).keyup(function(e) {
if (e.key == "Escape" && $("#{{ block('popup_id') }}").is(":visible")) {
window.location.reload();
}
});
</script>
{% endblock %}