Module: Decidim::Accountability::BreadcrumbHelper
- Included in:
- StatusCell
- Defined in:
- app/helpers/decidim/accountability/breadcrumb_helper.rb
Overview
Helpers needed to render the navigation breadcrumbs in results.
Instance Method Summary collapse
- #parent_taxonomies(taxonomy) ⇒ Object
- #progress_calculator(taxonomy_id) ⇒ Object
- #taxonomies_hierarchy ⇒ Object
- #taxonomy ⇒ Object
Instance Method Details
#parent_taxonomies(taxonomy) ⇒ Object
18 19 20 21 22 |
# File 'app/helpers/decidim/accountability/breadcrumb_helper.rb', line 18 def parent_taxonomies(taxonomy) return [] if taxonomy&.parent.blank? || taxonomy&.parent&.root? [*parent_taxonomies(taxonomy.parent), taxonomy.parent] end |
#progress_calculator(taxonomy_id) ⇒ Object
8 9 10 |
# File 'app/helpers/decidim/accountability/breadcrumb_helper.rb', line 8 def progress_calculator(taxonomy_id) Decidim::Accountability::ResultsCalculator.new(current_component, taxonomy_id).progress end |
#taxonomies_hierarchy ⇒ Object
24 25 26 |
# File 'app/helpers/decidim/accountability/breadcrumb_helper.rb', line 24 def taxonomies_hierarchy parent_taxonomies(taxonomy) end |
#taxonomy ⇒ Object
12 13 14 15 16 |
# File 'app/helpers/decidim/accountability/breadcrumb_helper.rb', line 12 def taxonomy return if (taxonomy_id = params.dig(:filter, :taxonomies_part_of_contains)).blank? @taxonomy ||= current_organization.taxonomies.find(taxonomy_id.is_a?(Array) ? taxonomy_id.first : taxonomy_id) end |