Sha256: 8169ab147516045fdf2e7ab015cbeac9dfaede382652a242ad885784a52b5434

Contents?: true

Size: 578 Bytes

Versions: 7

Compression:

Stored size: 578 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

7 entries across 7 versions & 1 rubygems

Version Path
decidim-core-0.1.0 app/helpers/decidim/participatory_process_steps_helper.rb
decidim-core-0.0.8.1 app/helpers/decidim/participatory_process_steps_helper.rb
decidim-core-0.0.7 app/helpers/decidim/participatory_process_steps_helper.rb
decidim-core-0.0.6 app/helpers/decidim/participatory_process_steps_helper.rb
decidim-core-0.0.5 app/helpers/decidim/participatory_process_steps_helper.rb
decidim-core-0.0.3 app/helpers/decidim/participatory_process_steps_helper.rb
decidim-core-0.0.2 app/helpers/decidim/participatory_process_steps_helper.rb