diff options
author | Jamie Couture | 2012-10-08 12:49:34 -0400 |
---|---|---|
committer | Jason A. Donenfeld | 2012-10-08 23:29:29 +0200 |
commit | 4675b91211fe3119a0def539521ac759b3fb57d0 (patch) | |
tree | 152e484c6a598a4e4d16c80cee0ce5975cfa7042 | |
parent | do not write outside heap buffer (diff) | |
download | cgit-4675b91211fe3119a0def539521ac759b3fb57d0.tar.gz cgit-4675b91211fe3119a0def539521ac759b3fb57d0.zip |
ui-repolist: Bold the currently viewed page.
Signed-off-by: Jamie Couture <jamie.couture@gmail.com>
-rw-r--r-- | cgit.css | 4 | ||||
-rw-r--r-- | ui-repolist.c | 11 |
2 files changed, 11 insertions, 4 deletions
diff --git a/cgit.css b/cgit.css index 651a320..54da076 100644 --- a/cgit.css +++ b/cgit.css | |||
@@ -548,6 +548,10 @@ div#cgit div.pager a { | |||
548 | margin: 0em 0.5em; | 548 | margin: 0em 0.5em; |
549 | } | 549 | } |
550 | 550 | ||
551 | div#cgit div.pager .current { | ||
552 | font-weight: bold; | ||
553 | } | ||
554 | |||
551 | div#cgit span.age-mins { | 555 | div#cgit span.age-mins { |
552 | font-weight: bold; | 556 | font-weight: bold; |
553 | color: #080; | 557 | color: #080; |
diff --git a/ui-repolist.c b/ui-repolist.c index 943eaab..46cbacf 100644 --- a/ui-repolist.c +++ b/ui-repolist.c | |||
@@ -123,11 +123,14 @@ void print_header(int columns) | |||
123 | 123 | ||
124 | void print_pager(int items, int pagelen, char *search, char *sort) | 124 | void print_pager(int items, int pagelen, char *search, char *sort) |
125 | { | 125 | { |
126 | int i; | 126 | int i, ofs; |
127 | char *class = NULL; | ||
127 | html("<div class='pager'>"); | 128 | html("<div class='pager'>"); |
128 | for(i = 0; i * pagelen < items; i++) | 129 | for(i = 0, ofs = 0; ofs < items; i++, ofs = i * pagelen) { |
129 | cgit_index_link(fmt("[%d]", i+1), fmt("Page %d", i+1), NULL, | 130 | class = (ctx.qry.ofs == ofs) ? "current" : NULL; |
130 | search, sort, i * pagelen); | 131 | cgit_index_link(fmt("[%d]", i+1), fmt("Page %d", i+1), class, |
132 | search, sort, ofs); | ||
133 | } | ||
131 | html("</div>"); | 134 | html("</div>"); |
132 | } | 135 | } |
133 | 136 | ||