list series pools first on post pages; color collection pools purple

This commit is contained in:
Toks
2013-05-13 21:11:48 -04:00
parent a9efb93e99
commit fb4ce9a13b
3 changed files with 18 additions and 5 deletions

View File

@@ -1,5 +1,13 @@
@import "../common/000_vars.css.scss";
a.pool-category-collection, span.pool-category-collection a {
color: #A0A;
&:hover {
color: #B6B;
}
}
div#c-pool-elements {
div#a-new {
font-size: 0.8em;

View File

@@ -161,12 +161,17 @@ class PostPresenter < Presenter
return if pool.nil?
html += pool_link_html(template, pool, :include_rel => true)
@post.pools.active.where("id <> ?", template.params[:pool_id]).each do |other_pool|
other_pools = @post.pools.active.where("id <> ?", template.params[:pool_id])
other_pools = other_pools.series + other_pools.collection
other_pools.each do |other_pool|
html += pool_link_html(template, other_pool)
end
else
pools = @post.pools.active
pools = pools.series + pools.collection
first = true
@post.pools.active.each do |pool|
pools.each do |pool|
if first && template.params[:tags].blank?
html += pool_link_html(template, pool, :include_rel => true)
first = false
@@ -187,11 +192,11 @@ class PostPresenter < Presenter
if options[:include_rel]
prev_rel = "prev"
next_rel = "next"
klass = "active"
klass = "active pool-category-#{pool.category}"
else
prev_rel = nil
next_rel = nil
klass = ""
klass = "pool-category-#{pool.category}"
end
if pool.neighbors(@post).previous

View File

@@ -17,7 +17,7 @@
</td>
<td>
<%= link_to h(pool.pretty_name), pool_path(pool) %>
<%= link_to h(pool.pretty_name), pool_path(pool), :class => "pool-category-#{pool.category}" %>
</td>
<td>
<%= link_to_user pool.creator %>