21 lines
1.0 KiB
Plaintext
21 lines
1.0 KiB
Plaintext
<div id="p-index-by-comment" class="comments-for-post">
|
|
<div class="list-of-comments list-of-messages">
|
|
<% @comments.each do |comment| %>
|
|
<% if CurrentUser.is_moderator? || (params[:search] && params[:search][:is_deleted] =~ /t/) || !comment.is_deleted? %>
|
|
<%= content_tag(:div, { id: "post_#{comment.post.id}", class: ["post", *PostPresenter.preview_class(comment.post)].join(" ") }.merge(PostPresenter.data_attributes(comment.post))) do %>
|
|
<div class="preview">
|
|
<% if comment.post.visible? %>
|
|
<%= link_to(image_tag(comment.post.preview_file_url), post_path(comment.post)) %>
|
|
<% end %>
|
|
</div>
|
|
<%= render partial: "comments/partials/show/comment", collection: [comment], locals: { context: :index_by_comment, dtext_data: DText.preprocess(@comments.map(&:body)) } %>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
<%= numbered_paginator(@comments) %>
|
|
|
|
<% content_for(:html_header, auto_discovery_link_tag(:atom, comments_url(format: "atom"), title: "Comments")) %>
|