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.27.9 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.27.8 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.27.7 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.27.6 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.26.10 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.26.9 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.27.5 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.26.8 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.27.4 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.27.3 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.26.7 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.26.5 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.27.2 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.27.1 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.26.4 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.27.0 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.26.3 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.27.0.rc2 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.27.0.rc1 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.26.2 app/helpers/decidim/sortitions/admin/sortitions_helper.rb