Module: Decidim::Elections::ApplicationHelper
- Includes:
- CheckBoxesTreeHelper
- Defined in:
- app/helpers/decidim/elections/application_helper.rb
Overview
Custom helpers, scoped to the elections engine.
Instance Method Summary collapse
Instance Method Details
#component_name ⇒ Object
25 26 27 |
# File 'app/helpers/decidim/elections/application_helper.rb', line 25 def component_name (defined?(current_component) && translated_attribute(current_component&.name).presence) || t("decidim.components.elections.name") end |
#date_filter_values ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'app/helpers/decidim/elections/application_helper.rb', line 10 def date_filter_values TreeNode.new( TreePoint.new("", t("elections.elections.filters.all", scope: "decidim")), [ TreePoint.new("active", t("elections.elections.filters.active", scope: "decidim")), TreePoint.new("upcoming", t("elections.elections.filters.upcoming", scope: "decidim")), TreePoint.new("finished", t("elections.elections.filters.finished", scope: "decidim")) ] ) end |
#filter_sections ⇒ Object
21 22 23 |
# File 'app/helpers/decidim/elections/application_helper.rb', line 21 def filter_sections @filter_sections ||= [{ method: :with_any_date, collection: date_filter_values, label_scope: "decidim.elections.elections.filters", id: "date" }] end |