Sha256: 751f1c81af46a6f7ce323572aa595434a8a358c6fe2e9d6570cd54df871fee6a

Contents?: true

Size: 621 Bytes

Versions: 7

Compression:

Stored size: 621 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Comments
    # This cell renders the comment metadata for a card
    class CommentMetadataCell < Decidim::CardMetadataCell
      delegate :root_commentable, to: :model

      private

      def items
        [author_item, commentable_item, comments_count_item]
      end

      def commentable_item
        {
          text: decidim_html_escape(translated_attribute(root_commentable.title)),
          icon: resource_type_icon_key(root_commentable.class)
        }
      end

      def comments_count_item
        super(root_commentable)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
decidim-comments-0.28.4 app/cells/decidim/comments/comment_metadata_cell.rb
decidim-comments-0.28.3 app/cells/decidim/comments/comment_metadata_cell.rb
decidim-comments-0.28.2 app/cells/decidim/comments/comment_metadata_cell.rb
decidim-comments-0.28.1 app/cells/decidim/comments/comment_metadata_cell.rb
decidim-comments-0.28.0 app/cells/decidim/comments/comment_metadata_cell.rb
decidim-comments-0.28.0.rc5 app/cells/decidim/comments/comment_metadata_cell.rb
decidim-comments-0.28.0.rc4 app/cells/decidim/comments/comment_metadata_cell.rb