Skip to content

Commit

Permalink
fix: Add footer with group interim ics calendar to announce email (#5279
Browse files Browse the repository at this point in the history
)

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

Fixes #2939

* Fix test
  • Loading branch information
larseggert authored Mar 3, 2023
1 parent 6f8cba5 commit 97df94f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ietf/meeting/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 4 additions & 3 deletions ietf/meeting/tests_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4505,10 +4505,11 @@ def do_interim_send_announcement_test(self, base_session=False, extra_session=Fa
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
Expand Down
16 changes: 9 additions & 7 deletions ietf/templates/meeting/interim_announcement.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
{% 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 %}
{% endfor %}{% endif %}
{% 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 }}

0 comments on commit 97df94f

Please sign in to comment.