diff --git a/app/models/activity.rb b/app/models/activity.rb index 2698fa28e..6ca3d0731 100644 --- a/app/models/activity.rb +++ b/app/models/activity.rb @@ -390,17 +390,21 @@ def activity_url return "https://koala.svsticky.nl/activities/#{ id }" end + # The description of the activity in the specified locale def description_localised(locale) return locale == :nl ? description_nl : description_en end # This generates an URL representing a calendar activity template, filled with data from the koala activity - def google_event(loc = nil) + def google_event(locale = nil) return nil if start.nil? || self.end.nil? - loc = I18n.locale if loc.nil? - disclaimer = "[#{ I18n.t('activerecord.attributes.activity.disclaimer') }]" - description = "#{ activity_url }\n\n#{ description_localised(loc) }\n\n#{ disclaimer }" + locale = I18n.locale if locale.nil? + + disclaimer = "[#{ I18n.t('activerecord.attributes.activity.disclaimer', deep_interpolation: true, + datetime: DateTime.current.utc.to_s) }]" + description = "#{ activity_url }\n\n#{ description_localised(locale) }\n\n#{ disclaimer }" + uri_name = URI.encode_www_form_component(name) uri_description = URI.encode_www_form_component(description) uri_location = URI.encode_www_form_component(location) @@ -442,7 +446,7 @@ def gen_time_string(loc) return fmt_dt.call(start_date) + fmt_tm.call(start_time) + edt end - # Converts a sticky activity to an iCalendar event + # Converts a Sticky activity to an iCalendar event def to_calendar_event(locale) event = Icalendar::Event.new event.uid = id.to_s @@ -458,7 +462,9 @@ def to_calendar_event(locale) end event.summary = name - event.description = description_localised(locale) + event.description = "#{ activity_url }\r\n\r\n\ + #{ description_localised(locale) }\r\n\r\n\ + Last synced on: #{ DateTime.current.utc }" event.location = location return event end diff --git a/config/locales/en.yml b/config/locales/en.yml index 244bbcea2..de7a005b0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -33,7 +33,7 @@ en: description: Description description_en: English description description_nl: Dutch description - disclaimer: Data on this activity may be outdated, as it was added as a one-time copy of the information given at that time. Up-to-date info can be found on Koala. + disclaimer: Data about this activity has been added as a one-time copy from what was known on %{datetime}, and as such could be outdated. end_date: Enddate end_time: Endtime google_event: Copy once to calendar diff --git a/config/locales/members.en.yml b/config/locales/members.en.yml index 09c8c4e6f..39dea5c5a 100644 --- a/config/locales/members.en.yml +++ b/config/locales/members.en.yml @@ -19,7 +19,7 @@ en: calendar: confirm_understand_icalendar: confirm: I understand - text: Koala will maintain the icalendar feed you just copied, at all times. However, koala is only aware of activities for which you are enrolled through koala, and not through some other platform (like Pretix or a Google form). Remember to add those activities to your calendar manually. + text: Koala will maintain the icalendar feed you just copied to your clipboard, at all times. However, koala is only aware of activities for which you are enrolled through koala, and not through some other platform (like Pretix or a Google form). Remember to add those activities to your calendar manually. title: Warning error: edit: Could not edit! diff --git a/config/locales/members.nl.yml b/config/locales/members.nl.yml index 574009a73..6759d4eda 100644 --- a/config/locales/members.nl.yml +++ b/config/locales/members.nl.yml @@ -19,7 +19,7 @@ nl: calendar: confirm_understand_icalendar: confirm: Ik begrijp het - text: Koala zal de icalendar feed die je zojuist hebt gekopieerd te allen tijde bijwerken. Echter, is koala alleen op de hoogte van activiteiten waarvoor je je via Koala hebt ingeschreven, en niet via een ander platform (zoals Pretix of een Google Form). Vergeet niet om die activiteiten handmatig aan je agenda toe te voegen. + text: Koala zal de icalendar feed die je zojuist hebt gekopieerd naar je klembord ten aller tijde bijwerken. Echter, is koala alleen op de hoogte van activiteiten waarvoor je je via Koala hebt ingeschreven, en niet via een ander platform (zoals Pretix of een Google Form). Vergeet niet om die activiteiten handmatig aan je agenda toe te voegen. title: Waarschuwing error: edit: Kon niet bijwerken! diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 88bfa06ee..84935bd1a 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -33,7 +33,7 @@ nl: description: Beschrijving description_en: Engelse beschrijving description_nl: Nederlandse beschrijving - disclaimer: Gegevens in deze afspraak kunnen outdated zijn, omdat deze waren toegevoegd als een eenmalig kopie van wat toen bekend was. Up-to-date informatie staat op Koala. + disclaimer: Gegevens over deze activiteit zijn toegevoegd als een eenmalig kopie van wat bekend was op %{datetime}, en kunnen dus verouderd zijn. end_date: Einddatum end_time: Eindtijd google_event: Kopiƫer eenmalig naar agenda