From 1c3924b5275bddb53db1f28ae33ad9f35ba57c5b Mon Sep 17 00:00:00 2001 From: Bertocq Date: Tue, 30 Jan 2018 03:19:36 +0100 Subject: [PATCH] Hide comment voting at valuation comment threads --- app/views/comments/_comment.html.erb | 10 +++++++--- app/views/comments/_comment_tree.html.erb | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb index a5d84166e..5de5b6c24 100644 --- a/app/views/comments/_comment.html.erb +++ b/app/views/comments/_comment.html.erb @@ -1,5 +1,6 @@ <% comment_flags ||= @comment_flags %> <% valuation = local_assigns.fetch(:valuation, false) %> +<% allow_votes = local_assigns.fetch(:allow_votes, true) %> <% cache [locale_and_user_status(comment), comment, commentable_cache_key(comment.commentable), comment.author, (comment_flags[comment.id] if comment_flags)] do %> diff --git a/app/views/comments/_comment_tree.html.erb b/app/views/comments/_comment_tree.html.erb index 436c50904..6b0bdc296 100644 --- a/app/views/comments/_comment_tree.html.erb +++ b/app/views/comments/_comment_tree.html.erb @@ -42,7 +42,8 @@ <% comment_tree.root_comments.each do |comment| %> <%= render 'comments/comment', { comment: comment, comment_flags: comment_flags, - valuation: valuation } %> + valuation: valuation, + allow_votes: !valuation } %> <% end %> <%= paginate comment_tree.root_comments %>