From 40a9f3658cbcbd260f577d9539da69613206503c Mon Sep 17 00:00:00 2001 From: r888888888 Date: Fri, 24 Jul 2015 14:24:51 -0700 Subject: [PATCH] fixes #2447: Display disapproval counts in status bar to uploader and approvers --- app/views/post_disapprovals/_counts.html.erb | 24 +++++++++++-------- .../posts/partials/show/_notices.html.erb | 7 +++--- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/app/views/post_disapprovals/_counts.html.erb b/app/views/post_disapprovals/_counts.html.erb index f7843db0e..289006aaa 100644 --- a/app/views/post_disapprovals/_counts.html.erb +++ b/app/views/post_disapprovals/_counts.html.erb @@ -1,13 +1,17 @@ -It has been reviewed by <%= pluralize disapprovals.count, "moderator" %>. +<% if disapprovals.count > 0 %> +

+ It has been reviewed by <%= pluralize disapprovals.count, "moderator" %>. -<% if disapprovals.breaks_rules.count > 0 %> - <%= disapprovals.breaks_rules.count %> believe it breaks the rules. -<% end %> + <% if disapprovals.breaks_rules.count > 0 %> + <%= disapprovals.breaks_rules.count %> believe it breaks the rules. + <% end %> -<% if disapprovals.poor_quality.count > 0 %> - <%= disapprovals.poor_quality.count %> believe it has poor quality. -<% end %> + <% if disapprovals.poor_quality.count > 0 %> + <%= disapprovals.poor_quality.count %> believe it has poor quality. + <% end %> -<% if disapprovals.disinterest.count > 0 %> - <%= disapprovals.disinterest.count %> did not like the post enough to approve it. -<% end %> + <% if disapprovals.disinterest.count > 0 %> + <%= disapprovals.disinterest.count %> did not like the post enough to approve it. + <% end %> +

+<% end %> \ No newline at end of file diff --git a/app/views/posts/partials/show/_notices.html.erb b/app/views/posts/partials/show/_notices.html.erb index dce52ec2c..19daf1d27 100644 --- a/app/views/posts/partials/show/_notices.html.erb +++ b/app/views/posts/partials/show/_notices.html.erb @@ -21,9 +21,7 @@

This post was deleted

<% end %> - <% if post.disapprovals.count > 0 %> -

<%= render "post_disapprovals/counts", :disapprovals => post.disapprovals %>

- <% end %> + <%= render "post_disapprovals/counts", :disapprovals => post.disapprovals %> <% end %> @@ -31,12 +29,13 @@
<% if post.is_pending? %> This post is pending approval. - <%= render "post_disapprovals/counts", :disapprovals => post.disapprovals %> (<%= link_to "learn more", wiki_pages_path(:title => "about:mod_queue") %>) <% else %> This post was flagged and is pending approval (<%= link_to "learn more", wiki_pages_path(:title => "about:mod_queue") %>) <% end %> + <%= render "post_disapprovals/counts", :disapprovals => post.disapprovals %> + <% if CurrentUser.can_approve_posts? && !post.disapproved_by?(CurrentUser.user) %>
<% unless post.is_status_locked? %>