Sha256: d51c848d8f269a6fdb3c4720566f436200580281a3deea4c4272029a538f2743

Contents?: true

Size: 480 Bytes

Versions: 4

Compression:

Stored size: 480 Bytes

Contents

# frozen_string_literal: true
module Decidim
  module Proposals
    # Simple helpers to handle proposals ordering
    module ProposalOrderHelper
      # Returns the options the user will see to order proposals
      def order_fields
        @order_fields ||= begin
          order_fields = [:random, :recent]
          order_fields << :most_voted if current_settings.votes_enabled? && !current_settings.votes_hidden?
          order_fields
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
decidim-proposals-0.1.0 app/helpers/decidim/proposals/proposal_order_helper.rb
decidim-0.1.0 decidim-proposals/app/helpers/decidim/proposals/proposal_order_helper.rb
decidim-proposals-0.0.8.1 app/helpers/decidim/proposals/proposal_order_helper.rb
decidim-0.0.8.1 decidim-proposals/app/helpers/decidim/proposals/proposal_order_helper.rb