mirror of
https://github.com/discourse/discourse.git
synced 2026-08-11 02:59:07 +08:00
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)
24 lines
1.2 KiB
Text
Vendored
24 lines
1.2 KiB
Text
Vendored
<% 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 %>
|