Sha256: f4be9987d5b47bb4cb3d52f539278637ceda424ce360175c052f282025f756fa

Contents?: true

Size: 893 Bytes

Versions: 66

Compression:

Stored size: 893 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Proposals
    # This helper include some methods for rendering proposals dynamic maps.
    module MapHelper
      # Serialize a collection of geocoded proposals to be used by the dynamic map component
      #
      # geocoded_proposals - A collection of geocoded proposals
      def proposals_data_for_map(geocoded_proposals)
        geocoded_proposals.map do |proposal|
          proposal.slice(:latitude, :longitude, :address).merge(title: proposal.title,
                                                                body: truncate(proposal.body, length: 100),
                                                                icon: icon("proposals", width: 40, height: 70, remove_icon_class: true),
                                                                link: proposal_path(proposal))
        end
      end
    end
  end
end

Version data entries

66 entries across 66 versions & 2 rubygems

Version Path
decidim-proposals-0.13.1 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.12.2 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.13.0 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.12.1 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.13.0.pre1 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.12.0 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.11.2 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.12.0.pre app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.11.1 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.11.0.pre1 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.10.1 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.10.0 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.9.3 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.9.2 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.9.1 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.9.0 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.8.4 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.8.3 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.8.2 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.8.1 app/helpers/decidim/proposals/map_helper.rb