Sha256: 6cdc9f543da0f91c37e01a626fc055a749f1a162d57755899439aaaf62f61918

Contents?: true

Size: 983 Bytes

Versions: 33

Compression:

Stored size: 983 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Sortitions
    # Exposes the sortition resource so users can view them
    class SortitionsController < Decidim::Sortitions::ApplicationController
      helper Decidim::WidgetUrlsHelper
      include FilterResource
      include Decidim::Sortitions::Orderable
      include Paginable

      helper_method :sortition

      helper Decidim::Proposals::ApplicationHelper

      def index
        @sortitions = search
                      .results
                      .includes(:author)
                      .includes(:category)

        @sortitions = paginate(@sortitions)
        @sortitions = reorder(@sortitions)
      end

      private

      def sortition
        Sortition.find(params[:id])
      end

      def search_klass
        SortitionSearch
      end

      def default_filter_params
        {
          search_text: "",
          category_id: "",
          state: "active"
        }
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
decidim-sortitions-0.26.3 app/controllers/decidim/sortitions/sortitions_controller.rb
decidim-sortitions-0.26.2 app/controllers/decidim/sortitions/sortitions_controller.rb
decidim-sortitions-0.26.1 app/controllers/decidim/sortitions/sortitions_controller.rb
decidim-sortitions-0.26.0 app/controllers/decidim/sortitions/sortitions_controller.rb
decidim-sortitions-0.26.0.rc2 app/controllers/decidim/sortitions/sortitions_controller.rb
decidim-sortitions-0.26.0.rc1 app/controllers/decidim/sortitions/sortitions_controller.rb
decidim-sortitions-0.25.2 app/controllers/decidim/sortitions/sortitions_controller.rb
decidim-sortitions-0.25.1 app/controllers/decidim/sortitions/sortitions_controller.rb
decidim-sortitions-0.25.0 app/controllers/decidim/sortitions/sortitions_controller.rb
decidim-sortitions-0.25.0.rc4 app/controllers/decidim/sortitions/sortitions_controller.rb
decidim-sortitions-0.25.0.rc3 app/controllers/decidim/sortitions/sortitions_controller.rb
decidim-sortitions-0.25.0.rc2 app/controllers/decidim/sortitions/sortitions_controller.rb
decidim-sortitions-0.25.0.rc1 app/controllers/decidim/sortitions/sortitions_controller.rb
decidim-sortitions-0.24.3 app/controllers/decidim/sortitions/sortitions_controller.rb
decidim-sortitions-0.23.6 app/controllers/decidim/sortitions/sortitions_controller.rb
decidim-sortitions-0.24.2 app/controllers/decidim/sortitions/sortitions_controller.rb
decidim-sortitions-0.23.5 app/controllers/decidim/sortitions/sortitions_controller.rb
decidim-sortitions-0.24.1 app/controllers/decidim/sortitions/sortitions_controller.rb
decidim-sortitions-0.24.0 app/controllers/decidim/sortitions/sortitions_controller.rb
decidim-sortitions-0.24.0.rc2 app/controllers/decidim/sortitions/sortitions_controller.rb