From 23397eecb387fff16b1cb0c1b36517e63680d928 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Tue, 10 Oct 2017 12:04:55 +0200 Subject: [PATCH] increases consistency by moving comment's view to poll's folder --- app/views/polls/_comments.html.erb | 24 ++++++++++++++++++++++ app/views/shared/_comments.html.erb | 31 ----------------------------- 2 files changed, 24 insertions(+), 31 deletions(-) create mode 100644 app/views/polls/_comments.html.erb delete mode 100644 app/views/shared/_comments.html.erb diff --git a/app/views/polls/_comments.html.erb b/app/views/polls/_comments.html.erb new file mode 100644 index 000000000..09b59cee6 --- /dev/null +++ b/app/views/polls/_comments.html.erb @@ -0,0 +1,24 @@ +<% cache [locale_and_user_status, @current_order, commentable_cache_key(@poll), @comment_tree.comments, @comment_tree.comment_authors, @poll.comments_count, @comment_flags] do %> +
+
+ <%= render 'shared/wide_order_selector', i18n_namespace: "comments" %> + + <% if user_signed_in? %> + <%= render 'comments/form', {commentable: @poll, parent_id: nil, toggeable: false} %> + <% else %> +
+ +
+ <%= t("polls.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 %> + <% end %> + <%= paginate @comment_tree.root_comments %> +
+
+<% end %> diff --git a/app/views/shared/_comments.html.erb b/app/views/shared/_comments.html.erb deleted file mode 100644 index db097a7c4..000000000 --- a/app/views/shared/_comments.html.erb +++ /dev/null @@ -1,31 +0,0 @@ -<% cache [locale_and_user_status, @current_order, commentable_cache_key(@commentable), @comment_tree.comments, @comment_tree.comment_authors, @commentable.comments_count, @comment_flags] do %> -
-
-
-

- <%= t("shared.comments.title") %> - (<%= @commentable.comments_count %>) -

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