diff options
author | Tobias Grimm <git@e-tobi.net> | 2011-07-31 09:44:05 (JST) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2012-01-04 00:20:17 (JST) |
commit | 7530d94f05887b8065742adb614c368d8568a22c (patch) | |
tree | 7364cde2e397b40d84153a1527e50e863b69d69b /ui-repolist.c | |
parent | e19f7d7180d64c8ba9ca15f5fe164606f0ec88c1 (diff) | |
download | cgit-7530d94f05887b8065742adb614c368d8568a22c.zip cgit-7530d94f05887b8065742adb614c368d8568a22c.tar.gz |
Add sort parameter to pager of repo list
When the repolist is paged, the page-links are missing the sort parameter,
causing the initial page to be custom sorted, but any clicked page will
then be with the default sort order again.
Diffstat (limited to 'ui-repolist.c')
-rw-r--r-- | ui-repolist.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ui-repolist.c b/ui-repolist.c index e138f59..4b21e2f 100644 --- a/ui-repolist.c +++ b/ui-repolist.c | |||
@@ -109,13 +109,13 @@ void print_header(int columns) | |||
109 | } | 109 | } |
110 | 110 | ||
111 | 111 | ||
112 | void print_pager(int items, int pagelen, char *search) | 112 | void print_pager(int items, int pagelen, char *search, char *sort) |
113 | { | 113 | { |
114 | int i; | 114 | int i; |
115 | html("<div class='pager'>"); | 115 | html("<div class='pager'>"); |
116 | for(i = 0; i * pagelen < items; i++) | 116 | for(i = 0; i * pagelen < items; i++) |
117 | cgit_index_link(fmt("[%d]", i+1), fmt("Page %d", i+1), NULL, | 117 | cgit_index_link(fmt("[%d]", i+1), fmt("Page %d", i+1), NULL, |
118 | search, i * pagelen); | 118 | search, sort, i * pagelen); |
119 | html("</div>"); | 119 | html("</div>"); |
120 | } | 120 | } |
121 | 121 | ||
@@ -282,7 +282,7 @@ void cgit_print_repolist() | |||
282 | if (!hits) | 282 | if (!hits) |
283 | cgit_print_error("No repositories found"); | 283 | cgit_print_error("No repositories found"); |
284 | else if (hits > ctx.cfg.max_repo_count) | 284 | else if (hits > ctx.cfg.max_repo_count) |
285 | print_pager(hits, ctx.cfg.max_repo_count, ctx.qry.search); | 285 | print_pager(hits, ctx.cfg.max_repo_count, ctx.qry.search, ctx.qry.sort); |
286 | cgit_print_docend(); | 286 | cgit_print_docend(); |
287 | } | 287 | } |
288 | 288 | ||