Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #329 from momijizukamori/Bug4764/S2Pagination

Bug4764/s2 pagination
  • Loading branch information...
commit 552ba7705ef666a3f00f7b99a50e6691c17d6bb3 2 parents 7729e05 + e39fc95
@afuna afuna authored
View
21 bin/upgrading/s2layers/siteviews/layout.s2
@@ -56,27 +56,31 @@ function ItemRange::print(string{} opts) {
"""<div class="$class">""";
print """<p style="font-weight: bolder; margin: 0 0 .5em 0;">""" + lang_page_of_pages($.current, $.total) + "</p>";
var string url_prev = $this->url_of($.current - 1);
+ """<span class="page-prev">""";
if ($.current != 1) {
print " <b><a href='$url_prev$anchor'>$*comment_page_prev</a></b> ";
} else {
print " <b>$*comment_page_prev</b> ";
}
- """<span style="text-align: center">""";
+ """</span>
+ <span style="text-align: center" class="page-links">""";
foreach var int i (1..$.total) {
if ($i == $.current) { "<b>[$i]</b> "; }
else {
var string url_of = $this->url_of($i);
"<a href='$url_of$anchor'><b>[$i]</b></a> ";
}
- }
+ if ($i % 10 == 0){ """<br />"""; }
+ }
"""</span>""";
var string url_next = $this->url_of($.current + 1);
+ """<span class="page-next">""";
if ($.current != $.total) {
print " <b><a href='$url_next$anchor'>$*comment_page_next</a></b> ";
} else {
print " <b>$*comment_page_next</b> ";
}
-
+ """</span>""";
if ( $.url_all != "" ) {
"""<p><a href="$.url_all">View All</a></p>""";
}
@@ -275,9 +279,11 @@ if ($p isa ReplyPage) {
}
function EntryPage::print_entry_footer(Entry e) {
- """<hr class="above-entry-interaction-links" />""";
+ """<hr class="above-entry-interaction-links" />
+ <div class="comment-pages-wrapper">""";
+ $.comment_pages->print({ "anchor" => "comments", "class" => "comment-pages toppages comment-page-list" });
+ """</div>""";
$e->print_interaction_links("topcomment");
- $.comment_pages->print({ "anchor" => "comments", "class" => "comment-pages toppages comment-page-list" });
}
function EntryPage::print_comment_section(Entry e) {
@@ -296,14 +302,15 @@ function EntryPage::print_comment_section(Entry e) {
$e->print_interaction_links("bottomcomment");
"</div>";
}
- $.comment_pages->print({ "anchor" => "comments", "class" => "comment-pages bottompages comment-page-list" });
if ($.comment_pages.total_subitems > 0) {
$.comment_nav->print({ "class" => "comment-pages bottompages" });
$this->print_reply_container({ "target" => "bottomcomment" });
$this->print_multiform_actionline();
$this->print_multiform_end();
}
- "</div></div>";
+ """<div class="commment-pages-wrapper">""";
+ $.comment_pages->print({ "anchor" => "comments", "class" => "comment-pages bottompages comment-page-list" });
+ "</div></div></div>";
}
function EntryPage::print_comments (Comment[] cs) {
View
6 htdocs/stc/entrypage.css
@@ -41,8 +41,10 @@ hr.above-entry-interaction-links, hr.below-entry-interaction-links {margin: 1em
.entry-interaction-links, .comment-pages {text-align: center; font-weight:bold; float:none;}
.entry-interaction-links li {display:inline;}
ul.entry-interaction-links {list-style: none outside none; display: inline; text-align: center; padding: 0.5em 0; margin:0;}
-.comment-page-list {max-width: 28em; margin-left:auto; margin-right: auto;}
-
+.comment-page-list { margin: 1em auto; padding: .5em;display:inline-block;}
+.page-prev, .page-next, .page-links {display: table-cell;}
+.page-prev, .page-next { vertical-align: middle; padding:0 .5em;}
+.commment-pages-wrapper {text-align: center;}
/* give talkread styling to management links without S2 overrides*/
.entry-interaction-links li:before, .comment-interaction-links li:before, .view-flat:before, .view-threaded:before, .view-top-only:before, .expand_all:before {content:"(";}
.entry-interaction-links li:after, .comment-interaction-links li:after, .view-flat:after, .view-threaded:after, .view-top-only:after, .expand_all:after {content:")";}
Please sign in to comment.
Something went wrong with that request. Please try again.