about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorLukas Fleischer2013-03-07 08:56:22 +0100
committerJason A. Donenfeld2013-03-20 21:16:19 +0100
commitb60e6bff75719a5fb0df970bac3be6b2726cf73a (patch)
tree706c27228919f3cca2d307b1d3dfcc561b0cd64e
parentMakefile: remove CGIT-CFLAGS files in clean stage (diff)
downloadcgit-b60e6bff75719a5fb0df970bac3be6b2726cf73a.tar.gz
cgit-b60e6bff75719a5fb0df970bac3be6b2726cf73a.zip
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.css14
-rw-r--r--ui-log.c9
-rw-r--r--ui-repolist.c6
3 files changed, 20 insertions, 9 deletions
diff --git a/cgit.css b/cgit.css index 54da076..a50d62b 100644 --- a/cgit.css +++ b/cgit.css
@@ -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
541div#cgit div.pager { 541div#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
546div#cgit div.pager a { 548div#cgit ul.pager li {
549 display: inline-block;
550 margin: 0.25em 0.5em;
551}
552
553div#cgit ul.pager a {
547 color: #777; 554 color: #777;
548 margin: 0em 0.5em;
549} 555}
550 556
551div#cgit div.pager .current { 557div#cgit ul.pager .current {
552 font-weight: bold; 558 font-weight: bold;
553} 559}
554 560
diff --git a/ui-log.c b/ui-log.c index 954d3e1..aaffb4e 100644 --- a/ui-log.c +++ b/ui-log.c
@@ -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("&nbsp;"); 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
140static int cmp(const char *s1, const char *s2) 142static int cmp(const char *s1, const char *s2)