diff --git a/app/views/debates/_comments.html.erb b/app/views/debates/_comments.html.erb index 5fbea960d..2a2fb518e 100644 --- a/app/views/debates/_comments.html.erb +++ b/app/views/debates/_comments.html.erb @@ -1,28 +1,29 @@ -
-
-
+<% cache [locale_and_user_status, commentable_cache_key(@debate), @all_visible_comments, @all_visible_comments.map(&:author), @debate.comments_count, @comment_flags] do %> +
+
+
+

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

-

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

+ <% if user_signed_in? %> + <%= render 'comments/form', {commentable: @debate, parent_id: nil, toggeable: false} %> + <% else %> +
- <% if user_signed_in? %> - <%= render 'comments/form', {commentable: @debate, parent_id: nil, toggeable: false} %> - <% 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 %> -
- <%= 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 %> - - <% @root_comments.each do |comment| %> - <%= render 'comments/comment', comment: comment %> - <% end %> - <%= paginate @root_comments %> + <% @root_comments.each do |comment| %> + <%= render 'comments/comment', comment: comment %> + <% end %> + <%= paginate @root_comments %> +
-
-
\ No newline at end of file + +<% end %> \ No newline at end of file