Sha256: 2672d2a22533894fb8543bbe68d685846ea0808e038635561996807c4b71ed41

Contents?: true

Size: 843 Bytes

Versions: 22

Compression:

Stored size: 843 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 title
        decidim_html_escape(present(model).title)
      end

      def description
        decidim_sanitize(present(model).body.truncate(100, separator: /\s/))
      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

22 entries across 22 versions & 1 rubygems

Version Path
decidim-proposals-0.25.2 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.25.1 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.25.0 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.25.0.rc4 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.25.0.rc3 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.25.0.rc2 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.25.0.rc1 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.24.3 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.23.6 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.24.2 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.23.5 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.24.1 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.24.0 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.24.0.rc2 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.23.4 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.24.0.rc1 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.23.3 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.23.2 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.23.1 app/cells/decidim/proposals/collaborative_draft_m_cell.rb
decidim-proposals-0.23.1.rc1 app/cells/decidim/proposals/collaborative_draft_m_cell.rb