Sha256: 1d86122c867cc8746228e2586c91400e8da96ffb9cefc522d0b9fef1408d3637

Contents?: true

Size: 1.12 KB

Versions: 21

Compression:

Stored size: 1.12 KB

Contents

# frozen_string_literal: true

module Decidim
  module ParticipatoryProcesses
    # This cell renders the Medium (:m) process card
    # for an given instance of a Process
    class ProcessMCell < Decidim::CardMCell
      private

      def has_image?
        true
      end

      def has_state?
        model.past?
      end

      def has_badge?
        false
      end

      def has_step?
        model.active_step.present?
      end

      def state_classes
        return unless model.past?
        ["alert"]
      end

      def resource_path
        Decidim::ParticipatoryProcesses::Engine.routes.url_helpers.participatory_process_path(model)
      end

      def resource_image_path
        model.hero_image.url
      end

      def step_title
        translated_attribute model.active_step.title
      end

      def base_card_class
        "card--process"
      end

      def statuses
        [:creation_date, :follow]
      end

      def resource_icon
        icon "processes", class: "icon--big"
      end

      def start_date
        model.start_date
      end

      def end_date
        model.end_date
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
decidim-participatory_processes-0.18.1 app/cells/decidim/participatory_processes/process_m_cell.rb
decidim-participatory_processes-0.17.2 app/cells/decidim/participatory_processes/process_m_cell.rb
decidim-participatory_processes-0.18.0 app/cells/decidim/participatory_processes/process_m_cell.rb
decidim-participatory_processes-0.17.1 app/cells/decidim/participatory_processes/process_m_cell.rb
decidim-participatory_processes-0.16.1 app/cells/decidim/participatory_processes/process_m_cell.rb
decidim-participatory_processes-0.17.0 app/cells/decidim/participatory_processes/process_m_cell.rb
decidim-participatory_processes-0.16.0 app/cells/decidim/participatory_processes/process_m_cell.rb
decidim-participatory_processes-0.15.2 app/cells/decidim/participatory_processes/process_m_cell.rb
decidim-participatory_processes-0.15.1 app/cells/decidim/participatory_processes/process_m_cell.rb
decidim-participatory_processes-0.15.0 app/cells/decidim/participatory_processes/process_m_cell.rb
decidim-participatory_processes-0.14.4 app/cells/decidim/participatory_processes/process_m_cell.rb
decidim-participatory_processes-0.14.3 app/cells/decidim/participatory_processes/process_m_cell.rb
decidim-participatory_processes-0.14.2 app/cells/decidim/participatory_processes/process_m_cell.rb
decidim-participatory_processes-0.14.1 app/cells/decidim/participatory_processes/process_m_cell.rb
decidim-participatory_processes-0.13.1 app/cells/decidim/participatory_processes/process_m_cell.rb
decidim-participatory_processes-0.12.2 app/cells/decidim/participatory_processes/process_m_cell.rb
decidim-participatory_processes-0.13.0 app/cells/decidim/participatory_processes/process_m_cell.rb
decidim-participatory_processes-0.12.1 app/cells/decidim/participatory_processes/process_m_cell.rb
decidim-participatory_processes-0.13.0.pre1 app/cells/decidim/participatory_processes/process_m_cell.rb
decidim-participatory_processes-0.12.0 app/cells/decidim/participatory_processes/process_m_cell.rb