app/helpers/decidim/meetings/meetings_helper.rb in decidim-meetings-0.24.3 vs app/helpers/decidim/meetings/meetings_helper.rb in decidim-meetings-0.25.0.rc1

- old
+ new

@@ -117,8 +117,29 @@ end def current_user_groups? current_organization.user_groups_enabled? && Decidim::UserGroups::ManageableUserGroups.for(current_user).verified.any? end + + # Public: URL to create an event in Google Calendars based on meeting + # data. + # + # meeting - a Decidim::Meeting instance. + # + # Returns a String. + def google_calendar_event_url(meeting) + meeting_url = resource_locator(meeting).url + meeting = present(meeting) + params = { + text: meeting.title, + dates: meeting.dates_param, + details: I18n.t( + "decidim.meetings.meetings.calendar_modal.full_details_html", + link: link_to(meeting_url, meeting_url) + ) + } + base_url = "https://calendar.google.com/calendar/u/0/r/eventedit" + "#{base_url}?#{params.to_param}" + end end end end