Sha256: dff96d924eac82864c6c970cd9dd52d6649e4afd1237ffd1c270de3fd98a5ef4

Contents?: true

Size: 1.14 KB

Versions: 3

Compression:

Stored size: 1.14 KB

Contents

# frozen_string_literal: true

module Decidim
  module Meetings
    # Exposes the meeting resource so users can view them
    class MeetingsController < Decidim::Meetings::ApplicationController
      include FilterResource

      helper_method :meetings, :geocoded_meetings, :meeting

      def index; end

      def static_map
        @meeting = Meeting.where(feature: current_feature).find(params[:id])
        send_data StaticMapGenerator.new(@meeting).data, type: "image/jpeg", disposition: "inline"
      end

      private

      def meetings
        @meetings ||= search.results.page(params[:page]).per(12)
      end

      def geocoded_meetings
        @geocoded_meetings ||= search.results.select(&:geocoded?)
      end

      def meeting
        @meeting ||= meetings.find(params[:id])
      end

      def search_klass
        MeetingSearch
      end

      def default_filter_params
        {
          order_start_time: "asc",
          search_text: "",
          scope_id: "",
          category_id: ""
        }
      end

      def context_params
        { feature: current_feature, organization: current_organization }
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
decidim-0.0.4 decidim-meetings/app/controllers/decidim/meetings/meetings_controller.rb
decidim-meetings-0.0.3 app/controllers/decidim/meetings/meetings_controller.rb
decidim-0.0.3 decidim-meetings/app/controllers/decidim/meetings/meetings_controller.rb