From 52a707628fe2b5f8c9a0b8afd4ffcd8bafd8b3e7 Mon Sep 17 00:00:00 2001 From: Paul Selkirk Date: Tue, 20 Feb 2024 10:40:31 -0500 Subject: [PATCH] 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 --- ietf/meeting/models.py | 33 ++++++++++--------- ietf/meeting/views.py | 3 +- ietf/settings.py | 1 + ietf/templates/meeting/group_proceedings.html | 20 ++++++++++- .../meeting/interim_session_buttons.html | 2 +- .../meeting/session_buttons_include.html | 4 +-- .../meeting/session_details_panel.html | 2 +- 7 files changed, 43 insertions(+), 22 deletions(-) diff --git a/ietf/meeting/models.py b/ietf/meeting/models.py index ca137fc0dc..52a851576f 100644 --- a/ietf/meeting/models.py +++ b/ietf/meeting/models.py @@ -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 -*- @@ -1070,6 +1070,9 @@ def recordings(self): def bluesheets(self): return list(self.get_material("bluesheets", only_one=False)) + def chatlogs(self): + return list(self.get_material("chatlog", only_one=False)) + def slides(self): if not hasattr(self, "_slides_cache"): self._slides_cache = list(self.get_material("slides", only_one=False)) @@ -1267,29 +1270,27 @@ def group_parent_at_the_time(self): return self.meeting.group_at_the_time(self.group_at_the_time().parent) def audio_stream_url(self): - if ( - self.meeting.type.slug == "ietf" - and self.has_onsite_tool - and (url := getattr(settings, "MEETECHO_AUDIO_STREAM_URL", "")) - ): + url = getattr(settings, "MEETECHO_AUDIO_STREAM_URL", "") + if self.meeting.type.slug == "ietf" and self.has_onsite_tool and url: return url.format(session=self) return None def video_stream_url(self): - if ( - self.meeting.type.slug == "ietf" - and self.has_onsite_tool - and (url := getattr(settings, "MEETECHO_VIDEO_STREAM_URL", "")) - ): + url = getattr(settings, "MEETECHO_VIDEO_STREAM_URL", "") + if self.meeting.type.slug == "ietf" and self.has_onsite_tool and url: return url.format(session=self) return None def onsite_tool_url(self): - if ( - self.meeting.type.slug == "ietf" - and self.has_onsite_tool - and (url := getattr(settings, "MEETECHO_ONSITE_TOOL_URL", "")) - ): + url = getattr(settings, "MEETECHO_ONSITE_TOOL_URL", "") + if self.meeting.type.slug == "ietf" and self.has_onsite_tool and url: + return url.format(session=self) + 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 None diff --git a/ietf/meeting/views.py b/ietf/meeting/views.py index eae9b145e8..db4eed0ebb 100644 --- a/ietf/meeting/views.py +++ b/ietf/meeting/views.py @@ -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 -*- @@ -3786,6 +3786,7 @@ def _format_materials(items): 'minutes': _format_materials((s, s.minutes()) for s in ss), 'bluesheets': _format_materials((s, s.bluesheets()) 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), 'drafts': _format_materials((s, s.drafts()) for s in ss), 'last_update': session.last_update if hasattr(session, 'last_update') else None diff --git a/ietf/settings.py b/ietf/settings.py index 17ed58d6f8..7fa4ebbe63 100644 --- a/ietf/settings.py +++ b/ietf/settings.py @@ -1174,6 +1174,7 @@ def skip_unreadable_post(record): 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_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 # sensitive or site-specific changes. DO NOT commit settings_local.py to svn. diff --git a/ietf/templates/meeting/group_proceedings.html b/ietf/templates/meeting/group_proceedings.html index 618c28164c..666685000d 100644 --- a/ietf/templates/meeting/group_proceedings.html +++ b/ietf/templates/meeting/group_proceedings.html @@ -1,4 +1,4 @@ -{# Copyright The IETF Trust 2015, All Rights Reserved #} +{# Copyright The IETF Trust 2015-2024, All Rights Reserved #} {% load origin %} {% origin %} {% load ietf_filters %} @@ -54,6 +54,18 @@

{{ entry.group }}


{% endfor %} + {% for chatlog in entry.chatlogs %} + + Chatlog + {% if chatlog.time %}{{chatlog.time|date:"D G:i"}}{% endif %} + +
+ {% empty %} + + Chatlog + +
+ {% endfor %} {# recordings #} @@ -64,6 +76,12 @@

{{ entry.group }}


{% endfor %} + {% if entry.session.video_stream_url %} + + Session recording + +
+ {% endif %} {# slides #} diff --git a/ietf/templates/meeting/interim_session_buttons.html b/ietf/templates/meeting/interim_session_buttons.html index 2334ec9e88..2f0951338d 100644 --- a/ietf/templates/meeting/interim_session_buttons.html +++ b/ietf/templates/meeting/interim_session_buttons.html @@ -148,7 +148,7 @@ {% endfor %} {% elif session.video_stream_url %} diff --git a/ietf/templates/meeting/session_buttons_include.html b/ietf/templates/meeting/session_buttons_include.html index b69413238c..3dc9c45dcf 100644 --- a/ietf/templates/meeting/session_buttons_include.html +++ b/ietf/templates/meeting/session_buttons_include.html @@ -181,7 +181,7 @@ {% if session.video_stream_url %} @@ -351,7 +351,7 @@ {% if session.video_stream_url %}
  • + href="{{ session.session_recording_url }}"> Session recording
  • diff --git a/ietf/templates/meeting/session_details_panel.html b/ietf/templates/meeting/session_details_panel.html index 3ff09fc33b..0e30050186 100644 --- a/ietf/templates/meeting/session_details_panel.html +++ b/ietf/templates/meeting/session_details_panel.html @@ -344,7 +344,7 @@

    Notes and recordings

    {% if session.video_stream_url %} - + Session recording