From d721920b97c28606998588e2cf82eda95f2b6674 Mon Sep 17 00:00:00 2001 From: lalo Date: Tue, 4 Jun 2019 12:48:20 +0200 Subject: [PATCH] Display commenter as admin description or name --- app/views/comments/_comment.html.erb | 12 +- app/views/comments/_comment_tree.html.erb | 6 +- .../_valuation_comments.html.erb | 12 +- .../comments/budget_investments_spec.rb | 130 +++++++++++++----- 4 files changed, 116 insertions(+), 44 deletions(-) diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb index 9fc0f875b..8e72d6c53 100644 --- a/app/views/comments/_comment.html.erb +++ b/app/views/comments/_comment.html.erb @@ -3,7 +3,8 @@ <% allow_votes = local_assigns.fetch(:allow_votes, true) %> <% allow_actions = local_assigns.fetch(:allow_actions, true) %> <% allow_comments = local_assigns.fetch(:allow_comments, true) %> -<% cache [locale_and_user_status(comment), comment, commentable_cache_key(comment.commentable), comment.author, (comment_flags[comment.id] if comment_flags)] do %> +<% admin_layout = local_assigns.fetch(:admin_layout, false) %> +<% cache [locale_and_user_status(comment), comment, commentable_cache_key(comment.commentable), comment.author, (comment_flags[comment.id] if comment_flags), (admin_layout if admin_layout)] do %>