0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-11 02:59:07 +08:00
discourse/plugins/discourse-post-voting/app/views/post_voting/crawler_post.html.erb
Jarek Radosz 5265fe7129
FEATURE: Restore the crawler view for post-voting comments (#39636)
Removed in 2022 because of perf considerations.

This restores it and updates the implementation and styling. The perf
should not be an issue anymore:

1. it's now rendered only in the crawler view (and not for regular
logged-in users or anons)
2. it previously used Rails' partial rendering which re-read file on
each request. `register_html_builder` is more efficient (and this
particular block skips rendering completely when not applicable)
2026-04-29 16:55:17 +02:00

24 lines
1.2 KiB
Text
Vendored
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<% if @comments.present? %>
<div class="post-voting-comments">
<% @comments.each do |comment| %>
<% next if comment.user.blank? %>
<div class="post-voting-comments__comment" itemprop="comment" itemscope itemtype="http://schema.org/Comment">
<span class="post-voting-comments__comment-cooked" itemprop="text"><%= comment.cooked.html_safe %></span>
<span class="post-voting-comments__separator"></span>
<span class="post-voting-comments__comment-creator" itemprop="author" itemscope itemtype="http://schema.org/Person">
<a rel="nofollow" itemprop="url" href="<%= comment.user.full_url %>"><span itemprop="name"><%= comment.user.username %></span></a>
</span>
<time itemprop="datePublished" datetime="<%= comment.created_at.iso8601 %>" class="post-voting-comments__comment-time">
(<%= l comment.created_at, format: :long %>)
</time>
</div>
<% end %>
</div>
<% end %>
<% if @reply_count > 0 %>
<div class="post-voting-answer-count">
<h2><%= t("topic.post_voting.answer_count", count: @reply_count) %></h2>
<span class="post-voting-answer-count__value"><%= @reply_count %></span>
</div>
<% end %>