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.29.1 app/helpers/decidim/participatory_processes/participatory_process_steps_helper.rb
decidim-participatory_processes-0.28.4 app/helpers/decidim/participatory_processes/participatory_process_steps_helper.rb
decidim-participatory_processes-0.27.9 app/helpers/decidim/participatory_processes/participatory_process_steps_helper.rb
decidim-participatory_processes-0.29.0 app/helpers/decidim/participatory_processes/participatory_process_steps_helper.rb
decidim-participatory_processes-0.28.3 app/helpers/decidim/participatory_processes/participatory_process_steps_helper.rb
decidim-participatory_processes-0.27.8 app/helpers/decidim/participatory_processes/participatory_process_steps_helper.rb
decidim-participatory_processes-0.29.0.rc4 app/helpers/decidim/participatory_processes/participatory_process_steps_helper.rb
decidim-participatory_processes-0.29.0.rc3 app/helpers/decidim/participatory_processes/participatory_process_steps_helper.rb
decidim-participatory_processes-0.29.0.rc2 app/helpers/decidim/participatory_processes/participatory_process_steps_helper.rb
decidim-participatory_processes-0.29.0.rc1 app/helpers/decidim/participatory_processes/participatory_process_steps_helper.rb
decidim-participatory_processes-0.28.2 app/helpers/decidim/participatory_processes/participatory_process_steps_helper.rb
decidim-participatory_processes-0.27.7 app/helpers/decidim/participatory_processes/participatory_process_steps_helper.rb
decidim-participatory_processes-0.28.1 app/helpers/decidim/participatory_processes/participatory_process_steps_helper.rb
decidim-participatory_processes-0.27.6 app/helpers/decidim/participatory_processes/participatory_process_steps_helper.rb
decidim-participatory_processes-0.26.10 app/helpers/decidim/participatory_processes/participatory_process_steps_helper.rb
decidim-participatory_processes-0.26.9 app/helpers/decidim/participatory_processes/participatory_process_steps_helper.rb
decidim-participatory_processes-0.28.0 app/helpers/decidim/participatory_processes/participatory_process_steps_helper.rb
decidim-participatory_processes-0.27.5 app/helpers/decidim/participatory_processes/participatory_process_steps_helper.rb
decidim-participatory_processes-0.28.0.rc5 app/helpers/decidim/participatory_processes/participatory_process_steps_helper.rb
decidim-participatory_processes-0.28.0.rc4 app/helpers/decidim/participatory_processes/participatory_process_steps_helper.rb