Sha256: e2933c9ea34168a62a39bfd57fe47fc3d99b0e5c9fb495cdf8f362c2af8a0117

Contents?: true

Size: 548 Bytes

Versions: 37

Compression:

Stored size: 548 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Comments
    # A cell to display a comment thread.
    class CommentThreadCell < Decidim::ViewModel
      def title
        return unless has_threads?

        render :title
      end

      private

      def has_threads?
        model.comment_threads.any?
      end

      def author_name
        return t("decidim.components.comment.deleted_user") if model.author.deleted?

        model.author.name
      end

      def order
        options[:order] || "older"
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

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