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

Instance Method Details

#categoryObject



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_scopeObject



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_calculatorObject



8
9
10
# File 'app/helpers/decidim/accountability/breadcrumb_helper.rb', line 8

def stats_calculator
  @stats_calculator ||= ResultStatsCalculator.new(result)
end