Sha256: d06873e02cb19eb33d34d04a3b4925f821ae50dd59976f35103f5174ee4b0edc

Contents?: true

Size: 826 Bytes

Versions: 37

Compression:

Stored size: 826 Bytes

Contents

# frozen_string_literal: true

require "cell/partial"

module Decidim
  module Accountability
    # This cell renders the Medium (:m) result card
    # for an instance of a Result
    class ResultMCell < Decidim::CardMCell
      include Decidim::SanitizeHelper
      include Decidim::TranslationsHelper
      include ActiveSupport::NumberHelper

      delegate :start_date, :end_date, :progress, to: :model

      private

      def resource_path
        resource_locator(model).path
      end

      def progress_text
        return if progress.blank?

        number_to_percentage(progress, precision: 1, strip_insignificant_zeros: true, locale: I18n.locale, format: "%n%")
      end

      def statuses
        []
      end

      def has_dates?
        start_date.present? && end_date.present?
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
decidim-accountability-0.27.9 app/cells/decidim/accountability/result_m_cell.rb
decidim-accountability-0.27.8 app/cells/decidim/accountability/result_m_cell.rb
decidim-accountability-0.27.7 app/cells/decidim/accountability/result_m_cell.rb
decidim-accountability-0.27.6 app/cells/decidim/accountability/result_m_cell.rb
decidim-accountability-0.26.10 app/cells/decidim/accountability/result_m_cell.rb
decidim-accountability-0.26.9 app/cells/decidim/accountability/result_m_cell.rb
decidim-accountability-0.27.5 app/cells/decidim/accountability/result_m_cell.rb
decidim-accountability-0.26.8 app/cells/decidim/accountability/result_m_cell.rb
decidim-accountability-0.27.4 app/cells/decidim/accountability/result_m_cell.rb
decidim-accountability-0.27.3 app/cells/decidim/accountability/result_m_cell.rb
decidim-accountability-0.26.7 app/cells/decidim/accountability/result_m_cell.rb
decidim-accountability-0.26.5 app/cells/decidim/accountability/result_m_cell.rb
decidim-accountability-0.27.2 app/cells/decidim/accountability/result_m_cell.rb
decidim-accountability-0.27.1 app/cells/decidim/accountability/result_m_cell.rb
decidim-accountability-0.26.4 app/cells/decidim/accountability/result_m_cell.rb
decidim-accountability-0.27.0 app/cells/decidim/accountability/result_m_cell.rb
decidim-accountability-0.26.3 app/cells/decidim/accountability/result_m_cell.rb
decidim-accountability-0.27.0.rc2 app/cells/decidim/accountability/result_m_cell.rb
decidim-accountability-0.27.0.rc1 app/cells/decidim/accountability/result_m_cell.rb
decidim-accountability-0.26.2 app/cells/decidim/accountability/result_m_cell.rb