Sha256: c3b020bc14f90e55091639b9ac9ef792ff752290da5ad7ed19cb9ae6fb04600a

Contents?: true

Size: 645 Bytes

Versions: 122

Compression:

Stored size: 645 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module ParticipatoryProcesses
    # Helper that provides a single method to give a class to a
    # ParticipatoryProcessStep depending on their date.
    module ParticipatoryProcessStepsHelper
      # Returns the class for the given step depending on their end_date.
      #
      # step - the given ParticipatoryProcessStep
      # past - a Boolean indicating if the step is past or not
      #
      # Returns a String.
      def step_class(step, past)
        status = past ? "" : "timeline__item--inactive"
        step.active? ? "timeline__item--current" : status
      end
    end
  end
end

Version data entries

122 entries across 122 versions & 2 rubygems

Version Path
decidim-participatory_processes-0.6.0 app/helpers/decidim/participatory_processes/participatory_process_steps_helper.rb
decidim-0.6.0 decidim-participatory_processes/app/helpers/decidim/participatory_processes/participatory_process_steps_helper.rb