aboutsummaryrefslogtreecommitdiffstats
path: root/ui-repolist.c
diff options
context:
space:
mode:
authorTobias Grimm <git@e-tobi.net>2011-07-31 02:44:05 +0200
committerLars Hjemli <hjemli@gmail.com>2012-01-03 15:20:17 +0000
commit7530d94f05887b8065742adb614c368d8568a22c (patch)
tree7364cde2e397b40d84153a1527e50e863b69d69b /ui-repolist.c
parentui-ssdiff: move LCS table away from the stack (diff)
downloadcgit-7530d94f05887b8065742adb614c368d8568a22c.tar.xz
cgit-7530d94f05887b8065742adb614c368d8568a22c.zip
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 '')
-rw-r--r--ui-repolist.c6
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)
}
-void print_pager(int items, int pagelen, char *search)
+void print_pager(int items, int pagelen, char *search, char *sort)
{
int i;
html("<div class='pager'>");
for(i = 0; i * pagelen < items; i++)
cgit_index_link(fmt("[%d]", i+1), fmt("Page %d", i+1), NULL,
- search, i * pagelen);
+ search, sort, i * pagelen);
html("</div>");
}
@@ -282,7 +282,7 @@ void cgit_print_repolist()
if (!hits)
cgit_print_error("No repositories found");
else if (hits > ctx.cfg.max_repo_count)
- print_pager(hits, ctx.cfg.max_repo_count, ctx.qry.search);
+ print_pager(hits, ctx.cfg.max_repo_count, ctx.qry.search, ctx.qry.sort);
cgit_print_docend();
}