Sha256: be4bf02eccc0daff5cbc9e98a160538509d381819c9e655c1a345d19d65767af

Contents?: true

Size: 641 Bytes

Versions: 90

Compression:

Stored size: 641 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # This module includes helpers to show areas in admin
    module AreasHelper
      Option = Struct.new(:id, :name)

      # Public: A formatted collection of areas for a given organization to be used
      # in forms.
      #
      # organization - Organization object
      #
      # Returns an Array.
      def organization_area_types(organization = current_organization)
        [Option.new("", "-")] +
          organization.area_types.map do |area_type|
            Option.new(area_type.id, translated_attribute(area_type.name))
          end
      end
    end
  end
end

Version data entries

90 entries across 90 versions & 1 rubygems

Version Path
decidim-admin-0.26.8 app/helpers/decidim/admin/areas_helper.rb
decidim-admin-0.27.4 app/helpers/decidim/admin/areas_helper.rb
decidim-admin-0.27.3 app/helpers/decidim/admin/areas_helper.rb
decidim-admin-0.26.7 app/helpers/decidim/admin/areas_helper.rb
decidim-admin-0.26.5 app/helpers/decidim/admin/areas_helper.rb
decidim-admin-0.27.2 app/helpers/decidim/admin/areas_helper.rb
decidim-admin-0.27.1 app/helpers/decidim/admin/areas_helper.rb
decidim-admin-0.26.4 app/helpers/decidim/admin/areas_helper.rb
decidim-admin-0.27.0 app/helpers/decidim/admin/areas_helper.rb
decidim-admin-0.26.3 app/helpers/decidim/admin/areas_helper.rb
decidim-admin-0.27.0.rc2 app/helpers/decidim/admin/areas_helper.rb
decidim-admin-0.27.0.rc1 app/helpers/decidim/admin/areas_helper.rb
decidim-admin-0.26.2 app/helpers/decidim/admin/areas_helper.rb
decidim-admin-0.26.1 app/helpers/decidim/admin/areas_helper.rb
decidim-admin-0.26.0 app/helpers/decidim/admin/areas_helper.rb
decidim-admin-0.26.0.rc2 app/helpers/decidim/admin/areas_helper.rb
decidim-admin-0.26.0.rc1 app/helpers/decidim/admin/areas_helper.rb
decidim-admin-0.25.2 app/helpers/decidim/admin/areas_helper.rb
decidim-admin-0.25.1 app/helpers/decidim/admin/areas_helper.rb
decidim-admin-0.25.0 app/helpers/decidim/admin/areas_helper.rb