Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add alarm support to exported iCal. #5320

Merged
merged 6 commits into from
Apr 20, 2022

Conversation

PerilousApricot
Copy link
Contributor

@PerilousApricot PerilousApricot commented Apr 12, 2022

Many (all?) calendar clients do not support adding reminders ("alerts"
in iCal parlance) to external calendars syncrhonized via URL. Add a
per-user preference to attach reminders to any events exported to iCal.

Tested on local dev install both as a logged-in and anonymous user, both
with and without a reminder preference. This produced an iCal that Apple
Calendars properly recognized the reminders:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//CERN//INDICO//EN
BEGIN:VEVENT
SUMMARY:testEvent title
DTSTART;VALUE=DATE-TIME:20220425T150000Z
DTEND;VALUE=DATE-TIME:20220425T170000Z
DTSTAMP;VALUE=DATE-TIME:20220412T151800Z
UID:indico-event-8@localhost
DESCRIPTION:testEvent Description\n\nhttp://localhost:8000/event/8/
URL:http://localhost:8000/event/8/
BEGIN:VALARM
ACTION:AUDIO
DESCRIPTION:testEvent Description\n\nhttp://localhost:8000/event/8/
PRODID:-//CERN//INDICO//EN
SUMMARY:testEvent title
TRIGGER:-PT5M
END:VALARM
END:VEVENT
END:VCALENDAR

closes #5318

indico/modules/users/__init__.py Outdated Show resolved Hide resolved
indico/modules/users/forms.py Outdated Show resolved Hide resolved
indico/modules/users/forms.py Outdated Show resolved Hide resolved
indico/modules/users/forms.py Outdated Show resolved Hide resolved
indico/modules/events/ical.py Outdated Show resolved Hide resolved
indico/modules/events/ical.py Outdated Show resolved Hide resolved
indico/modules/events/ical.py Outdated Show resolved Hide resolved
indico/modules/events/ical.py Outdated Show resolved Hide resolved
CHANGES.rst Outdated Show resolved Hide resolved
indico/modules/events/ical.py Outdated Show resolved Hide resolved
@PerilousApricot PerilousApricot force-pushed the feature/add-ical-alerts branch 4 times, most recently from c9ee8b8 to 8ad3818 Compare April 12, 2022 15:50
@PerilousApricot
Copy link
Contributor Author

@ThiefMaster I've done your suggestion and split the preference into two parts, it is commit cf265cf. I don't know how to do the hidden field thing you talk about, though, so it's not yet complete

CHANGES.rst Outdated Show resolved Hide resolved
indico/modules/events/ical.py Outdated Show resolved Hide resolved
indico/modules/users/forms.py Outdated Show resolved Hide resolved
indico/modules/users/forms.py Outdated Show resolved Hide resolved
@ThiefMaster
Copy link
Member

thanks! i added the HiddenUnless in my review comment; this should be all that's needed - the rest is magic ✨ that happens automatically when this validator is used

@PerilousApricot
Copy link
Contributor Author

OK @ThiefMaster! I think I have this fully implemented in 31386b8

@ThiefMaster
Copy link
Member

Thanks, looks good! I'll test it tomorrow - already way too late anyway :D

@PerilousApricot
Copy link
Contributor Author

@ThiefMaster thanks! have a good evening :)

PerilousApricot and others added 6 commits April 20, 2022 13:33
Many (all?) calendar clients do not support adding reminders ("alerts"
in iCal parlance) to external calendars syncrhonized via URL. Add a
per-user preference to attach reminders to any events exported to iCal.

Tested on local dev install both as a logged-in and anonymous user, both
with and without a reminder preference. This produced an iCal that Apple
Calendars properly recognized the reminders:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//CERN//INDICO//EN
BEGIN:VEVENT
SUMMARY:testEvent title
DTSTART;VALUE=DATE-TIME:20220425T150000Z
DTEND;VALUE=DATE-TIME:20220425T170000Z
DTSTAMP;VALUE=DATE-TIME:20220412T151800Z
UID:indico-event-8@localhost
DESCRIPTION:testEvent Description\n\nhttp://localhost:8000/event/8/
URL:http://localhost:8000/event/8/
BEGIN:VALARM
ACTION:AUDIO
DESCRIPTION:testEvent Description\n\nhttp://localhost:8000/event/8/
PRODID:-//CERN//INDICO//EN
SUMMARY:testEvent title
TRIGGER:-PT5M
END:VALARM
END:VEVENT
END:VCALENDAR

Fixed indico#5318
Instead of one field having two meaning, split the preferences into two,
where one preference enables the iCal alert functionality, and the other
chooses the timeout
@ThiefMaster ThiefMaster added this to the v3.2 milestone Apr 20, 2022
Copy link
Member

@ThiefMaster ThiefMaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, took a bit longer with the easter holidays etc. Looks all good and works fine as well. Thanks!

@ThiefMaster ThiefMaster merged commit 84a7b6a into indico:master Apr 20, 2022
@PerilousApricot
Copy link
Contributor Author

PerilousApricot commented Apr 20, 2022 via email

@PerilousApricot PerilousApricot deleted the feature/add-ical-alerts branch August 2, 2022 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add alerts to exported calendars
2 participants