Module: Decidim::Initiatives::ApplicationHelper
- Includes:
- CheckBoxesTreeHelper, DateRangeHelper, InitiativesHelper
- Defined in:
- app/helpers/decidim/initiatives/application_helper.rb
Overview
Custom helpers, scoped to the initiatives engine.
Instance Method Summary collapse
Methods included from InitiativesHelper
Instance Method Details
#component_name ⇒ Object
42 43 44 |
# File 'app/helpers/decidim/initiatives/application_helper.rb', line 42 def component_name (defined?(current_component) && translated_attribute(current_component&.name).presence) || t("decidim.admin.models.initiatives.fields.title") end |
#filter_states_values ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/helpers/decidim/initiatives/application_helper.rb', line 12 def filter_states_values TreeNode.new( TreePoint.new("", t("decidim.initiatives.application_helper.filter_state_values.all")), [ TreePoint.new("open", t("decidim.initiatives.application_helper.filter_state_values.open")), TreeNode.new( TreePoint.new("closed", t("decidim.initiatives.application_helper.filter_state_values.closed")), [ TreePoint.new("accepted", t("decidim.initiatives.application_helper.filter_state_values.accepted")), TreePoint.new("rejected", t("decidim.initiatives.application_helper.filter_state_values.rejected")) ] ), TreePoint.new("answered", t("decidim.initiatives.application_helper.filter_state_values.answered")) ] ) end |
#filter_types_values ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'app/helpers/decidim/initiatives/application_helper.rb', line 29 def filter_types_values types_values = Decidim::InitiativesType.where(organization: current_organization).map do |type| TreeNode.new( TreePoint.new(type.id.to_s, type.title[I18n.locale.to_s]) ) end TreeNode.new( TreePoint.new("", t("decidim.initiatives.application_helper.filter_type_values.all")), types_values ) end |