fix: Add footer with group interim ics calendar to announce email (#5279)

* fix: Add footer with group interim ics calendar to announce email

Fixes #2939

* Fix test
This commit is contained in:
Lars Eggert 2023-03-03 18:32:15 +02:00 committed by GitHub
parent 6f8cba5cd6
commit 97df94f41d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 11 deletions

View file

@ -826,7 +826,7 @@ def get_announcement_initial(meeting, is_change=False):
desc=desc,
date=meeting.date,
change=change)
body = render_to_string('meeting/interim_announcement.txt', locals())
body = render_to_string('meeting/interim_announcement.txt', locals() | {"settings": settings})
initial['body'] = body
return initial

View file

@ -4505,10 +4505,11 @@ class InterimTests(TestCase):
if sess:
timeslot = sess.official_timeslotassignment().timeslot
self.assertIn(timeslot.time.strftime('%Y-%m-%d'), announcement_text)
self.assertIn(
'(%s to %s UTC)' % (
self.assertRegex(
announcement_text,
r'(%s\s+to\s+%s\s+UTC)' % (
timeslot.utc_start_time().strftime('%H:%M'),timeslot.utc_end_time().strftime('%H:%M')
), announcement_text)
))
# Count number of sessions listed
if base_session and extra_session:
expected_session_matches = 3

View file

@ -1,8 +1,6 @@
{% load ietf_filters tz %}{% timezone meeting.tz %}{% if is_change %}MEETING DETAILS HAVE CHANGED. SEE LATEST DETAILS BELOW.
{% endif %}The {{ group.name }} ({{ group.acronym }}) {% if group.type.slug == 'wg' and group.state.slug == 'bof' %}BOF{% else %}{{group.type.name}}{% endif %} will hold
{% if assignments.count == 1 %}a{% if meeting.city %}n {% else %} virtual {% endif %}interim meeting on {{ meeting.date }} from {{ assignments.first.timeslot.time | date:"H:i" }} to {{ assignments.first.timeslot.end_time | date:"H:i" }} {{ meeting.time_zone}}{% if meeting.time_zone != 'UTC' %} ({{ assignments.first.timeslot.time | utc | date:"H:i" }} to {{ assignments.first.timeslot.end_time | utc | date:"H:i" }} UTC){% endif %}.
{% else %}a multi-day {% if not meeting.city %}virtual {% endif %}interim meeting.
{% endif %}{% filter wordwrap:78 %}The {{ group.name }} ({{ group.acronym }}) {% if group.type.slug == 'wg' and group.state.slug == 'bof' %}BOF{% else %}{{group.type.name}}{% endif %} will hold {% if assignments.count == 1 %}a{% if meeting.city %}n {% else %} virtual {% endif %}interim meeting on {{ meeting.date }} from {{ assignments.first.timeslot.time | date:"H:i" }} to {{ assignments.first.timeslot.end_time | date:"H:i" }} {{ meeting.time_zone}}{% if meeting.time_zone != 'UTC' %} ({{ assignments.first.timeslot.time | utc | date:"H:i" }} to {{ assignments.first.timeslot.end_time | utc | date:"H:i" }} UTC){% endif %}.{% else %}a multi-day {% if not meeting.city %}virtual {% endif %}interim meeting.
{% for assignment in assignments %}Session {{ forloop.counter }}:
{{ assignment.timeslot.time | date:"Y-m-d" }} {{ assignment.timeslot.time | date:"H:i" }} to {{ assignment.timeslot.end_time | date:"H:i" }} {{ meeting.time_zone }}{% if meeting.time_zone != 'UTC' %}({{ assignment.timeslot.time | utc | date:"H:i" }} to {{ assignment.timeslot.end_time | utc | date:"H:i" }} UTC){% endif %}
@ -10,11 +8,15 @@
{% if meeting.city %}Meeting Location:
{{ meeting.city }}, {{ meeting.country }}
{% endif %}Agenda:
{% endif %}{% endfilter %}
Agenda:
{{ meeting.session_set.first.agenda | document_content | default_if_none:"(No agenda submitted)" }}
Information about remote participation:
{{ meeting.session_set.first.remote_instructions }}
{{ meeting.session_set.first.remote_instructions.rstrip }}
{{ meeting.session_set.first.agenda_note }}
{% endtimezone %}
{{ meeting.session_set.first.agenda_note.rstrip|wordwrap:78 }}{% endtimezone %}
--
A calendar subscription for all {{ group.acronym }} meetings is available at
{{ settings.IDTRACKER_BASE_URL }}{% url 'ietf.meeting.views.upcoming_ical' %}?show={{ group.acronym }}