Module: Decidim::ParticipatoryProcesses::ParticipatoryProcessStepsHelper

Defined in:
decidim-participatory_processes/app/helpers/decidim/participatory_processes/participatory_process_steps_helper.rb

Overview

Helper that provides a single method to give a class to a ParticipatoryProcessStep depending on their date.

Instance Method Summary collapse

Instance Method Details

#step_class(step, past) ⇒ Object

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.



14
15
16
17
# File 'decidim-participatory_processes/app/helpers/decidim/participatory_processes/participatory_process_steps_helper.rb', line 14

def step_class(step, past)
  status = past ? "" : "timeline__item--inactive"
  step.active? ? "timeline__item--current" : status
end