modqueue: display pools for each post (fix #3125).

This commit is contained in:
evazion
2017-06-07 22:02:51 -05:00
parent 12fffc3760
commit 151b276fb9
4 changed files with 20 additions and 0 deletions

View File

@@ -81,3 +81,11 @@ div#c-pool-orders, div#c-favorite-group-orders {
}
}
}
ul.inline-pool-list {
display: inline;
li {
display: inline;
}
}

View File

@@ -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

View File

@@ -34,6 +34,9 @@
<strong>Hidden</strong>: <%= render "post_disapprovals/compact_counts", :disapprovals => post.disapprovals, :post => post %>
</li>
<li><strong>Source</strong>: <%= post.source %></li>
<% if post.has_active_pools? %>
<li><strong>Pools</strong>: <%= render "pools/inline_list", pools: post.pools %></li>
<% end %>
<li><strong>Tags</strong>: <%= post.presenter.inline_tag_list_html(self) %></li>
</ul>
</section>

View File

@@ -0,0 +1,5 @@
<ul class="inline-pool-list">
<% pools.each do |pool| %>
<li><%= link_to pool.pretty_name, pool, :class => "pool-category-#{pool.category}" %></li>
<% end %>
</ul>