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.6.1 app/helpers/decidim/proposals/map_helper.rb
decidim-0.6.1 decidim-proposals/app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.6.0 app/helpers/decidim/proposals/map_helper.rb
decidim-0.6.0 decidim-proposals/app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.5.1 app/helpers/decidim/proposals/map_helper.rb
decidim-0.5.1 decidim-proposals/app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.5.0 app/helpers/decidim/proposals/map_helper.rb
decidim-0.5.0 decidim-proposals/app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.4.4 app/helpers/decidim/proposals/map_helper.rb
decidim-0.4.4 decidim-proposals/app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.4.3 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.4.2 app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.4.1 app/helpers/decidim/proposals/map_helper.rb
decidim-0.4.3 decidim-proposals/app/helpers/decidim/proposals/map_helper.rb
decidim-0.4.2 decidim-proposals/app/helpers/decidim/proposals/map_helper.rb
decidim-0.4.1 decidim-proposals/app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.4.0 app/helpers/decidim/proposals/map_helper.rb
decidim-0.4.0 decidim-proposals/app/helpers/decidim/proposals/map_helper.rb
decidim-proposals-0.3.2 app/helpers/decidim/proposals/map_helper.rb
decidim-0.3.2 decidim-proposals/app/helpers/decidim/proposals/map_helper.rb