diff --git a/app/models/communication/website/agenda/event/with_cal.rb b/app/models/communication/website/agenda/event/with_cal.rb index dfbdc0c086355ff2a8fe7ce4b6cec8a98fbfeaad..e964f63a650e8c1a9ac2ae1bab6f328adae7d7ca 100644 --- a/app/models/communication/website/agenda/event/with_cal.rb +++ b/app/models/communication/website/agenda/event/with_cal.rb @@ -17,15 +17,36 @@ module Communication::Website::Agenda::Event::WithCal ) end + def cal_google_url + add_to_calendar_urls['google'] + end + + def cal_yahoo_url + add_to_calendar_urls['yahoo'] + end + + def cal_office_url + add_to_calendar_urls['office'] + end + + def cal_outlook_url + add_to_calendar_urls['outlook'] + end + + def cal_ical_url + add_to_calendar_urls['ical'] + end + + protected def set_add_to_calendar_urls self.add_to_calendar_urls = { - google: cal.google_url, - yahoo: cal.yahoo_url, - office: cal.office365_url, - outlook: cal.outlook_com_url, - ical: cal.ical_url + 'google' => cal.google_url, + 'yahoo' => cal.yahoo_url, + 'office' => cal.office365_url, + 'outlook' => cal.outlook_com_url, + 'ical' => cal.ical_url } end diff --git a/app/views/admin/communication/websites/agenda/events/_dates_static.html.erb b/app/views/admin/communication/websites/agenda/events/_dates_static.html.erb index 69547b84af578aa9caceb995e9efff9de8d1dbc8..e6d436b85a9658533003b4986f99e01aa222882d 100644 --- a/app/views/admin/communication/websites/agenda/events/_dates_static.html.erb +++ b/app/views/admin/communication/websites/agenda/events/_dates_static.html.erb @@ -26,8 +26,8 @@ indentation = ' ' * depth <%= indentation %> hour: <%= event.to_hour.strftime "%H:%M" %> <% end %> <%= indentation %> add_to_calendar: -<%= indentation %> google: "<%= event.add_to_calendar_urls['google'].html_safe %>" -<%= indentation %> yahoo: "<%= event.add_to_calendar_urls['yahoo'].html_safe %>" -<%= indentation %> office: "<%= event.add_to_calendar_urls['office'].html_safe %>" -<%= indentation %> outlook: "<%= event.add_to_calendar_urls['outlook'].html_safe %>" -<%= indentation %> ical: "<%= event.add_to_calendar_urls['ical'].html_safe %>" +<%= indentation %> google: "<%= event.cal_google_url.html_safe %>" +<%= indentation %> yahoo: "<%= event.cal_yahoo_url.html_safe %>" +<%= indentation %> office: "<%= event.cal_office_url.html_safe %>" +<%= indentation %> outlook: "<%= event.cal_outlook_url.html_safe %>" +<%= indentation %> ical: "<%= event.cal_ical_url.html_safe %>"