Skip to content

Commit 7c96813

Browse files
authored
feat: Add calendar buttons for future group meetings (#9182)
The buttons appear when there are future meetings for a group, on https://datatracker.ietf.org/wg/GROUPNAME/meetings/ The buttons are basically the same two calendar buttons that are on https://datatracker.ietf.org/meeting/upcoming?show=GROUPNAME This change addresses issue #7524. (Separately, the description of #7526 might need to be updated to refer to the new buttons.)
1 parent e043c85 commit 7c96813

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

ietf/group/views.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
from django.utils import timezone
5959
from django.utils.html import escape
6060
from django.views.decorators.cache import cache_page, cache_control
61+
from django.urls import reverse
6162

6263
import debug # pyflakes:ignore
6364

@@ -898,6 +899,18 @@ def meetings(request, acronym, group_type=None):
898899
far_past.append(s)
899900
past = recent_past
900901

902+
# Add calendar actions
903+
cal_actions = []
904+
905+
cal_actions.append(dict(
906+
label='Download as .ics',
907+
url=reverse('ietf.meeting.views.upcoming_ical')+"?show="+group.acronym)
908+
)
909+
cal_actions.append(dict(
910+
label='Subscribe with webcal',
911+
url='webcal://'+request.get_host()+reverse('ietf.meeting.views.upcoming_ical')+"?show="+group.acronym)
912+
)
913+
901914
return render(
902915
request,
903916
"group/meetings.html",
@@ -915,6 +928,7 @@ def meetings(request, acronym, group_type=None):
915928
"far_past": far_past,
916929
"can_edit": can_edit,
917930
"can_always_edit": can_always_edit,
931+
"cal_actions": cal_actions,
918932
},
919933
),
920934
)

ietf/templates/group/meetings.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ <h2 class="mt-5" id="inprogressmeets">Meetings in progress</h2>
4040
{% if future %}
4141
<h2 class="mt-5" id="futuremeets">
4242
Future Meetings
43-
<a class="ms-2"
44-
aria-label="icalendar entry for all scheduled future {{ group.acronym }} meetings"
45-
title="icalendar entry for all scheduled future {{ group.acronym }} meetings"
46-
href="{% url 'ietf.meeting.views.upcoming_ical' %}?show={{ group.acronym }}">
47-
<i class="bi bi-calendar"></i>
48-
</a>
43+
{% for cal_action in cal_actions %}
44+
<a class="btn btn-primary"
45+
href="{{ cal_action.url }}">
46+
{{ cal_action.label }}
47+
</a>
48+
{% endfor %}
4949
</h2>
5050
<table class="table table-sm table-striped tablesorter">
5151
<thead>

0 commit comments

Comments
 (0)