feat: add row of button-links to group meetings and meeting session views (#4774)

* refactor: clarify handling what groups looked like at past session times

* feat: add row of button-links to group meetings and meeting session views

* fix: remove unneeded `with` clause

* fix: replace missed instance of historic_parent reference

* fix: reflect that group_at_the_time always returns something

* chore: update copyright lines
This commit is contained in:
Robert Sparks 2022-11-29 11:10:44 -06:00 committed by GitHub
parent 0b3f9f5dc5
commit 4e2f5d50f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 381 additions and 6 deletions

View file

@ -57,14 +57,22 @@
Minutes
</a>
<a class="btn btn-primary btn-sm"
href="{% url 'ietf.meeting.views.session_details' num=s.meeting.number acronym=s.group.acronym %}">
href="{% url 'ietf.meeting.views.session_details' num=s.meeting.number acronym=s.group.acronym %}">
{% if can_always_edit or can_edit_materials %}
<i class="bi bi-pencil-square">
</i>
{% endif %}
Materials
</a>
{% if can_always_edit or can_edit_materials %}
<a class="btn btn-info btn-sm float-end"
href="{% url 'ietf.meeting.views.session_details' num=s.meeting.number acronym=s.group.acronym %}">
Edit Materials
</a>
{% if not s.cancelled %}
<div class="regular float-end">
{# see note in the included templates re: show_agenda parameter and required JS import #}
{% if s.meeting.type.slug == 'interim' %}
{% include "meeting/interim_session_buttons.html" with show_agenda=False show_empty=False session=s meeting=s.meeting use_notes=s.meeting.use_notes %}
{% else %}
{% include "meeting/session_buttons_include.html" with show_agenda=False item=s.official_timeslotassignment session=s meeting=s.meeting use_notes=s.meeting.use_notes %}
{% endif %}
</div>
{% endif %}
</td>
</tr>

View file

@ -0,0 +1,365 @@
{# Copyright The IETF Trust 2015-2022, All Rights Reserved #}
{% load origin %}
{% load static %}
{% load textfilters tz %}
{% load ietf_filters %}
{% origin %}
{% if item and item|should_show_agenda_session_buttons %}
{% with slug=item.slug session=item.session timeslot=item.timeslot %}
{% if session.agenda and show_agenda %}
{# Note: if called with show_agenda=True, calling template must load agenda_materials.js, needed by session_agenda_include.html #}
{% include "meeting/session_agenda_include.html" with slug=slug session=session timeslot=timeslot only %}
{% endif %}
<div id="session-buttons-{{ session.pk }}"
role="group"
class="btn-group btn-group-sm d-none d-lg-flex">
{% with acronym=session.group_at_the_time.acronym %}
{% if session.agenda and show_agenda %}
{# agenda pop-up button #}
<button class="btn btn-outline-primary"
data-bs-toggle="modal" type="button"
data-bs-target="#modal-{{ slug }}"
aria-label="Show meeting materials"
title="Show meeting materials">
<i class="bi bi-arrows-fullscreen"></i>
</button>
{# materials tar file #}
<a class="btn btn-outline-primary"
role="button"
href="/meeting/{{ meeting.number }}/agenda/{{ acronym }}-drafts.tgz"
aria-label="Download meeting materials as .tar archive"
title="Download meeting materials as .tar archive">
<i class="bi bi-file-zip"></i>
</a>
{# materials PDF file #}
<a class="btn btn-outline-primary"
role="button"
href="/meeting/{{ meeting.number }}/agenda/{{ acronym }}-drafts.pdf"
aria-label="Download meeting materials as PDF file"
title="Download meeting materials as PDF file">
<i class="bi bi-file-pdf"></i>
</a>
{% endif %}
{# Notes #}
{% if use_notes %}
<a class="btn btn-outline-primary"
role="button"
href="{{ session.notes_url }}"
aria-label="Notepad for note-takers"
title="Notepad for note-takers">
<i class="bi bi-journal-text"></i>
</a>
{% endif %}
{# show stream buttons up till end of session, then show archive buttons #}
{% if now < timeslot.end_time %}
{# chat #}
<a class="btn btn-outline-primary"
role="button"
href="{{ session.chat_room_url }}"
aria-label="Chat room for {{ session.chat_room_name }}"
title="Chat room for {{ session.chat_room_name }}">
<i class="bi bi-chat"></i>
</a>
{# Video stream (meetecho) #}
{% if timeslot.location.video_stream_url %}
<a class="btn btn-outline-primary"
role="button"
href="{{ timeslot.location.video_stream_url|format:session }}"
aria-label="Video stream"
title="Video stream">
<i class="bi bi-camera-video"></i>
</a>
{% endif %}
{# Onsite tool (meetecho_onsite) #}
{% if timeslot.location.onsite_tool_url %}
<a class="btn btn-outline-primary"
role="button"
href="{{ timeslot.location.onsite_tool_url|format:session }}"
aria-label="Onsite tool"
title="Onsite tool">
<i class="bi bi-phone"></i>
</a>
{% endif %}
{# Audio stream #}
{% if timeslot.location.audio_stream_url %}
<a class="btn btn-outline-primary"
role="button"
href="{{ timeslot.location.audio_stream_url|format:session }}"
aria-label="Audio stream"
title="Audio stream">
<i class="bi bi-headphones"></i>
</a>
{% endif %}
{# Remote call-in #}
{% if session.agenda_note|first_url|conference_url %}
<a class="btn btn-outline-primary"
role="button"
href="{{ session.agenda_note|first_url }}"
aria-label="Online conference"
title="Online conference">
<i class="bi bi-people"></i>
</a>
{% elif session.remote_instructions|first_url|conference_url %}
<a class="btn btn-outline-primary"
role="button"
href="{{ session.remote_instructions|first_url }}"
aria-label="Online conference"
title="Online conference">
<i class="bi bi-people"></i>
</a>
{% elif timeslot.location.webex_url %}
<a class="btn btn-outline-primary"
role="button"
href="{{ timeslot.location.webex_url|format:session }}"
aria-label="Webex session"
title="Webex session">
<i class="bi bi-people"></i>
</a>
{% endif %}
{# iCalendar item #}
<a class="btn btn-outline-primary"
role="button"
href="{% url 'ietf.meeting.views.agenda_ical' num=meeting.number session_id=session.id %}"
aria-label="icalendar entry for {{ acronym }} session on {{ timeslot.time|utc|date:'Y-m-d H:i' }} UTC"
title="icalendar entry for {{ acronym }} session on {{ timeslot.time|utc|date:'Y-m-d H:i' }} UTC">
<i class="bi bi-calendar"></i>
</a>
{% else %}
{# chat logs #}
{% if meeting.number|add:"0" >= 60 %}
<a class="btn btn-outline-primary"
role="button"
href="{{session.chat_archive_url}}"
aria-label="Chat logs for {{ session.chat_room_name }}"
title="Chat logs for {{ session.chat_room_name }}">
<i class="bi bi-file-text"></i>
</a>
{% 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 %}
<a class="btn btn-outline-primary"
role="button"
href="{{ r.get_href }}"
aria-label="{{ r.title }}"
title="{{ r.title }}">
<i class="bi bi-file-play"></i>
</a>
{% endif %}
{% endfor %}
{# Then the youtube recordings #}
{% for r in recordings %}
{% if r.get_href and 'youtu' in r.get_href %}
<a class="btn btn-outline-primary"
role="button"
href="{{ r.get_href }}"
aria-label="{{ r.title }}"
title="{{ r.title }}">
<i class="bi bi-file-slides"></i>
</a>
{% 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 %}
<a class="btn btn-outline-primary"
role="button"
href="{{ r.get_href }}"
aria-label="{{ r.title }}"
title="{{ r.title }}">
<i class="bi bi-file-play"></i>
</a>
{% endif %}
{% endfor %}
{% endif %}
{% endwith %}
{% if timeslot.location.video_stream_url %}
<a class="btn btn-outline-primary"
role="button"
href="https://www.meetecho.com/ietf{{ meeting.number }}/recordings#{{ acronym.upper }}"
aria-label="Session recording"
title="Session recording">
<i class="bi bi-file-slides"></i>
</a>
{% endif %}
{% endif %}
{% endif %}
{% endwith %}
</div>
<div class="dropdown d-lg-none">
<button class="btn btn-outline-primary btn-sm dropdown-toggle"
type="button"
aria-label="Info"
id="session-buttons-dropdown-{{ session.pk }}"
data-bs-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false">
<i class="bi bi-info-lg"></i>
</button>
<ul class="dropdown-menu"
aria-labelledby="session-buttons-dropdown-{{ session.pk }}">
{% with acronym=session.group_at_the_time.acronym %}
{% if session.agenda and show_agenda %}
{# agenda pop-up button #}
<li>
<button class="dropdown-item" type="button"
data-bs-toggle="modal"
data-bs-target="#modal-{{ slug }}">
<i class="bi bi-arrows-fullscreen"></i> Show meeting materials
</button>
</li>
{# materials tar file #}
<li>
<a class="dropdown-item"
href="/meeting/{{ meeting.number }}/agenda/{{ acronym }}-drafts.tgz">
<i class="bi bi-file-zip"></i> Meeting materials archive
</a>
</li>
{# materials PDF file #}
<li>
<a class="dropdown-item"
href="/meeting/{{ meeting.number }}/agenda/{{ acronym }}-drafts.pdf">
<i class="bi bi-file-pdf"></i> Meeting materials PDF
</a>
</li>
{% endif %}
{# Notes #}
{% if use_notes %}
<li>
<a class="dropdown-item" href="{{ session.notes_url }}">
<i class="bi bi-journal-text"></i> Notepad for note-takers
</a>
</li>
{% endif %}
{# show stream buttons up till end of session, then show archive buttons #}
{% if now < timeslot.end_time %}
{# chat #}
<li>
<a class="dropdown-item"
href="{{session.chat_room_url}}">
<i class="bi bi-chat"></i> Chat room
</a>
</li>
{# Video stream (meetecho) #}
{% if timeslot.location.video_stream_url %}
<li>
<a class="dropdown-item"
href="{{ timeslot.location.video_stream_url|format:session }}">
<i class="bi bi-camera-video"></i> Video stream
</a>
</li>
{% endif %}
{# Onsite tool (meetecho_onsite) #}
{% if timeslot.location.onsite_tool_url %}
<li>
<a class="dropdown-item"
href="{{ timeslot.location.onsite_tool_url|format:session }}">
<i class="bi bi-phone"></i> Onsite tool
</a>
</li>
{% endif %}
{# Audio stream #}
{% if timeslot.location.audio_stream_url %}
<li>
<a class="dropdown-item"
href="{{ timeslot.location.audio_stream_url|format:session }}">
<i class="bi bi-headphones"></i> Audio stream
</a>
</li>
{% endif %}
{# Remote call-in #}
{% if session.agenda_note|first_url|conference_url %}
<li>
<a class="dropdown-item" href="{{ session.agenda_note|first_url }}">
<i class="bi bi-people"></i> Online conference
</a>
</li>
{% elif session.remote_instructions|first_url|conference_url %}
<li>
<a class="dropdown-item"
href="{{ session.remote_instructions|first_url }}">
<i class="bi bi-people"></i> Online conference
</a>
</li>
{% elif timeslot.location.webex_url %}
<li>
<a class="dropdown-item"
href="{{ timeslot.location.webex_url|format:session }}">
<i class="bi bi-people"></i> Webex session
</a>
</li>
{% endif %}
{# iCalendar item #}
<li>
<a class="dropdown-item"
href="{% url 'ietf.meeting.views.agenda_ical' num=meeting.number session_id=session.id %}">
<i class="bi bi-calendar"></i> Add to calendar
</a>
</li>
{% else %}
{# chat logs #}
{% if meeting.number|add:"0" >= 60 %}
<li>
<a class="dropdown-item"
href="session.chat_room_url">
<i class="bi bi-file-text"></i> Chat logs
</a>
</li>
{% 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 %}
<li>
<a class="dropdown-item" href="{{ r.get_href }}">
<i class="bi bi-file-play"></i> {{ r.title }}
</a>
</li>
{% endif %}
{% endfor %}
{# Then the youtube recordings #}
{% for r in recordings %}
{% if r.get_href and 'youtu' in r.get_href %}
<li>
<a class="dropdown-item" href="{{ r.get_href }}">
<i class="bi bi-file-slides"></i> {{ r.title }}
</a>
</li>
{% 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 %}
<li>
<a class="dropdown-item" href="{{ r.get_href }}">
<i class="bi bi-file-play"></i> {{ r.title }}
</a>
</li>
{% endif %}
{% endfor %}
{% endif %}
{% endwith %}
{% if timeslot.location.video_stream_url %}
<li>
<a class="dropdown-item"
href="https://www.meetecho.com/ietf{{ meeting.number }}/recordings#{{ acronym.upper }}">
<i class="bi bi-file-slides"></i> Session recording
</a>
</li>
{% endif %}
{% endif %}
{% endif %}
{% endwith %}
</ul>
</div>
{% endwith %}
{% endif %}

View file

@ -21,6 +21,8 @@
{# see note in the included templates re: show_agenda parameter and required JS import #}
{% 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 %}
{% endif %}
</div>
{% endif %}