Sha256: b09119ff4ba344afebb4edb4d82e8d7e97e155919252aae59bd56bbcbd2cce4b

Contents?: true

Size: 730 Bytes

Versions: 7

Compression:

Stored size: 730 Bytes

Contents

# frozen_string_literal: true

require "cell/partial"

module Decidim
  module Proposals
    # This cell renders a proposal with its M-size card.
    class CollaborativeDraftMCell < Decidim::CardMCell
      include CollaborativeDraftCellsHelper

      def badge
        render
      end

      private

      def has_state?
        true
      end

      def description
        truncate(model.body, length: 100)
      end

      def has_badge?
        true
      end

      def badge_classes
        return super unless options[:full_badge]
        state_classes.concat(["label", "collaborative-draft-status"]).join(" ")
      end

      def statuses
        [:creation_date, :follow, :comments_count]
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
decidim-proposals-0.15.2 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.15.1 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.15.0 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.14.4 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.14.3 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.14.2 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.14.1 app/cells/decidim/proposals/collaborative_draft_m_cell.rb