mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-04-29 17:19:55 +08:00
## Summary - add friendly `X-WR-CALNAME` values to bookmark reminder ICS feeds - add friendly `X-WR-CALNAME` values to discourse-calendar event ICS feeds - cover the new calendar names in the relevant request specs ## Context https://meta.discourse.org/t/the-webcal-url-is-incorrectly-passed-to-the-calendar-name-field-in-google-calendar/400167/5
16 lines
721 B
Text
16 lines
721 B
Text
BEGIN:VCALENDAR
|
|
VERSION:2.0
|
|
PRODID:-//Discourse//<%= Discourse.current_hostname %>//<%= Discourse.full_version %>//EN
|
|
X-WR-CALNAME:<%= IcalEncoder.encode(@calendar_name) %>
|
|
<% @bookmark_reminders.each do |bookmark| %>
|
|
BEGIN:VEVENT
|
|
UID:bookmark_reminder_#<%= bookmark.id %>@<%= Discourse.current_hostname %>
|
|
DTSTAMP:<%= bookmark.updated_at.strftime(I18n.t("datetime_formats.formats.calendar_ics")) %>
|
|
DTSTART:<%= bookmark.reminder_at_ics_start %>
|
|
DTEND:<%= bookmark.reminder_at_ics_end %>
|
|
SUMMARY:<%= IcalEncoder.encode(bookmark.name.presence || bookmark.title) %>
|
|
DESCRIPTION:<%= IcalEncoder.encode(bookmark.bookmarkable_url) %>
|
|
URL:<%= IcalEncoder.encode(bookmark.bookmarkable_url) %>
|
|
END:VEVENT
|
|
<% end %>
|
|
END:VCALENDAR
|