Sha256: 922be1e93c95c937b5941fffafe5d5a29fe71812b05225e776b2950c95b905ad

Contents?: true

Size: 1.61 KB

Versions: 70

Compression:

Stored size: 1.61 KB

Contents

# frozen_string_literal: true

module Decidim
  module Meetings
    # This helper include some methods for rendering meetings dynamic maps.
    module MapHelper
      # Serialize a collection of geocoded meetings to be used by the dynamic map component
      #
      # geocoded_meetings - A collection of geocoded meetings
      def meetings_data_for_map(geocoded_meetings)
        geocoded_meetings.map do |meeting|
          meeting.slice(:latitude, :longitude, :address).merge(title: translated_attribute(meeting.title),
                                                               description: translated_attribute(meeting.description),
                                                               startTimeDay: l(meeting.start_time, format: "%d"),
                                                               startTimeMonth: l(meeting.start_time, format: "%B"),
                                                               startTimeYear: l(meeting.start_time, format: "%Y"),
                                                               startTime: "#{meeting.start_time.strftime("%H:%M")} - #{meeting.end_time.strftime("%H:%M")}",
                                                               icon: icon("meetings", width: 40, height: 70, remove_icon_class: true),
                                                               location: translated_attribute(meeting.location),
                                                               locationHints: translated_attribute(meeting.location_hints),
                                                               link: meeting_path(meeting))
        end
      end
    end
  end
end

Version data entries

70 entries across 70 versions & 2 rubygems

Version Path
decidim-meetings-0.6.3 app/helpers/decidim/meetings/map_helper.rb
decidim-0.6.3 decidim-meetings/app/helpers/decidim/meetings/map_helper.rb
decidim-meetings-0.6.2 app/helpers/decidim/meetings/map_helper.rb
decidim-0.6.2 decidim-meetings/app/helpers/decidim/meetings/map_helper.rb
decidim-meetings-0.6.1 app/helpers/decidim/meetings/map_helper.rb
decidim-0.6.1 decidim-meetings/app/helpers/decidim/meetings/map_helper.rb
decidim-meetings-0.6.0 app/helpers/decidim/meetings/map_helper.rb
decidim-0.6.0 decidim-meetings/app/helpers/decidim/meetings/map_helper.rb
decidim-meetings-0.5.1 app/helpers/decidim/meetings/map_helper.rb
decidim-0.5.1 decidim-meetings/app/helpers/decidim/meetings/map_helper.rb
decidim-meetings-0.5.0 app/helpers/decidim/meetings/map_helper.rb
decidim-0.5.0 decidim-meetings/app/helpers/decidim/meetings/map_helper.rb
decidim-meetings-0.4.4 app/helpers/decidim/meetings/map_helper.rb
decidim-0.4.4 decidim-meetings/app/helpers/decidim/meetings/map_helper.rb
decidim-meetings-0.4.3 app/helpers/decidim/meetings/map_helper.rb
decidim-meetings-0.4.2 app/helpers/decidim/meetings/map_helper.rb
decidim-meetings-0.4.1 app/helpers/decidim/meetings/map_helper.rb
decidim-0.4.3 decidim-meetings/app/helpers/decidim/meetings/map_helper.rb
decidim-0.4.2 decidim-meetings/app/helpers/decidim/meetings/map_helper.rb
decidim-0.4.1 decidim-meetings/app/helpers/decidim/meetings/map_helper.rb