31 lines
1.2 KiB
Plaintext
31 lines
1.2 KiB
Plaintext
<% cache [locale_and_user_status, @current_order, commentable_cache_key(@commentable), @comment_tree.comments, @comment_tree.comment_authors, @commentable.comments_count, @comment_flags] do %>
|
|
<section class="row-full comments">
|
|
<div class="row">
|
|
<div id="comments" class="small-12 column">
|
|
<h2>
|
|
<%= t("shared.comments.title") %>
|
|
<span class="js-comments-count">(<%= @commentable.comments_count %>)</span>
|
|
</h2>
|
|
|
|
<%= render 'shared/wide_order_selector', i18n_namespace: "comments" %>
|
|
|
|
<% if user_signed_in? %>
|
|
<%= render 'comments/form', {commentable: @commentable, parent_id: nil, toggeable: false} %>
|
|
<% else %>
|
|
<br>
|
|
|
|
<div data-alert class="callout primary">
|
|
<%= t("shared.comments.login_to_comment",
|
|
signin: link_to(t("votes.signin"), new_user_session_path),
|
|
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<% @comment_tree.root_comments.each do |comment| %>
|
|
<%= render 'comments/comment', comment: comment %>
|
|
<% end %>
|
|
<%= paginate @comment_tree.root_comments %>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<% end %> |