forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimeslot_edit.html
More file actions
237 lines (237 loc) · 12.7 KB
/
Copy pathtimeslot_edit.html
File metadata and controls
237 lines (237 loc) · 12.7 KB
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
{% extends "base.html" %}
{# Copyright The IETF Trust 2015, All Rights Reserved #}
{% load origin %}
{% load agenda_custom_tags misc_filters static %}
{% block title %}IETF {{ meeting.number }} Meeting Agenda: Timeslots and Room Availability{% endblock %}
{% block morecss %}
{% comment %}
FIXME: These should move to an SCSS file that imports the relevant Bootstrap5 definitions.
Put scrollbars on the editor table. Requires fixed height so the scroll bars appear on the div, not the page body.
Note that 100vh is viewport height. Using that minus 25rem seems to leave space for the page header/footer.
{% endcomment %}
.timeslot-edit { overflow: auto; height: max(30rem, calc(100vh - 25rem));}
.tstable { width: 100%; border-collapse: separate; } {# "separate" to ensure sticky cells keep their borders #}
.tstable thead { position: sticky; top: 0; z-index: 3; background-color: white;}
.tstable th:first-child, .tstable td:first-child {
background-color: white; {# needs to match the lighter of the striped-table colors! #}
position: sticky;
left: 0;
z-index: 2; {# render above other cells / borders but below thead (z-index 3, above) #}
}
.tstable tbody > tr:nth-of-type(odd) > th:first-child {
background-color: rgb(249, 249, 249); {# needs to match the darker of the striped-table colors! #}
}
.tstable th { white-space: nowrap;}
.tstable td { white-space: nowrap;}
.capacity { font-size:80%; font-weight: normal;}
a.new-timeslot-link { color: lightgray; font-size: large;}
{% endblock %}
{% block content %}
{% origin %}
<h1>
IETF {{ meeting.number }} Meeting Agenda
<br>
<small class="text-muted">Timeslots and Room Availability</small>
</h1>
<div class="my-3">
<a class="btn btn-primary"
href="{% url "ietf.meeting.views.create_timeslot" num=meeting.number %}">
New timeslot
</a>
{% if meeting.schedule %}
<a class="btn btn-primary"
href="{% url "ietf.secr.meetings.views.rooms" meeting_id=meeting.number schedule_name=meeting.schedule.name %}">
Edit rooms
</a>
{% else %}
{# secr app room view requires a schedule - show something for now (should try to avoid this possibility) #}
<span title="Must create meeting schedule to edit rooms">Edit rooms</span>
{% endif %}
<a class="btn btn-primary"
href="{% url "ietf.meeting.views.list_schedules" num=meeting.number %}">
Agenda list
</a>
</div>
<div class="timeslot-edit">
{% if rooms|length == 0 %}
<p class="alert alert-info my-3">
No rooms exist for this meeting yet.
</p>
{% if meeting.schedule %}
<a class="btn btn-primary"
href="{% url "ietf.secr.meetings.views.rooms" meeting_id=meeting.number schedule_name=meeting.schedule.name %}">
Create rooms
</a>
{% else %}
{# provide as helpful a link we can if we don't have an official schedule #}
<a class="btn btn-primary"
href="{% url "ietf.secr.meetings.views.view" meeting_id=meeting.number %}">
Create rooms through the secr app
</a>
{% endif %}
{% else %}
<table id="timeslot-table" class="tstable table table-striped table-sm">
{% with have_no_timeslots=time_slices|length_is:0 %}
<thead>
<tr>
{% if have_no_timeslots %}
<th scope="col"></th>
<th scope="col"></th>
{% else %}
<th scope="col"></th>
{% for day in time_slices %}
<th scope="col" class="day-label" colspan="{{ date_slices|colWidth:day }}">
{{ day|date:'D' }} ({{ day }})
<i class="bi bi-trash delete-button"
title="Delete all on this day"
data-delete-scope="day"
data-date-id="{{ day.isoformat }}">
</i>
</th>
{% endfor %}
{% endif %}
</tr>
<tr>
{% if have_no_timeslots %}
<th scope="col"></th>
<th scope="col"></th>
{% else %}
<th scope="col"></th>
{% for day in time_slices %}
{% for slot in slot_slices|lookup:day %}
<th scope="col" class="time-label">
{{ slot.time|date:'H:i' }}-{{ slot.end_time|date:'H:i' }}
<i class="bi bi-trash delete-button"
data-delete-scope="column"
data-date-id="{{ day.isoformat }}"
data-col-id="{{ day.isoformat }}T{{ slot.time|date:'H:i' }}-{{ slot.end_time|date:'H:i' }}"
title="Delete all in this column">
</i>
</th>
{% endfor %}
{% endfor %}
{% endif %}
</tr>
</thead>
<tbody>
{% for room in rooms %}
<tr>
<th scope="row">
<span class="room-heading">{{ room.name }}
{% if room.capacity %}<span class="capacity">({{ room.capacity }})</span>{% endif %}
</span>
</th>
{% if have_no_timeslots and forloop.first %}
<td rowspan="{{ rooms|length }}">
<p>
No timeslots exist for this meeting yet.
</p>
<a href="{% url "ietf.meeting.views.create_timeslot" num=meeting.number %}">Create a timeslot.</a>
</td>
{% else %}
{% for day in time_slices %}
{% with slots=slot_slices|lookup:day %}
{% for slice in date_slices|lookup:day %}
{% with cell_ts=ts_list.popleft slot=slots|index:forloop.counter0 %}
<!-- [html-validate-disable-block no-dup-class -- FIXME: loop below generates duplicate classes] -->
<td class="tscell {% if cell_ts|length > 1 %}timeslot-collision{% endif %}{% for ts in cell_ts %} tstype_{{ ts.type.slug }}{% endfor %}">
{% if cell_ts %}
{% for ts in cell_ts %}
{% include 'meeting/timeslot_edit_timeslot.html' with ts=ts in_use=ts_with_any_assignments in_official_use=ts_with_official_assignments only %}
{% endfor %}
{% endif %}
<a class="new-timeslot-link text-reset text-decoration-none {% if cell_ts %}hidden{% endif %}" aria-label="+"
href="{% url 'ietf.meeting.views.create_timeslot' num=meeting.number %}?day={{ day.toordinal }}&date={{ day|date:'Y-m-d' }}&location={{ room.pk }}&time={{ slot.time|date:'H:i' }}&duration={{ slot.duration }}">
<i class="bi bi-plus-square"></i>
</a>
</td>
{% endwith %}
{% endfor %}
{% endwith %}
{% endfor %}
{% endif %}
</tr>
{% endfor %}
</tbody>
{% endwith %}
</table>
{% endif %}
{# Modal to confirm timeslot deletion #}
<div id="delete-modal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<p class="h5 modal-title text-danger">Confirm Delete</p>
<button type="button"
class="btn-close"
data-bs-dismiss="modal"
aria-label="Close"></button>
</div>
<div class="modal-body">
<p>
<span class="ts-singular">The following timeslot</span>
<span class="ts-plural"><span class="ts-count"></span> timeslots</span>
will be deleted:
</p>
<dl class="dl-horizontal">
<dt>
Name
</dt>
<dd>
<span class="ts-name"></span>
</dd>
<dt>
Date
</dt>
<dd>
<span class="ts-date"></span>
</dd>
<dt>
Time
</dt>
<dd>
<span class="ts-time"></span>
</dd>
<dt>
Location
</dt>
<dd>
<span class="ts-location"></span>
</dd>
</dl>
<p class="unofficial-use-warning">
The official schedule will not be affected, but sessions in
unofficial schedules currently assigned to
<span class="ts-singular">this timeslot</span>
<span class="ts-plural">any of these timeslots</span>
will become unassigned.
</p>
<p class="official-use-warning">
The official schedule will be affected.
Sessions currently assigned to
<span class="ts-singular">this timeslot</span>
<span class="ts-plural">any of these timeslots</span>
will become unassigned.
</p>
<p>
<span class="text-danger ts-singular">Are you sure you want to delete this timeslot?</span>
<span class="text-danger ts-plural">Are you sure you want to delete these <span class="ts-count"></span> timeslots?</span>
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
Cancel
</button>
<button type="button" id="confirm-delete-button" class="btn btn-danger">
Delete
</button>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block js %}
<script src="{% static "ietf/js/timeslot_edit.js" %}">
</script>
{% endblock %}