feat: Links to chatlogs and session recordings on proceedings page (#7042)

* feat: Links to chatlogs and session recordings on proceedings page (#6791)

* refactor: Add a url template and convenience function for session_recording url

* refactor: Avoid using the walrus operator
This commit is contained in:
Paul Selkirk 2024-02-20 10:40:31 -05:00 committed by GitHub
parent 9ab820fca9
commit 52a707628f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 43 additions and 22 deletions

View file

@ -1,4 +1,4 @@
# Copyright The IETF Trust 2007-2022, All Rights Reserved # Copyright The IETF Trust 2007-2024, All Rights Reserved
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
@ -1070,6 +1070,9 @@ class Session(models.Model):
def bluesheets(self): def bluesheets(self):
return list(self.get_material("bluesheets", only_one=False)) return list(self.get_material("bluesheets", only_one=False))
def chatlogs(self):
return list(self.get_material("chatlog", only_one=False))
def slides(self): def slides(self):
if not hasattr(self, "_slides_cache"): if not hasattr(self, "_slides_cache"):
self._slides_cache = list(self.get_material("slides", only_one=False)) self._slides_cache = list(self.get_material("slides", only_one=False))
@ -1267,29 +1270,27 @@ class Session(models.Model):
return self.meeting.group_at_the_time(self.group_at_the_time().parent) return self.meeting.group_at_the_time(self.group_at_the_time().parent)
def audio_stream_url(self): def audio_stream_url(self):
if ( url = getattr(settings, "MEETECHO_AUDIO_STREAM_URL", "")
self.meeting.type.slug == "ietf" if self.meeting.type.slug == "ietf" and self.has_onsite_tool and url:
and self.has_onsite_tool
and (url := getattr(settings, "MEETECHO_AUDIO_STREAM_URL", ""))
):
return url.format(session=self) return url.format(session=self)
return None return None
def video_stream_url(self): def video_stream_url(self):
if ( url = getattr(settings, "MEETECHO_VIDEO_STREAM_URL", "")
self.meeting.type.slug == "ietf" if self.meeting.type.slug == "ietf" and self.has_onsite_tool and url:
and self.has_onsite_tool
and (url := getattr(settings, "MEETECHO_VIDEO_STREAM_URL", ""))
):
return url.format(session=self) return url.format(session=self)
return None return None
def onsite_tool_url(self): def onsite_tool_url(self):
if ( url = getattr(settings, "MEETECHO_ONSITE_TOOL_URL", "")
self.meeting.type.slug == "ietf" if self.meeting.type.slug == "ietf" and self.has_onsite_tool and url:
and self.has_onsite_tool return url.format(session=self)
and (url := getattr(settings, "MEETECHO_ONSITE_TOOL_URL", "")) return None
):
def session_recording_url(self):
url = getattr(settings, "MEETECHO_SESSION_RECORDING_URL", "")
if self.meeting.type.slug == "ietf" and self.has_onsite_tool and url:
self.group.acronym_upper = self.group.acronym.upper()
return url.format(session=self) return url.format(session=self)
return None return None

View file

@ -1,4 +1,4 @@
# Copyright The IETF Trust 2007-2023, All Rights Reserved # Copyright The IETF Trust 2007-2024, All Rights Reserved
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
@ -3786,6 +3786,7 @@ def organize_proceedings_sessions(sessions):
'minutes': _format_materials((s, s.minutes()) for s in ss), 'minutes': _format_materials((s, s.minutes()) for s in ss),
'bluesheets': _format_materials((s, s.bluesheets()) for s in ss), 'bluesheets': _format_materials((s, s.bluesheets()) for s in ss),
'recordings': _format_materials((s, s.recordings()) for s in ss), 'recordings': _format_materials((s, s.recordings()) for s in ss),
'chatlogs': _format_materials((s, s.chatlogs()) for s in ss),
'slides': _format_materials((s, s.slides()) for s in ss), 'slides': _format_materials((s, s.slides()) for s in ss),
'drafts': _format_materials((s, s.drafts()) for s in ss), 'drafts': _format_materials((s, s.drafts()) for s in ss),
'last_update': session.last_update if hasattr(session, 'last_update') else None 'last_update': session.last_update if hasattr(session, 'last_update') else None

View file

@ -1174,6 +1174,7 @@ CELERY_TASK_IGNORE_RESULT = True # ignore results unless specifically enabled f
MEETECHO_ONSITE_TOOL_URL = "https://meetings.conf.meetecho.com/onsite{session.meeting.number}/?session={session.pk}" MEETECHO_ONSITE_TOOL_URL = "https://meetings.conf.meetecho.com/onsite{session.meeting.number}/?session={session.pk}"
MEETECHO_VIDEO_STREAM_URL = "https://meetings.conf.meetecho.com/ietf{session.meeting.number}/?session={session.pk}" MEETECHO_VIDEO_STREAM_URL = "https://meetings.conf.meetecho.com/ietf{session.meeting.number}/?session={session.pk}"
MEETECHO_AUDIO_STREAM_URL = "https://mp3.conf.meetecho.com/ietf{session.meeting.number}/{session.pk}.m3u" MEETECHO_AUDIO_STREAM_URL = "https://mp3.conf.meetecho.com/ietf{session.meeting.number}/{session.pk}.m3u"
MEETECHO_SESSION_RECORDING_URL = "https://www.meetecho.com/ietf{session.meeting.number}/recordings#{session.group.acronym_upper}"
# Put the production SECRET_KEY in settings_local.py, and also any other # Put the production SECRET_KEY in settings_local.py, and also any other
# sensitive or site-specific changes. DO NOT commit settings_local.py to svn. # sensitive or site-specific changes. DO NOT commit settings_local.py to svn.

View file

@ -1,4 +1,4 @@
{# Copyright The IETF Trust 2015, All Rights Reserved #} {# Copyright The IETF Trust 2015-2024, All Rights Reserved #}
{% load origin %} {% load origin %}
{% origin %} {% origin %}
{% load ietf_filters %} {% load ietf_filters %}
@ -54,6 +54,18 @@
</a> </a>
<br> <br>
{% endfor %} {% endfor %}
{% for chatlog in entry.chatlogs %}
<a href="{{ chatlog.material|meeting_href:meeting }}">
Chatlog
{% if chatlog.time %}{{chatlog.time|date:"D G:i"}}{% endif %}
</a>
<br>
{% empty %}
<a href="{{ entry.session.chat_archive_url }}">
Chatlog
</a>
<br>
{% endfor %}
</td> </td>
{# recordings #} {# recordings #}
<td> <td>
@ -64,6 +76,12 @@
</a> </a>
<br> <br>
{% endfor %} {% endfor %}
{% if entry.session.video_stream_url %}
<a href="{{ entry.session.session_recording_url }}">
Session recording
</a>
<br>
{% endif %}
</td> </td>
{# slides #} {# slides #}
<td> <td>

View file

@ -148,7 +148,7 @@
{% endfor %} {% endfor %}
{% elif session.video_stream_url %} {% elif session.video_stream_url %}
<a class="btn btn-outline-primary" <a class="btn btn-outline-primary"
href="http://www.meetecho.com/ietf{{ meeting.number }}/recordings#{{ acronym.upper }}" href="{{ session.session_recording_url }}"
aria-label="Meetecho session recording" aria-label="Meetecho session recording"
title="Meetecho session recording"> title="Meetecho session recording">
<i class="bi bi-file-slides"></i> <i class="bi bi-file-slides"></i>

View file

@ -181,7 +181,7 @@
{% if session.video_stream_url %} {% if session.video_stream_url %}
<a class="btn btn-outline-primary" <a class="btn btn-outline-primary"
role="button" role="button"
href="https://www.meetecho.com/ietf{{ meeting.number }}/recordings#{{ acronym.upper }}" href="{{ session.session_recording_url }}"
aria-label="Session recording" aria-label="Session recording"
title="Session recording"> title="Session recording">
<i class="bi bi-file-slides"></i> <i class="bi bi-file-slides"></i>
@ -351,7 +351,7 @@
{% if session.video_stream_url %} {% if session.video_stream_url %}
<li> <li>
<a class="dropdown-item" <a class="dropdown-item"
href="https://www.meetecho.com/ietf{{ meeting.number }}/recordings#{{ acronym.upper }}"> href="{{ session.session_recording_url }}">
<i class="bi bi-file-slides"></i> Session recording <i class="bi bi-file-slides"></i> Session recording
</a> </a>
</li> </li>

View file

@ -344,7 +344,7 @@
{% if session.video_stream_url %} {% if session.video_stream_url %}
<tr> <tr>
<td> <td>
<a href="https://www.meetecho.com/ietf{{ meeting.number }}/recordings#{{ group.acronym.upper }}"> <a href="{{ session.session_recording_url }}">
<i class="bi bi-file-slides"></i> Session recording <i class="bi bi-file-slides"></i> Session recording
</a> </a>
</td> </td>