Skip to content

Commit 6c31c73

Browse files
feat: Improve links to meeting tools from group pages (ietf-tools#5130)
* chore: Remove unused template parameter from {%include%} * feat: Add "Meeting tools" section to group session details panel * feat: Use better label for recordings section after session has ended * feat: Define template tag to store timezone.now in the render context * fix: Use get_now tag in session_buttons_include.html * fix: Update session_details_panel.html to use get_now tag * refactor: Inject timezone_now from a context processor instead of tag * chore: Remove unused imports * chore: Remove unused {%load%} * chore: Revert renaming of dateformat.py
1 parent 82e0940 commit 6c31c73

5 files changed

Lines changed: 157 additions & 7 deletions

File tree

ietf/context_processors.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import sys
44
import django
55
from django.conf import settings
6+
from django.utils import timezone
67
from ietf import __version__, __patch__, __release_branch__, __release_hash__
78

89
def server_mode(request):
@@ -44,4 +45,9 @@ def sql_debug(request):
4445
def settings_info(request):
4546
return {
4647
'settings': settings,
47-
}
48+
}
49+
50+
def timezone_now(request):
51+
return {
52+
'timezone_now': timezone.now(),
53+
}

ietf/meeting/views.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2341,7 +2341,6 @@ def session_details(request, num, acronym):
23412341
'can_manage_materials' : can_manage,
23422342
'can_view_request': can_view_request,
23432343
'thisweek': datetime_today()-datetime.timedelta(days=7),
2344-
'now': timezone.now(),
23452344
'use_notes': meeting.uses_notes(),
23462345
})
23472346

ietf/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ def skip_unreadable_post(record):
372372
'ietf.context_processors.settings_info',
373373
'ietf.secr.context_processors.secr_revision_info',
374374
'ietf.context_processors.rfcdiff_base_url',
375+
'ietf.context_processors.timezone_now',
375376
],
376377
'loaders': [
377378
('django.template.loaders.cached.Loader', (

ietf/templates/meeting/session_buttons_include.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
</a>
5252
{% endif %}
5353
{# show stream buttons up till end of session, then show archive buttons #}
54-
{% if now < timeslot.end_time %}
54+
{% if timezone_now < timeslot.end_time %}
5555
{# chat #}
5656
<a class="btn btn-outline-primary"
5757
role="button"
@@ -237,7 +237,7 @@
237237
</li>
238238
{% endif %}
239239
{# show stream buttons up till end of session, then show archive buttons #}
240-
{% if now < timeslot.end_time %}
240+
{% if timezone_now < timeslot.end_time %}
241241
{# chat #}
242242
<li>
243243
<a class="dropdown-item"

ietf/templates/meeting/session_details_panel.html

Lines changed: 147 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% load origin ietf_filters textfilters tz dateformat %}
22
{% origin %}
33
{% for session in sessions %}
4-
{% with item=session.official_timeslotassignment %}
4+
{% with item=session.official_timeslotassignment %} {% with timeslot=item.timeslot %}
55
<h3 class="mt-4" id="session_{{ session.pk }}">
66
{% if sessions|length > 1 %}Session {{ forloop.counter }} :{% endif %}
77
{% for time in session.times %}
@@ -22,7 +22,7 @@ <h3 class="mt-4" id="session_{{ session.pk }}">
2222
{% if meeting.type.slug == 'interim' %}
2323
{% include "meeting/interim_session_buttons.html" with show_agenda=False show_empty=False %}
2424
{% else %}
25-
{% include "meeting/session_buttons_include.html" with show_agenda=False show_empty=False item=session.official_timeslotassignment use_notes=session.meeting.use_notes %}
25+
{% include "meeting/session_buttons_include.html" with show_agenda=False item=session.official_timeslotassignment use_notes=session.meeting.use_notes %}
2626
{% endif %}
2727
</div>
2828
{% endif %}
@@ -213,5 +213,149 @@ <h3 class="mt-4">Drafts</h3>
213213
Link additional drafts to session
214214
</a>
215215
{% endif %}
216-
{% endwith %}
216+
{% if timezone_now < timeslot.end_time %}{# show meeting tools until the session ends #}
217+
<h3 class="mt-4">Meeting tools</h3>
218+
<table class="table table-sm table-striped meeting-tools"
219+
id="meeting_tools_{{ session.pk }}">
220+
<tbody>
221+
{% if use_notes %}
222+
<tr>
223+
<td>
224+
<a href="{{ session.notes_url }}">
225+
<i class="bi bi-journal-text"></i> Notepad for note-takers
226+
</a>
227+
</td>
228+
</tr>
229+
{% endif %}
230+
{# chat #}
231+
<tr>
232+
<td>
233+
<a href="{{ session.chat_room_url }}">
234+
<i class="bi bi-chat"></i> Chat room
235+
</a>
236+
</td>
237+
</tr>
238+
{# Video stream (meetecho) #}
239+
{% if timezone_now < timeslot.end_time %}
240+
<tr>
241+
<td>
242+
<a href="{{ timeslot.location.video_stream_url|format:session }}">
243+
<i class="bi bi-camera-video"></i> Video stream
244+
</a>
245+
</td>
246+
</tr>
247+
{% endif %}
248+
{# Onsite tool (meetecho_onsite) #}
249+
{% if timeslot.location.onsite_tool_url %}
250+
<tr>
251+
<td>
252+
<a href="{{ timeslot.location.onsite_tool_url|format:session }}">
253+
<i class="bi bi-phone"></i> Onsite tool
254+
</a>
255+
</td>
256+
</tr>
257+
{% endif %}
258+
{# Audio stream #}
259+
{% if timeslot.location.audio_stream_url %}
260+
<tr>
261+
<td>
262+
<a href="{{ timeslot.location.audio_stream_url|format:session }}">
263+
<i class="bi bi-headphones"></i> Audio stream
264+
</a>
265+
</td>
266+
</tr>
267+
{% endif %}
268+
{# Remote call-in #}
269+
{% if session.agenda_note|first_url|conference_url %}
270+
<tr>
271+
<td>
272+
<a href="{{ session.agenda_note|first_url }}">
273+
<i class="bi bi-people"></i> Online conference
274+
</a>
275+
</td>
276+
</tr>
277+
{% elif session.remote_instructions|first_url|conference_url %}
278+
<tr>
279+
<td>
280+
<a href="{{ session.remote_instructions|first_url }}">
281+
<i class="bi bi-people"></i> Online conference
282+
</a>
283+
</td>
284+
</tr>
285+
{% elif timeslot.location.webex_url %}
286+
<tr>
287+
<td>
288+
<a href="{{ timeslot.location.webex_url|format:session }}">
289+
<i class="bi bi-people"></i> Webex session
290+
</a>
291+
</td>
292+
</tr>
293+
{% endif %}
294+
</tbody>
295+
</table>
296+
{% else %}{# session is in the past #}
297+
<h3 class="mt-4">Notes and recordings</h3>
298+
<table class="table table-sm table-striped meeting-tools"
299+
id="notes_and_recordings_{{ session.pk }}">
300+
<tbody>
301+
{% if use_notes %}
302+
<tr>
303+
<td>
304+
<a href="{{ session.notes_url }}">
305+
<i class="bi bi-journal-text"></i> Notepad for note-takers
306+
</a>
307+
</td>
308+
</tr>
309+
{% endif %}
310+
{# Recordings #}
311+
{% if meeting.number|add:"0" >= 80 %}
312+
{% with session.recordings as recordings %}
313+
{% if recordings %}
314+
{# There's no guaranteed order, so this is a bit messy: #}
315+
{# First, the audio recordings, if any #}
316+
{% for r in recordings %}
317+
{% if r.get_href and 'audio' in r.get_href %}
318+
<tr>
319+
<td>
320+
<a href="{{ r.get_href }}"><i class="bi bi-file-play"></i> {{ r.title }}</a>
321+
</td>
322+
</tr>
323+
{% endif %}
324+
{% endfor %}
325+
{# Then the youtube recordings #}
326+
{% for r in recordings %}
327+
{% if r.get_href and 'youtu' in r.get_href %}
328+
<tr>
329+
<td>
330+
<a href="{{ r.get_href }}"><i class="bi bi-file-slides"></i> {{ r.title }}</a>
331+
</td>
332+
</tr>
333+
{% endif %}
334+
{% endfor %}
335+
{# Finally, any other recordings #}
336+
{% for r in recordings %}
337+
{% if r.get_href and not 'audio' in r.get_href and not 'youtu' in r.get_href %}
338+
<tr>
339+
<td>
340+
<a href="{{ r.get_href }}"><i class="bi bi-file-play"></i> {{ r.title }}</a>
341+
</td>
342+
</tr>
343+
{% endif %}
344+
{% endfor %}
345+
{% endif %}
346+
{% endwith %}
347+
{% if timeslot.location.video_stream_url %}
348+
<tr>
349+
<td>
350+
<a href="https://www.meetecho.com/ietf{{ meeting.number }}/recordings#{{ acronym.upper }}">
351+
<i class="bi bi-file-slides"></i> Session recording
352+
</a>
353+
</td>
354+
</tr>
355+
{% endif %}
356+
{% endif %}
357+
</tbody>
358+
</table>
359+
{% endif %}
360+
{% endwith %}{% endwith %}
217361
{% endfor %}

0 commit comments

Comments
 (0)