diff options
author | Lukas Fleischer <cgit@cryptocrack.de> | 2013-03-07 16:56:22 (JST) |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2013-03-21 05:16:19 (JST) |
commit | b60e6bff75719a5fb0df970bac3be6b2726cf73a (patch) | |
tree | 706c27228919f3cca2d307b1d3dfcc561b0cd64e | |
parent | 121089ced5e1d3f3103cbc2b37f5fb579d800915 (diff) | |
download | cgit-b60e6bff75719a5fb0df970bac3be6b2726cf73a.zip cgit-b60e6bff75719a5fb0df970bac3be6b2726cf73a.tar.gz |
Convert pager navigation into a unordered list
It is common practice and semantically appropriate to use unordered
lists for long navigation lists.
This also fixes the layout of very long pager navigations in
Webkit-based browsers.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
-rw-r--r-- | cgit.css | 14 | ||||
-rw-r--r-- | ui-log.c | 9 | ||||
-rw-r--r-- | ui-repolist.c | 6 |
3 files changed, 20 insertions, 9 deletions
@@ -538,17 +538,23 @@ div#cgit table.list td.sublevel-repo { | |||
538 | padding-left: 1.5em; | 538 | padding-left: 1.5em; |
539 | } | 539 | } |
540 | 540 | ||
541 | div#cgit div.pager { | 541 | div#cgit ul.pager { |
542 | list-style-type: none; | ||
542 | text-align: center; | 543 | text-align: center; |
543 | margin: 1em 0em 0em 0em; | 544 | margin: 1em 0em 0em 0em; |
545 | padding: 0; | ||
544 | } | 546 | } |
545 | 547 | ||
546 | div#cgit div.pager a { | 548 | div#cgit ul.pager li { |
549 | display: inline-block; | ||
550 | margin: 0.25em 0.5em; | ||
551 | } | ||
552 | |||
553 | div#cgit ul.pager a { | ||
547 | color: #777; | 554 | color: #777; |
548 | margin: 0em 0.5em; | ||
549 | } | 555 | } |
550 | 556 | ||
551 | div#cgit div.pager .current { | 557 | div#cgit ul.pager .current { |
552 | font-weight: bold; | 558 | font-weight: bold; |
553 | } | 559 | } |
554 | 560 | ||
@@ -405,21 +405,24 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern | |||
405 | commit->parents = NULL; | 405 | commit->parents = NULL; |
406 | } | 406 | } |
407 | if (pager) { | 407 | if (pager) { |
408 | html("</table><div class='pager'>"); | 408 | html("</table><ul class='pager'>"); |
409 | if (ofs > 0) { | 409 | if (ofs > 0) { |
410 | html("<li>"); | ||
410 | cgit_log_link("[prev]", NULL, NULL, ctx.qry.head, | 411 | cgit_log_link("[prev]", NULL, NULL, ctx.qry.head, |
411 | ctx.qry.sha1, ctx.qry.vpath, | 412 | ctx.qry.sha1, ctx.qry.vpath, |
412 | ofs - cnt, ctx.qry.grep, | 413 | ofs - cnt, ctx.qry.grep, |
413 | ctx.qry.search, ctx.qry.showmsg); | 414 | ctx.qry.search, ctx.qry.showmsg); |
414 | html(" "); | 415 | html("</li>"); |
415 | } | 416 | } |
416 | if ((commit = get_revision(&rev)) != NULL) { | 417 | if ((commit = get_revision(&rev)) != NULL) { |
418 | html("<li>"); | ||
417 | cgit_log_link("[next]", NULL, NULL, ctx.qry.head, | 419 | cgit_log_link("[next]", NULL, NULL, ctx.qry.head, |
418 | ctx.qry.sha1, ctx.qry.vpath, | 420 | ctx.qry.sha1, ctx.qry.vpath, |
419 | ofs + cnt, ctx.qry.grep, | 421 | ofs + cnt, ctx.qry.grep, |
420 | ctx.qry.search, ctx.qry.showmsg); | 422 | ctx.qry.search, ctx.qry.showmsg); |
423 | html("</li>"); | ||
421 | } | 424 | } |
422 | html("</div>"); | 425 | html("</ul>"); |
423 | } else if ((commit = get_revision(&rev)) != NULL) { | 426 | } else if ((commit = get_revision(&rev)) != NULL) { |
424 | htmlf("<tr class='nohover'><td colspan='%d'>", columns); | 427 | htmlf("<tr class='nohover'><td colspan='%d'>", columns); |
425 | cgit_log_link("[...]", NULL, NULL, ctx.qry.head, NULL, | 428 | cgit_log_link("[...]", NULL, NULL, ctx.qry.head, NULL, |
diff --git a/ui-repolist.c b/ui-repolist.c index 66c88c4..a9751f6 100644 --- a/ui-repolist.c +++ b/ui-repolist.c | |||
@@ -128,13 +128,15 @@ static void print_pager(int items, int pagelen, char *search, char *sort) | |||
128 | { | 128 | { |
129 | int i, ofs; | 129 | int i, ofs; |
130 | char *class = NULL; | 130 | char *class = NULL; |
131 | html("<div class='pager'>"); | 131 | html("<ul class='pager'>"); |
132 | for (i = 0, ofs = 0; ofs < items; i++, ofs = i * pagelen) { | 132 | for (i = 0, ofs = 0; ofs < items; i++, ofs = i * pagelen) { |
133 | class = (ctx.qry.ofs == ofs) ? "current" : NULL; | 133 | class = (ctx.qry.ofs == ofs) ? "current" : NULL; |
134 | html("<li>"); | ||
134 | cgit_index_link(fmt("[%d]", i + 1), fmt("Page %d", i + 1), | 135 | cgit_index_link(fmt("[%d]", i + 1), fmt("Page %d", i + 1), |
135 | class, search, sort, ofs); | 136 | class, search, sort, ofs); |
137 | html("</li>"); | ||
136 | } | 138 | } |
137 | html("</div>"); | 139 | html("</ul>"); |
138 | } | 140 | } |
139 | 141 | ||
140 | static int cmp(const char *s1, const char *s2) | 142 | static int cmp(const char *s1, const char *s2) |