Sha256: fea498be3dedf75c4ee0ce2ebd615769e6068dc49b4aa2981901933d478450eb

Contents?: true

Size: 1.16 KB

Versions: 19

Compression:

Stored size: 1.16 KB

Contents

# frozen_string_literal: true

module Decidim
  module Initiatives
    # Helper methods for the create initiative wizard.
    module CreateInitiativeHelper
      def signature_type_options
        return online_signature_type_options unless Decidim::Initiatives.face_to_face_voting_allowed
        return offline_signature_type_options unless Decidim::Initiatives.online_voting_allowed

        options = []
        Initiative.signature_types.each_key do |type|
          options << [
            I18n.t(
              type,
              scope: %w(activemodel attributes initiative signature_type_values)
            ), type
          ]
        end
        options
      end

      def online_signature_type_options
        [
          [
            I18n.t(
              "online",
              scope: %w(activemodel attributes initiative signature_type_values)
            ), "online"
          ]
        ]
      end

      def offline_signature_type_options
        [
          [
            I18n.t(
              "offline",
              scope: %w(activemodel attributes initiative signature_type_values)
            ), "offline"
          ]
        ]
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
decidim-initiatives-0.16.1 app/helpers/decidim/initiatives/create_initiative_helper.rb
decidim-initiatives-0.16.0 app/helpers/decidim/initiatives/create_initiative_helper.rb
decidim-initiatives-0.15.2 app/helpers/decidim/initiatives/create_initiative_helper.rb
decidim-initiatives-0.15.1 app/helpers/decidim/initiatives/create_initiative_helper.rb
decidim-initiatives-0.15.0 app/helpers/decidim/initiatives/create_initiative_helper.rb
decidim-initiatives-0.14.4 app/helpers/decidim/initiatives/create_initiative_helper.rb
decidim-initiatives-0.14.3 app/helpers/decidim/initiatives/create_initiative_helper.rb
decidim-initiatives-0.14.2 app/helpers/decidim/initiatives/create_initiative_helper.rb
decidim-initiatives-0.14.1 app/helpers/decidim/initiatives/create_initiative_helper.rb
decidim-initiatives-0.13.1 app/helpers/decidim/initiatives/create_initiative_helper.rb
decidim-initiatives-0.12.2 app/helpers/decidim/initiatives/create_initiative_helper.rb
decidim-initiatives-0.13.0 app/helpers/decidim/initiatives/create_initiative_helper.rb
decidim-initiatives-0.12.1 app/helpers/decidim/initiatives/create_initiative_helper.rb
decidim-initiatives-0.13.0.pre1 app/helpers/decidim/initiatives/create_initiative_helper.rb
decidim-initiatives-0.12.0 app/helpers/decidim/initiatives/create_initiative_helper.rb
decidim-initiatives-0.11.2 app/helpers/decidim/initiatives/create_initiative_helper.rb
decidim-initiatives-0.12.0.pre app/helpers/decidim/initiatives/create_initiative_helper.rb
decidim-initiatives-0.11.1 app/helpers/decidim/initiatives/create_initiative_helper.rb
decidim-initiatives-0.11.0.pre1 app/helpers/decidim/initiatives/create_initiative_helper.rb