<% valuation = local_assigns.fetch(:valuation, false) %> <% allow_comments = local_assigns.fetch(:allow_comments, true) %> <% cache [locale_and_user_status, @current_order, commentable_cache_key(@investment), @comment_tree.comments, @comment_tree.comment_authors, @investment.comments_count, @comment_flags] do %>

<%= t("debates.show.comments_title") %> (<%= @investment.comments_count %>)

<%= render 'shared/wide_order_selector', i18n_namespace: "comments" %> <% if user_signed_in? && allow_comments %> <%= render 'comments/form', { commentable: @investment, parent_id: nil, toggeable: false, valuation: valuation } %> <% 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, valuation: valuation, allow_comments: allow_comments } %> <% end %> <%= paginate @comment_tree.root_comments %>
<% end %>