Add link to last page of pool from index; fixes #1848
This commit is contained in:
@@ -48,6 +48,10 @@ div#c-pools {
|
|||||||
color: #AAA;
|
color: #AAA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a.last-page {
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
div#a-show {
|
div#a-show {
|
||||||
div#description {
|
div#description {
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
|
|||||||
@@ -289,6 +289,10 @@ class Pool < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def last_page
|
||||||
|
(post_count / CurrentUser.user.per_page.to_f).ceil
|
||||||
|
end
|
||||||
|
|
||||||
def reload(options = {})
|
def reload(options = {})
|
||||||
super
|
super
|
||||||
@neighbor_posts = nil
|
@neighbor_posts = nil
|
||||||
|
|||||||
@@ -17,6 +17,10 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<%= link_to h(pool.pretty_name), pool_path(pool), :class => "pool-category-#{pool.category}" %>
|
<%= link_to h(pool.pretty_name), pool_path(pool), :class => "pool-category-#{pool.category}" %>
|
||||||
|
|
||||||
|
<% if pool.post_count > CurrentUser.user.per_page %>
|
||||||
|
<%= link_to "page #{pool.last_page}", pool_path(pool, :page => pool.last_page), :class => "last-page" %>
|
||||||
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<%= pool.post_count %>
|
<%= pool.post_count %>
|
||||||
|
|||||||
Reference in New Issue
Block a user