<% commentable = comment_tree.commentable %> <% valuation = local_assigns.fetch(:valuation, false) %> <% allow_comments = local_assigns.fetch(:allow_comments, true) %> <% cache [locale_and_user_status, comment_tree.order, commentable_cache_key(commentable), comment_tree.comments, comment_tree.comment_authors, commentable.comments_count, comment_flags] do %>
<% if display_comments_count %>

<%= comment_tree_title_text(commentable) %> (<%= commentable.comments_count %>)

<% end %> <%= render 'shared/wide_order_selector', i18n_namespace: "comments" %> <% if user_signed_in? %> <% if comments_closed_for_commentable?(commentable) %>
<%= comments_closed_text(commentable) %>
<% elsif require_verified_resident_for_commentable?(commentable, current_user) %>
<%= t("comments.verified_only", verify_account: link_to(t("comments.verify_account"), verification_path )).html_safe %>
<% elsif allow_comments %> <%= render 'comments/form', { commentable: commentable, parent_id: nil, toggeable: false, valuation: valuation } %> <% end %> <% else %>
<%= t("debates.show.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 %>
<% end %> <% comment_tree.root_comments.each do |comment| %> <%= render 'comments/comment', { comment: comment, comment_flags: comment_flags, valuation: valuation, allow_votes: !valuation, allow_actions: !valuation, allow_comments: allow_comments } %> <% end %> <%= paginate comment_tree.root_comments %>
<% end %>