This commit is contained in:
Toks
2013-05-06 20:44:29 -04:00
parent 1a743356ce
commit 9c5266cad0
2 changed files with 22 additions and 6 deletions

View File

@@ -271,13 +271,25 @@ div#c-posts {
.prev { .prev {
position: absolute; position: absolute;
left: 1em; left: 2em;
top: 0px; top: 0px;
} }
.next { .next {
position: absolute; position: absolute;
right: 1em; right: 2em;
top: 0px;
}
.first {
position: absolute;
left: 0.5em;
top: 0px;
}
.last {
position: absolute;
right: 0.5em;
top: 0px; top: 0px;
} }

View File

@@ -194,11 +194,13 @@ class PostPresenter < Presenter
klass = "" klass = ""
end end
pool_html << template.link_to("&laquo;".html_safe, template.post_path(pool.post_id_array.first, :pool_id => pool.id), :class => "#{klass} first")
if pool.neighbors(@post).previous if pool.neighbors(@post).previous
pool_html << template.link_to("&laquo;prev".html_safe, template.post_path(pool.neighbors(@post).previous, :pool_id => pool.id), :rel => prev_rel, :class => "#{klass} prev") pool_html << template.link_to("&lsaquo;&thinsp;prev".html_safe, template.post_path(pool.neighbors(@post).previous, :pool_id => pool.id), :rel => prev_rel, :class => "#{klass} prev")
match_found = true match_found = true
else else
pool_html << '<span class="prev">&laquo;prev</span>' pool_html << '<span class="prev">&lsaquo;&thinsp;prev</span>'
end end
pool_html << ' <span class="pool-name ' + klass + '">' pool_html << ' <span class="pool-name ' + klass + '">'
@@ -206,12 +208,14 @@ class PostPresenter < Presenter
pool_html << '</span> ' pool_html << '</span> '
if pool.neighbors(@post).next if pool.neighbors(@post).next
pool_html << template.link_to("next&raquo;".html_safe, template.post_path(pool.neighbors(@post).next, :pool_id => pool.id), :rel => next_rel, :class => "#{klass} next") pool_html << template.link_to("next&thinsp;&rsaquo;".html_safe, template.post_path(pool.neighbors(@post).next, :pool_id => pool.id), :class => "#{klass} next")
match_found = true match_found = true
else else
pool_html << '<span class="next">next&raquo;</span>' pool_html << '<span class="next">next&thinsp;&rsaquo;</span>'
end end
pool_html << template.link_to("&raquo;".html_safe, template.post_path(pool.post_id_array.last, :pool_id => pool.id), :rel => next_rel, :class => "#{klass} last")
pool_html << "</li>" pool_html << "</li>"
pool_html pool_html
end end