Module: Decidim::Challenges::ChallengeCellsHelper
- Includes:
- ApplicationHelper, Decidim::CardHelper, ApplicationHelper, LayoutHelper, ResourceReferenceHelper, TranslatableAttributes, TranslationsHelper, WithSdgs
- Included in:
- ChallengeCell, ChallengeGCell
- Defined in:
- app/helpers/decidim/challenges/challenge_cells_helper.rb
Overview
Custom helpers, scoped to the challenges engine.
Instance Method Summary
collapse
#component_name, #filter_custom_state_values
Instance Method Details
#challenges_controller? ⇒ Boolean
32
33
34
|
# File 'app/helpers/decidim/challenges/challenge_cells_helper.rb', line 32
def challenges_controller?
context[:controller].instance_of?(::Decidim::Challenges::ChallengesController)
end
|
#component_settings ⇒ Object
44
45
46
|
# File 'app/helpers/decidim/challenges/challenge_cells_helper.rb', line 44
def component_settings
model.component.settings
end
|
#current_component ⇒ Object
48
49
50
|
# File 'app/helpers/decidim/challenges/challenge_cells_helper.rb', line 48
def current_component
model.component
end
|
#current_settings ⇒ Object
40
41
42
|
# File 'app/helpers/decidim/challenges/challenge_cells_helper.rb', line 40
def current_settings
model.component.current_settings
end
|
#from_context ⇒ Object
52
53
54
|
# File 'app/helpers/decidim/challenges/challenge_cells_helper.rb', line 52
def from_context
options[:from]
end
|
#has_actions? ⇒ Boolean
20
21
22
23
24
|
# File 'app/helpers/decidim/challenges/challenge_cells_helper.rb', line 20
def has_actions?
return context[:has_actions] if context[:has_actions].present?
challenges_controller? && index_action? && current_settings.votes_enabled? && !model.draft?
end
|
26
27
28
29
30
|
# File 'app/helpers/decidim/challenges/challenge_cells_helper.rb', line 26
def
return context[:has_footer] if context[:has_footer].present?
challenges_controller? && index_action? && current_settings.votes_enabled? && !model.draft?
end
|
#index_action? ⇒ Boolean
36
37
38
|
# File 'app/helpers/decidim/challenges/challenge_cells_helper.rb', line 36
def index_action?
context[:controller].action_name == "index"
end
|