Sha256: b3a7956bb8634660184407ec5c04234eee4a2b65051c71469120f52833e2fc75

Contents?: true

Size: 769 Bytes

Versions: 2

Compression:

Stored size: 769 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module ComparativeStats
    # Custom helpers, scoped to the comparative_stats engine.
    #
    module ApplicationHelper
      def embed_modal_for(url)
        embed_code = String.new(content_tag(:iframe, "", src: url, frameborder: 0, width: "100%", height: "420", scrolling: "vertical"))
        render partial: "decidim/comparative_stats/widgets/embed_modal", locals: { url: url, embed_code: embed_code }
      end

      def active_endpoints
        Endpoint.active.where(organization: current_organization)
      end

      def available_graphs
        [
          :global_stats,
          :global_stats_timeline,
          :processes_timeline,
          :spaces_geocoded_events
        ]
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
decidim-comparative_stats-1.1.0 app/helpers/decidim/comparative_stats/application_helper.rb
decidim-comparative_stats-1.0.1 app/helpers/decidim/comparative_stats/application_helper.rb