Sha256: 52869afb22f06a23998c4b7dfb3b6fc0f9ce425ed27a483b9652453530b09c39

Contents?: true

Size: 579 Bytes

Versions: 13

Compression:

Stored size: 579 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # 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

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
decidim-core-0.5.1 app/helpers/decidim/participatory_process_steps_helper.rb
decidim-0.5.1 decidim-core/app/helpers/decidim/participatory_process_steps_helper.rb
decidim-core-0.5.0 app/helpers/decidim/participatory_process_steps_helper.rb
decidim-0.5.0 decidim-core/app/helpers/decidim/participatory_process_steps_helper.rb
decidim-core-0.4.4 app/helpers/decidim/participatory_process_steps_helper.rb
decidim-core-0.4.2 app/helpers/decidim/participatory_process_steps_helper.rb
decidim-core-0.4.1 app/helpers/decidim/participatory_process_steps_helper.rb
decidim-core-0.4.3 app/helpers/decidim/participatory_process_steps_helper.rb
decidim-core-0.4.0 app/helpers/decidim/participatory_process_steps_helper.rb
decidim-core-0.3.2 app/helpers/decidim/participatory_process_steps_helper.rb
decidim-core-0.3.1 app/helpers/decidim/participatory_process_steps_helper.rb
decidim-core-0.3.0 app/helpers/decidim/participatory_process_steps_helper.rb
decidim-core-0.2.0 app/helpers/decidim/participatory_process_steps_helper.rb