Sha256: 439932234fd159cc52580b85c612a1aa657c0c4f0d19b8ac9f77e5519bc70f4f

Contents?: true

Size: 746 Bytes

Versions: 5

Compression:

Stored size: 746 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Accountability
    # Helpers needed to render the navigation breadcrumbs in results.
    #
    module BreadcrumbHelper
      def stats_calculator
        @stats_calculator ||= ResultStatsCalculator.new(result)
      end

      def current_scope
        params[:filter][:scope_id] if params[:filter]
      end

      def progress_calculator(scope_id, category_id)
        Decidim::Accountability::ResultsCalculator.new(current_feature, scope_id, category_id).progress
      end

      def category
        if params[:filter] && params[:filter][:category_id].present?
          current_participatory_space.categories.find(params[:filter][:category_id])
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
decidim-accountability-0.8.4 app/helpers/decidim/accountability/breadcrumb_helper.rb
decidim-accountability-0.8.3 app/helpers/decidim/accountability/breadcrumb_helper.rb
decidim-accountability-0.8.2 app/helpers/decidim/accountability/breadcrumb_helper.rb
decidim-accountability-0.8.1 app/helpers/decidim/accountability/breadcrumb_helper.rb
decidim-accountability-0.8.0 app/helpers/decidim/accountability/breadcrumb_helper.rb