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.15.0 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.14.4 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.14.3 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.14.2 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.14.1 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.13.1 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.12.2 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.13.0 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.12.1 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.13.0.pre1 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.12.0 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.11.2 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.12.0.pre app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.11.1 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.11.0.pre1 app/helpers/decidim/sortitions/admin/sortitions_helper.rb