From e8762990020d9935748954998d06d0be9266fee1 Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Tue, 15 Mar 2022 20:32:08 +0200 Subject: [PATCH 1/3] fix: Improve agenda page for mobile (narrow) screens --- ietf/meeting/tests_views.py | 10 +- ietf/static/js/agenda_timezone.js | 6 +- ietf/static/js/ietf.js | 2 +- ietf/templates/base.html | 2 +- ietf/templates/debug.html | 4 +- ietf/templates/meeting/agenda.html | 8 +- .../meeting/session_buttons_include.html | 178 +++++++++++++++++- .../templates/meeting/timeslot_start_end.html | 4 +- 8 files changed, 191 insertions(+), 23 deletions(-) diff --git a/ietf/meeting/tests_views.py b/ietf/meeting/tests_views.py index 9c1b3fedc9e..a778841226b 100644 --- a/ietf/meeting/tests_views.py +++ b/ietf/meeting/tests_views.py @@ -162,7 +162,7 @@ def test_meeting_agenda(self): registration_text = "Registration" # utc - time_interval = "%s-%s" % (slot.utc_start_time().strftime("%H:%M").lstrip("0"), (slot.utc_start_time() + slot.duration).strftime("%H:%M").lstrip("0")) + time_interval = r"%s-%s" % (slot.utc_start_time().strftime("%H:%M").lstrip("0"), (slot.utc_start_time() + slot.duration).strftime("%H:%M").lstrip("0")) r = self.client.get(urlreverse("ietf.meeting.views.agenda", kwargs=dict(num=meeting.number,utc='-utc'))) self.assertEqual(r.status_code, 200) @@ -172,14 +172,14 @@ def test_meeting_agenda(self): self.assertIn(session.group.name, agenda_content) self.assertIn(session.group.parent.acronym.upper(), agenda_content) self.assertIn(slot.location.name, agenda_content) - self.assertIn(time_interval, agenda_content) + self.assertRegex(agenda_content, time_interval) self.assertIsNotNone(q(':input[value="%s"]' % meeting.time_zone), 'Time zone selector should show meeting timezone') self.assertIsNotNone(q('.nav *:contains("%s")' % meeting.time_zone), 'Time zone indicator should be in nav sidebar') # plain - time_interval = "%s-%s" % (slot.time.strftime("%H:%M").lstrip("0"), (slot.time + slot.duration).strftime("%H:%M").lstrip("0")) + time_interval = r"%s-%s" % (slot.time.strftime("%H:%M").lstrip("0"), (slot.time + slot.duration).strftime("%H:%M").lstrip("0")) r = self.client.get(urlreverse("ietf.meeting.views.agenda", kwargs=dict(num=meeting.number))) self.assertEqual(r.status_code, 200) @@ -189,7 +189,7 @@ def test_meeting_agenda(self): self.assertIn(session.group.name, agenda_content) self.assertIn(session.group.parent.acronym.upper(), agenda_content) self.assertIn(slot.location.name, agenda_content) - self.assertIn(time_interval, agenda_content) + self.assertRegex(agenda_content, time_interval) self.assertIn(registration_text, agenda_content) # Make sure there's a frame for the session agenda and it points to the right place @@ -208,7 +208,7 @@ def test_meeting_agenda(self): # text # the rest of the results don't have as nicely formatted times - time_interval = time_interval.replace(":", "") + time_interval = "%s-%s" % (slot.time.strftime("%H%M").lstrip("0"), (slot.time + slot.duration).strftime("%H%M").lstrip("0")) r = self.client.get(urlreverse("ietf.meeting.views.agenda", kwargs=dict(num=meeting.number, ext=".txt"))) self.assertContains(r, session.group.acronym) diff --git a/ietf/static/js/agenda_timezone.js b/ietf/static/js/agenda_timezone.js index ea55a3cec31..ac15db8b432 100644 --- a/ietf/static/js/agenda_timezone.js +++ b/ietf/static/js/agenda_timezone.js @@ -191,16 +191,16 @@ window.update_times = function (newtz) { .dayOfYear()) { $(this) .html(format_time(this.start_ts, newtz, this.format) + - '-' + format_time(this.end_ts, newtz, 5) + tz); + '
-' + format_time(this.end_ts, newtz, 5) + tz); } else { $(this) .html(format_time(this.start_ts, newtz, this.format) + - '-' + + '
-' + format_time(this.end_ts, newtz, this.format) + tz); } } else { $(this) - .html(format_time(this.start_ts, newtz, this.format) + '-' + + .html(format_time(this.start_ts, newtz, this.format) + '
-' + format_time(this.end_ts, newtz, this.format)); } }); diff --git a/ietf/static/js/ietf.js b/ietf/static/js/ietf.js index 9cbc0ad01af..9a98b38fda0 100644 --- a/ietf/static/js/ietf.js +++ b/ietf/static/js/ietf.js @@ -138,7 +138,7 @@ $(function () { .attr("data-bs-offset", 0) .attr("tabindex", 0) .after($(` -
+
diff --git a/ietf/templates/base.html b/ietf/templates/base.html index 5824f80e67a..bd01f7522d9 100644 --- a/ietf/templates/base.html +++ b/ietf/templates/base.html @@ -44,7 +44,7 @@
{% endif %} -
+
{% else %} - - Add ietf.context_processors.sql_debug to settings.DEV_TEMPLATE_CONTEXT_PROCESSORS to turn on the SQL statement table. - + Add ietf.context_processors.sql_debug to settings.DEV_TEMPLATE_CONTEXT_PROCESSORS to turn on the SQL statement table. {% endif %} {% endif %} \ No newline at end of file diff --git a/ietf/templates/meeting/agenda.html b/ietf/templates/meeting/agenda.html index 5aa0fa50cee..3af62f6fac9 100644 --- a/ietf/templates/meeting/agenda.html +++ b/ietf/templates/meeting/agenda.html @@ -143,11 +143,11 @@

{% if item.timeslot.show_location and item.timeslot.get_html_location %} {% with item.timeslot.location.floorplan as floor %} {% if item.timeslot.location.floorplan %} -
+ {% endif %} @@ -161,7 +161,7 @@

{% if item.session.current_status == 'canceled' %} CANCELLED {% else %} -
+
{% if item.slot_type.slug == 'other' %} {% if item.session.agenda or item.session.remote_instructions or item.session.agenda_note %} {% include "meeting/session_buttons_include.html" with show_agenda=True item=item schedule=schedule %} @@ -260,7 +260,7 @@

{% if item.session.current_status == 'canceled' %} Cancelled {% else %} -
+
{% include "meeting/session_buttons_include.html" with show_agenda=True session=item.session meeting=schedule.meeting %}
{% endif %} diff --git a/ietf/templates/meeting/session_buttons_include.html b/ietf/templates/meeting/session_buttons_include.html index 753f78dcfb2..70dbf7a89d3 100644 --- a/ietf/templates/meeting/session_buttons_include.html +++ b/ietf/templates/meeting/session_buttons_include.html @@ -15,7 +15,7 @@ {% endif %}
+ class="btn-group btn-group-sm d-none d-lg-flex"> {% with acronym=session.historic_group.acronym %} {% if session.agenda and show_agenda %} {# agenda pop-up button #} @@ -57,7 +57,7 @@ role="button" href="xmpp:{{ session.jabber_room_name }}@jabber.ietf.org?join" title="Chat room for {{ session.jabber_room_name }}"> - + {# Video stream (meetecho) #} {% if timeslot.location.video_stream_url %} @@ -72,7 +72,7 @@ {% if timeslot.location.onsite_tool_url %} @@ -169,7 +169,7 @@ {% if timeslot.location.video_stream_url %} @@ -178,6 +178,176 @@ {% endif %} {% endwith %}
+ {% endwith %} {% endwith %} {% endwith %} diff --git a/ietf/templates/meeting/timeslot_start_end.html b/ietf/templates/meeting/timeslot_start_end.html index 46e399889f1..4ee4a9d3c7d 100644 --- a/ietf/templates/meeting/timeslot_start_end.html +++ b/ietf/templates/meeting/timeslot_start_end.html @@ -3,9 +3,9 @@ data-start-time="{{ item.start_timestamp }}" data-end-time="{{ item.end_timestamp }}"> {% if "-utc" in request.path %} - {{ item.timeslot.utc_start_time|date:"H:i" }}-{{ item.timeslot.utc_end_time|date:"H:i" }} + {{ item.timeslot.utc_start_time|date:"H:i" }}
-{{ item.timeslot.utc_end_time|date:"H:i" }} {% else %} - {{ item.timeslot.time|date:"H:i" }}-{{ item.timeslot.end_time|date:"H:i" }} + {{ item.timeslot.time|date:"H:i" }}
-{{ item.timeslot.end_time|date:"H:i" }} {% endif %}

\ No newline at end of file From 3e966f75514b095aef34e9adbb3100a4125d9cc2 Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Wed, 16 Mar 2022 11:46:15 +0200 Subject: [PATCH 2/3] Remove unrelated change --- ietf/templates/debug.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ietf/templates/debug.html b/ietf/templates/debug.html index 0748677d847..59275037759 100644 --- a/ietf/templates/debug.html +++ b/ietf/templates/debug.html @@ -103,6 +103,8 @@

{% else %} - Add ietf.context_processors.sql_debug to settings.DEV_TEMPLATE_CONTEXT_PROCESSORS to turn on the SQL statement table. + + Add ietf.context_processors.sql_debug to settings.DEV_TEMPLATE_CONTEXT_PROCESSORS to turn on the SQL statement table. + {% endif %} {% endif %} \ No newline at end of file From 5b766bbc5a7b452eb19663a451f825c625ebecff Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Wed, 16 Mar 2022 11:47:19 +0200 Subject: [PATCH 3/3] Remove FIXME --- ietf/templates/meeting/session_buttons_include.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ietf/templates/meeting/session_buttons_include.html b/ietf/templates/meeting/session_buttons_include.html index 70dbf7a89d3..d795aefd1ff 100644 --- a/ietf/templates/meeting/session_buttons_include.html +++ b/ietf/templates/meeting/session_buttons_include.html @@ -178,8 +178,7 @@ {% endif %} {% endwith %}

-