From 151b276fb9b19b54fb5a16deef01c3847df909fd Mon Sep 17 00:00:00 2001 From: evazion Date: Wed, 7 Jun 2017 22:02:51 -0500 Subject: [PATCH] modqueue: display pools for each post (fix #3125). --- app/assets/stylesheets/specific/pools.scss | 8 ++++++++ app/models/post.rb | 4 ++++ app/views/moderator/post/queues/_post.html.erb | 3 +++ app/views/pools/_inline_list.html.erb | 5 +++++ 4 files changed, 20 insertions(+) create mode 100644 app/views/pools/_inline_list.html.erb diff --git a/app/assets/stylesheets/specific/pools.scss b/app/assets/stylesheets/specific/pools.scss index ed1878842..5be39a81e 100644 --- a/app/assets/stylesheets/specific/pools.scss +++ b/app/assets/stylesheets/specific/pools.scss @@ -81,3 +81,11 @@ div#c-pool-orders, div#c-favorite-group-orders { } } } + +ul.inline-pool-list { + display: inline; + + li { + display: inline; + } +} diff --git a/app/models/post.rb b/app/models/post.rb index 2e49b9384..b0cfb704c 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -1031,6 +1031,10 @@ class Post < ActiveRecord::Base end end + def has_active_pools? + pools.length > 0 + end + def belongs_to_pool?(pool) pool_string =~ /(?:\A| )pool:#{pool.id}(?:\Z| )/ end diff --git a/app/views/moderator/post/queues/_post.html.erb b/app/views/moderator/post/queues/_post.html.erb index 9e564458a..91826bcc8 100644 --- a/app/views/moderator/post/queues/_post.html.erb +++ b/app/views/moderator/post/queues/_post.html.erb @@ -34,6 +34,9 @@ Hidden: <%= render "post_disapprovals/compact_counts", :disapprovals => post.disapprovals, :post => post %>
  • Source: <%= post.source %>
  • + <% if post.has_active_pools? %> +
  • Pools: <%= render "pools/inline_list", pools: post.pools %>
  • + <% end %>
  • Tags: <%= post.presenter.inline_tag_list_html(self) %>
  • diff --git a/app/views/pools/_inline_list.html.erb b/app/views/pools/_inline_list.html.erb new file mode 100644 index 000000000..73bfc7b89 --- /dev/null +++ b/app/views/pools/_inline_list.html.erb @@ -0,0 +1,5 @@ +