diff --git a/ietf/meeting/tests_views.py b/ietf/meeting/tests_views.py index 9c27531872..c24ed34f8f 100644 --- a/ietf/meeting/tests_views.py +++ b/ietf/meeting/tests_views.py @@ -213,7 +213,11 @@ class MeetingTests(BaseMeetingTestCase): def test_meeting_agenda(self): meeting = make_meeting_test_data() session = Session.objects.filter(meeting=meeting, group__acronym="mars").first() + session.remote_instructions='https://remote.example.com' + session.save() slot = TimeSlot.objects.get(sessionassignments__session=session,sessionassignments__schedule=meeting.schedule) + slot.location.urlresource_set.create(name_id='meetecho_onsite', url='https://onsite.example.com') + slot.location.urlresource_set.create(name_id='meetecho', url='https://meetecho.example.com') # self.write_materials_files(meeting, session) # @@ -316,7 +320,10 @@ def test_meeting_agenda(self): assert_ical_response_is_valid(self, r) self.assertContains(r, session.group.acronym) self.assertContains(r, session.group.name) + self.assertContains(r, session.remote_instructions) self.assertContains(r, slot.location.name) + self.assertContains(r, 'https://onsite.example.com') + self.assertContains(r, 'https://meetecho.example.com') self.assertContains(r, "BEGIN:VTIMEZONE") self.assertContains(r, "END:VTIMEZONE") @@ -4582,18 +4589,34 @@ def test_upcoming_ical(self): meeting = make_meeting_test_data(create_interims=True) populate_important_dates(meeting) url = urlreverse("ietf.meeting.views.upcoming_ical") - + + # Expect events 3 sessions - one for each WG and one for the IETF meeting + expected_event_summaries = [ + 'ames - Asteroid Mining Equipment Standardization Group', + 'mars - Martian Special Interest Group', + 'IETF 72', + ] + + Session.objects.filter( + meeting__type_id='interim', + group__acronym="mars", + ).update( + remote_instructions='https://someurl.example.com', + ) r = self.client.get(url) + self.assertEqual(r.status_code, 200) + assert_ical_response_is_valid(self, r, + expected_event_summaries=expected_event_summaries, + expected_event_count=len(expected_event_summaries)) + self.assertContains(r, 'Remote instructions: https://someurl.example.com') + Session.objects.filter(meeting__type_id='interim').update(remote_instructions='') + r = self.client.get(url) self.assertEqual(r.status_code, 200) - # Expect events 3 sessions - one for each WG and one for the IETF meeting assert_ical_response_is_valid(self, r, - expected_event_summaries=[ - 'ames - Asteroid Mining Equipment Standardization Group', - 'mars - Martian Special Interest Group', - 'IETF 72', - ], - expected_event_count=3) + expected_event_summaries=expected_event_summaries, + expected_event_count=len(expected_event_summaries)) + self.assertNotContains(r, 'Remote instructions:') def test_upcoming_ical_filter(self): # Just a quick check of functionality - details tested by test_js.InterimTests @@ -5643,6 +5666,7 @@ def test_group_ical(self): make_interim_test_data() meeting = Meeting.objects.filter(type='interim', session__group__acronym='mars').first() s1 = Session.objects.filter(meeting=meeting, group__acronym="mars").first() + self.assertGreater(len(s1.remote_instructions), 0, 'Expected remote_instructions to be set') a1 = s1.official_timeslotassignment() t1 = a1.timeslot # Create an extra session @@ -5661,6 +5685,7 @@ def test_group_ical(self): self.assertEqual(r.content.count(b'UID'), 2) self.assertContains(r, 'SUMMARY:mars - Martian Special Interest Group') self.assertContains(r, t1.local_start_time().strftime('%Y%m%dT%H%M%S')) + self.assertContains(r, s1.remote_instructions) self.assertContains(r, t2.local_start_time().strftime('%Y%m%dT%H%M%S')) self.assertContains(r, 'END:VEVENT') # @@ -5671,6 +5696,7 @@ def test_group_ical(self): self.assertEqual(r.content.count(b'UID'), 1) self.assertContains(r, 'SUMMARY:mars - Martian Special Interest Group') self.assertContains(r, t1.time.strftime('%Y%m%dT%H%M%S')) + self.assertContains(r, s1.remote_instructions) self.assertNotContains(r, t2.time.strftime('%Y%m%dT%H%M%S')) self.assertContains(r, 'END:VEVENT') diff --git a/ietf/templates/meeting/agenda.ics b/ietf/templates/meeting/agenda.ics index bcb9827c95..08b5449173 100644 --- a/ietf/templates/meeting/agenda.ics +++ b/ietf/templates/meeting/agenda.ics @@ -13,11 +13,15 @@ DTEND{% ics_date_time item.timeslot.local_end_time schedule.meeting.time_zone %} DTSTAMP{% ics_date_time item.timeslot.modified|utc 'utc' %}{% if item.session.agenda %} URL:{{item.session.agenda.get_versionless_href}}{% endif %} DESCRIPTION:{{item.timeslot.name|ics_esc}}\n{% if item.session.agenda_note %} - Note: {{item.session.agenda_note|ics_esc}}\n{% endif %}{% if item.timeslot.location.webex_url %} + Note: {{item.session.agenda_note|ics_esc}}\n{% endif %}{% if item.timeslot.location.onsite_tool_url %} \n - Webex: {{ item.timeslot.location.webex_url }}\n{% endif %}{% if item.timeslot.location.video_stream_url %} + Onsite tool: {{ item.timeslot.location.onsite_tool_url|format:item.session }}\n{% endif %}{% if item.timeslot.location.video_stream_url %} \n - Meetecho: {{ item.timeslot.location.video_stream_url|format:item.session }}\n{% endif %}{% if item.session.agenda %}{% with agenda=item.session.agenda %} + Meetecho: {{ item.timeslot.location.video_stream_url|format:item.session }}\n{% endif %}{% if item.timeslot.location.webex_url %} + \n + Webex: {{ item.timeslot.location.webex_url }}\n{% endif %}{% if item.session.remote_instructions %} + \n + Remote instructions: {{ item.session.remote_instructions }}\n{% endif %}{% if item.session.agenda %}{% with agenda=item.session.agenda %} \n {{agenda.type}} {{agenda.get_versionless_href}}\n{% endwith %}{% endif %} \n diff --git a/ietf/templates/meeting/upcoming.ics b/ietf/templates/meeting/upcoming.ics index 74105a054a..fb5b37d772 100644 --- a/ietf/templates/meeting/upcoming.ics +++ b/ietf/templates/meeting/upcoming.ics @@ -1,4 +1,4 @@ -{% load humanize tz %}{% autoescape off %}{% load ietf_filters %}BEGIN:VCALENDAR +{% load humanize tz %}{% autoescape off %}{% load ietf_filters textfilters %}BEGIN:VCALENDAR VERSION:2.0 METHOD:PUBLISH PRODID:-//IETF//datatracker.ietf.org ical upcoming//EN @@ -10,14 +10,15 @@ SUMMARY:{% if item.session.name %}{{item.session.group.acronym|lower}} - {{item. CLASS:PUBLIC DTSTART{% ics_date_time item.timeslot.local_start_time item.schedule.meeting.time_zone %} DTEND{% ics_date_time item.timeslot.local_end_time item.schedule.meeting.time_zone %} -DTSTAMP{% ics_date_time item.timeslot.modified|utc 'utc' %} -{% if item.session.agenda %}URL:{{item.session.agenda.get_href}} -DESCRIPTION:{{item.timeslot.name|ics_esc}}\n{% if item.session.agenda_note %} +DTSTAMP{% ics_date_time item.timeslot.modified|utc 'utc' %}{% if item.session.agenda %} +URL:{{item.session.agenda.get_href}}{% endif %} +DESCRIPTION:{% if item.timeslot.name %}{{item.timeslot.name|ics_esc}}\n{% endif %}{% if item.session.agenda_note %} Note: {{item.session.agenda_note|ics_esc}}\n{% endif %}{% for material in item.session.materials.all %} \n{{material.type}}{% if material.type.name != "Agenda" %} ({{material.title|ics_esc}}){% endif %}: - {{material.get_href}}\n{% endfor %} -{% endif %}END:VEVENT + {{material.get_href}}\n{% endfor %}{% if item.session.remote_instructions %} + Remote instructions: {{ item.session.remote_instructions }}\n{% endif %} +END:VEVENT {% endfor %}{% for meeting in ietfs %}BEGIN:VEVENT UID:ietf-{{ meeting.number }} SUMMARY:IETF {{ meeting.number }}{% if meeting.city %}