Module: Decidim::Accountability::BreadcrumbHelper
- Defined in:
- app/helpers/decidim/accountability/breadcrumb_helper.rb
Overview
Helpers needed to render the navigation breadcrumbs in results.
Instance Method Summary collapse
- #category ⇒ Object
- #current_scope ⇒ Object
- #progress_calculator(scope_id, category_id) ⇒ Object
- #stats_calculator ⇒ Object
Instance Method Details
#category ⇒ Object
20 21 22 |
# File 'app/helpers/decidim/accountability/breadcrumb_helper.rb', line 20 def category current_participatory_space.categories.find(params[:filter][:category_id]) if params[:filter] && params[:filter][:category_id].present? end |
#current_scope ⇒ Object
12 13 14 |
# File 'app/helpers/decidim/accountability/breadcrumb_helper.rb', line 12 def current_scope params[:filter][:scope_id] if params[:filter] end |
#progress_calculator(scope_id, category_id) ⇒ Object
16 17 18 |
# File 'app/helpers/decidim/accountability/breadcrumb_helper.rb', line 16 def progress_calculator(scope_id, category_id) Decidim::Accountability::ResultsCalculator.new(current_component, scope_id, category_id).progress end |
#stats_calculator ⇒ Object
8 9 10 |
# File 'app/helpers/decidim/accountability/breadcrumb_helper.rb', line 8 def stats_calculator @stats_calculator ||= ResultStatsCalculator.new(result) end |