Sha256: ea063c21fa8f78a561684e9621dc57bfb37d4f386fa530532212ace7fe73718d

Contents?: true

Size: 1.15 KB

Versions: 24

Compression:

Stored size: 1.15 KB

Contents

# frozen_string_literal: true

require "cell/partial"

module Decidim
  module Proposals
    # This cell renders the collaborative_draft card for an instance of a CollaborativeDraft
    # the default size is the Medium Card (:m)
    class CollaborativeDraftCell < Decidim::ViewModel
      include CollaborativeDraftCellsHelper
      include Cell::ViewModel::Partial
      include Messaging::ConversationHelper

      def show
        cell card_size, model, @options
      end

      private

      def card_size
        "decidim/proposals/collaborative_draft_m"
      end

      def resource_path
        resource_locator(model).path(filter_link_params)
      end

      def current_participatory_space
        model.component.participatory_space
      end

      def component_name
        translated_attribute current_component.name
      end

      def component_type_name
        model.class.model_name.human
      end

      def participatory_space_name
        translated_attribute current_participatory_space.title
      end

      def participatory_space_type_name
        translated_attribute current_participatory_space.model_name.human
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

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