Skip to content

Commit

Permalink
feat: Improve links to meeting tools from group pages (#5130)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jennifer-richards authored Feb 11, 2023
1 parent 82e0940 commit 6c31c73
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 7 deletions.
8 changes: 7 additions & 1 deletion ietf/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import sys
import django
from django.conf import settings
from django.utils import timezone
from ietf import __version__, __patch__, __release_branch__, __release_hash__

def server_mode(request):
Expand Down Expand Up @@ -44,4 +45,9 @@ def sql_debug(request):
def settings_info(request):
return {
'settings': settings,
}
}

def timezone_now(request):
return {
'timezone_now': timezone.now(),
}
1 change: 0 additions & 1 deletion ietf/meeting/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2341,7 +2341,6 @@ def session_details(request, num, acronym):
'can_manage_materials' : can_manage,
'can_view_request': can_view_request,
'thisweek': datetime_today()-datetime.timedelta(days=7),
'now': timezone.now(),
'use_notes': meeting.uses_notes(),
})

Expand Down
1 change: 1 addition & 0 deletions ietf/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ def skip_unreadable_post(record):
'ietf.context_processors.settings_info',
'ietf.secr.context_processors.secr_revision_info',
'ietf.context_processors.rfcdiff_base_url',
'ietf.context_processors.timezone_now',
],
'loaders': [
('django.template.loaders.cached.Loader', (
Expand Down
4 changes: 2 additions & 2 deletions ietf/templates/meeting/session_buttons_include.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</a>
{% endif %}
{# show stream buttons up till end of session, then show archive buttons #}
{% if now < timeslot.end_time %}
{% if timezone_now < timeslot.end_time %}
{# chat #}
<a class="btn btn-outline-primary"
role="button"
Expand Down Expand Up @@ -237,7 +237,7 @@
</li>
{% endif %}
{# show stream buttons up till end of session, then show archive buttons #}
{% if now < timeslot.end_time %}
{% if timezone_now < timeslot.end_time %}
{# chat #}
<li>
<a class="dropdown-item"
Expand Down
150 changes: 147 additions & 3 deletions ietf/templates/meeting/session_details_panel.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% load origin ietf_filters textfilters tz dateformat %}
{% origin %}
{% for session in sessions %}
{% with item=session.official_timeslotassignment %}
{% with item=session.official_timeslotassignment %} {% with timeslot=item.timeslot %}
<h3 class="mt-4" id="session_{{ session.pk }}">
{% if sessions|length > 1 %}Session {{ forloop.counter }} :{% endif %}
{% for time in session.times %}
Expand All @@ -22,7 +22,7 @@ <h3 class="mt-4" id="session_{{ session.pk }}">
{% if meeting.type.slug == 'interim' %}
{% include "meeting/interim_session_buttons.html" with show_agenda=False show_empty=False %}
{% else %}
{% include "meeting/session_buttons_include.html" with show_agenda=False show_empty=False item=session.official_timeslotassignment use_notes=session.meeting.use_notes %}
{% include "meeting/session_buttons_include.html" with show_agenda=False item=session.official_timeslotassignment use_notes=session.meeting.use_notes %}
{% endif %}
</div>
{% endif %}
Expand Down Expand Up @@ -213,5 +213,149 @@ <h3 class="mt-4">Drafts</h3>
Link additional drafts to session
</a>
{% endif %}
{% endwith %}
{% if timezone_now < timeslot.end_time %}{# show meeting tools until the session ends #}
<h3 class="mt-4">Meeting tools</h3>
<table class="table table-sm table-striped meeting-tools"
id="meeting_tools_{{ session.pk }}">
<tbody>
{% if use_notes %}
<tr>
<td>
<a href="{{ session.notes_url }}">
<i class="bi bi-journal-text"></i> Notepad for note-takers
</a>
</td>
</tr>
{% endif %}
{# chat #}
<tr>
<td>
<a href="{{ session.chat_room_url }}">
<i class="bi bi-chat"></i> Chat room
</a>
</td>
</tr>
{# Video stream (meetecho) #}
{% if timezone_now < timeslot.end_time %}
<tr>
<td>
<a href="{{ timeslot.location.video_stream_url|format:session }}">
<i class="bi bi-camera-video"></i> Video stream
</a>
</td>
</tr>
{% endif %}
{# Onsite tool (meetecho_onsite) #}
{% if timeslot.location.onsite_tool_url %}
<tr>
<td>
<a href="{{ timeslot.location.onsite_tool_url|format:session }}">
<i class="bi bi-phone"></i> Onsite tool
</a>
</td>
</tr>
{% endif %}
{# Audio stream #}
{% if timeslot.location.audio_stream_url %}
<tr>
<td>
<a href="{{ timeslot.location.audio_stream_url|format:session }}">
<i class="bi bi-headphones"></i> Audio stream
</a>
</td>
</tr>
{% endif %}
{# Remote call-in #}
{% if session.agenda_note|first_url|conference_url %}
<tr>
<td>
<a href="{{ session.agenda_note|first_url }}">
<i class="bi bi-people"></i> Online conference
</a>
</td>
</tr>
{% elif session.remote_instructions|first_url|conference_url %}
<tr>
<td>
<a href="{{ session.remote_instructions|first_url }}">
<i class="bi bi-people"></i> Online conference
</a>
</td>
</tr>
{% elif timeslot.location.webex_url %}
<tr>
<td>
<a href="{{ timeslot.location.webex_url|format:session }}">
<i class="bi bi-people"></i> Webex session
</a>
</td>
</tr>
{% endif %}
</tbody>
</table>
{% else %}{# session is in the past #}
<h3 class="mt-4">Notes and recordings</h3>
<table class="table table-sm table-striped meeting-tools"
id="notes_and_recordings_{{ session.pk }}">
<tbody>
{% if use_notes %}
<tr>
<td>
<a href="{{ session.notes_url }}">
<i class="bi bi-journal-text"></i> Notepad for note-takers
</a>
</td>
</tr>
{% endif %}
{# Recordings #}
{% if meeting.number|add:"0" >= 80 %}
{% with session.recordings as recordings %}
{% if recordings %}
{# There's no guaranteed order, so this is a bit messy: #}
{# First, the audio recordings, if any #}
{% for r in recordings %}
{% if r.get_href and 'audio' in r.get_href %}
<tr>
<td>
<a href="{{ r.get_href }}"><i class="bi bi-file-play"></i> {{ r.title }}</a>
</td>
</tr>
{% endif %}
{% endfor %}
{# Then the youtube recordings #}
{% for r in recordings %}
{% if r.get_href and 'youtu' in r.get_href %}
<tr>
<td>
<a href="{{ r.get_href }}"><i class="bi bi-file-slides"></i> {{ r.title }}</a>
</td>
</tr>
{% endif %}
{% endfor %}
{# Finally, any other recordings #}
{% for r in recordings %}
{% if r.get_href and not 'audio' in r.get_href and not 'youtu' in r.get_href %}
<tr>
<td>
<a href="{{ r.get_href }}"><i class="bi bi-file-play"></i> {{ r.title }}</a>
</td>
</tr>
{% endif %}
{% endfor %}
{% endif %}
{% endwith %}
{% if timeslot.location.video_stream_url %}
<tr>
<td>
<a href="https://www.meetecho.com/ietf{{ meeting.number }}/recordings#{{ acronym.upper }}">
<i class="bi bi-file-slides"></i> Session recording
</a>
</td>
</tr>
{% endif %}
{% endif %}
</tbody>
</table>
{% endif %}
{% endwith %}{% endwith %}
{% endfor %}

0 comments on commit 6c31c73

Please sign in to comment.