From 6c386ffd95fb6c282a101451c734a79a6eb16fc6 Mon Sep 17 00:00:00 2001 From: Bertocq Date: Mon, 26 Jun 2017 18:52:43 +0200 Subject: [PATCH] Make comments count display optional using a variable on comments comment_tree partial --- app/views/comments/_comment_tree.html.erb | 10 ++++++---- app/views/legislation/annotations/show.html.erb | 4 +++- app/views/legislation/questions/show.html.erb | 5 +++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/views/comments/_comment_tree.html.erb b/app/views/comments/_comment_tree.html.erb index a43ad94fa..45b4aea03 100644 --- a/app/views/comments/_comment_tree.html.erb +++ b/app/views/comments/_comment_tree.html.erb @@ -4,10 +4,12 @@
-

- <%= comment_tree_title_text(commentable) %> - (<%= commentable.comments_count %>) -

+ <% if display_comments_count %> +

+ <%= comment_tree_title_text(commentable) %> + (<%= commentable.comments_count %>) +

+ <% end %> <%= render 'shared/wide_order_selector', i18n_namespace: "comments" %> diff --git a/app/views/legislation/annotations/show.html.erb b/app/views/legislation/annotations/show.html.erb index 65ce8e947..1854addb5 100644 --- a/app/views/legislation/annotations/show.html.erb +++ b/app/views/legislation/annotations/show.html.erb @@ -40,7 +40,9 @@
- <%= render partial: '/comments/comment_tree', locals: { comment_tree: @comment_tree, comment_flags: @comment_flags } %> + <%= render partial: '/comments/comment_tree', locals: { comment_tree: @comment_tree, + comment_flags: @comment_flags, + display_comments_count: true } %>
diff --git a/app/views/legislation/questions/show.html.erb b/app/views/legislation/questions/show.html.erb index ab1443628..7361ea8f4 100644 --- a/app/views/legislation/questions/show.html.erb +++ b/app/views/legislation/questions/show.html.erb @@ -42,6 +42,7 @@ - <%= render partial: '/comments/comment_tree', locals: { comment_tree: @comment_tree, comment_flags: @comment_flags } %> - + <%= render partial: '/comments/comment_tree', locals: { comment_tree: @comment_tree, + comment_flags: @comment_flags, + display_comments_count: true } %>