Sha256: 34fc2a32b186e1c3486448b8d4909dce9ca73d5824e4c12081dec9de41758b0a

Contents?: true

Size: 637 Bytes

Versions: 75

Compression:

Stored size: 637 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Sortitions
    module Admin
      module SortitionsHelper
        include Decidim::TranslationsHelper

        # Converst a list of components into a list of selectable options
        def components_options(components)
          components.map do |f|
            [translated_attribute(f.name), f.id]
          end
        end

        def sortition_category(sortition)
          return translated_attribute sortition.category&.name if sortition.category

          I18n.t("sortitions.form.all_categories", scope: "decidim.sortitions.admin")
        end
      end
    end
  end
end

Version data entries

75 entries across 75 versions & 1 rubygems

Version Path
decidim-sortitions-0.23.3 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.23.2 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.23.1 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.23.1.rc1 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.23.0 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.22.0 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.21.0 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.20.1 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.20.0 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.19.1 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.18.1 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.19.0 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.17.2 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.18.0 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.17.1 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.16.1 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.17.0 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.16.0 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.15.2 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.15.1 app/helpers/decidim/sortitions/admin/sortitions_helper.rb