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.26.1 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.26.0 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.26.0.rc2 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.26.0.rc1 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.25.2 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.25.1 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.25.0 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.25.0.rc4 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.25.0.rc3 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.25.0.rc2 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.25.0.rc1 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.24.3 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.23.6 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.24.2 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.23.5 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.24.1 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.24.0 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.24.0.rc2 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.23.4 app/helpers/decidim/sortitions/admin/sortitions_helper.rb
decidim-sortitions-0.24.0.rc1 app/helpers/decidim/sortitions/admin/sortitions_helper.rb