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.8.0 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.7.4 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.7.3 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.7.2 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.7.1 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.7.0 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.6.8 app/helpers/decidim/proposals/map_helper.rb
decidim-0.6.8 decidim-proposals/app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.6.7 app/helpers/decidim/proposals/map_helper.rb
decidim-0.6.7 decidim-proposals/app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.6.6 app/helpers/decidim/proposals/map_helper.rb
decidim-0.6.6 decidim-proposals/app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.6.5 app/helpers/decidim/proposals/map_helper.rb
decidim-0.6.5 decidim-proposals/app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.6.4 app/helpers/decidim/proposals/map_helper.rb
decidim-0.6.4 decidim-proposals/app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.6.3 app/helpers/decidim/proposals/map_helper.rb
decidim-0.6.3 decidim-proposals/app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.6.2 app/helpers/decidim/proposals/map_helper.rb
decidim-0.6.2 decidim-proposals/app/helpers/decidim/proposals/map_helper.rb