Module: Decidim::Initiatives::CreateInitiativeHelper

Defined in:
app/helpers/decidim/initiatives/create_initiative_helper.rb

Overview

Helper methods for the create initiative wizard.

Instance Method Summary collapse

Instance Method Details

#offline_signature_type_optionsObject



34
35
36
37
38
39
40
41
42
43
# File 'app/helpers/decidim/initiatives/create_initiative_helper.rb', line 34

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

#online_signature_type_optionsObject



23
24
25
26
27
28
29
30
31
32
# File 'app/helpers/decidim/initiatives/create_initiative_helper.rb', line 23

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

#signature_type_optionsObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/helpers/decidim/initiatives/create_initiative_helper.rb', line 7

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