summaryrefslogtreecommitdiffabout
path: root/ui-shared.c
authorLars Hjemli <hjemli@gmail.com>2007-11-03 09:42:37 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2007-11-03 09:42:37 (UTC)
commit51140311bb3b0d4d0e859d5045ffe4c74478f5fe (patch) (unidiff)
tree6575f174e32abd5f5d1f481e5f7f5978525ae416 /ui-shared.c
parentdf203a293e3ac19245f8761cf7c5808f8735f917 (diff)
downloadcgit-51140311bb3b0d4d0e859d5045ffe4c74478f5fe.zip
cgit-51140311bb3b0d4d0e859d5045ffe4c74478f5fe.tar.gz
cgit-51140311bb3b0d4d0e859d5045ffe4c74478f5fe.tar.bz2
Add search parameters to cgit_log_link
This makes the [prev] and [next] links work correctly on search results. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'ui-shared.c') (more/less context) (ignore whitespace changes)
-rw-r--r--ui-shared.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/ui-shared.c b/ui-shared.c
index 1d66940..a03661a 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -191,23 +191,32 @@ void cgit_tree_link(char *name, char *title, char *class, char *head,
191 char *rev, char *path) 191 char *rev, char *path)
192{ 192{
193 reporevlink("tree", name, title, class, head, rev, path); 193 reporevlink("tree", name, title, class, head, rev, path);
194} 194}
195 195
196void cgit_log_link(char *name, char *title, char *class, char *head, 196void cgit_log_link(char *name, char *title, char *class, char *head,
197 char *rev, char *path, int ofs) 197 char *rev, char *path, int ofs, char *grep, char *pattern)
198{ 198{
199 char *delim; 199 char *delim;
200 200
201 delim = repolink(title, class, "log", head, path); 201 delim = repolink(title, class, "log", head, path);
202 if (rev && strcmp(rev, cgit_query_head)) { 202 if (rev && strcmp(rev, cgit_query_head)) {
203 html(delim); 203 html(delim);
204 html("id="); 204 html("id=");
205 html_attr(rev); 205 html_attr(rev);
206 delim = "&"; 206 delim = "&";
207 } 207 }
208 if (grep && pattern) {
209 html(delim);
210 html("qt=");
211 html_attr(grep);
212 delim = "&";
213 html(delim);
214 html("q=");
215 html_attr(pattern);
216 }
208 if (ofs > 0) { 217 if (ofs > 0) {
209 html(delim); 218 html(delim);
210 html("ofs="); 219 html("ofs=");
211 htmlf("%d", ofs); 220 htmlf("%d", ofs);
212 } 221 }
213 html("'>"); 222 html("'>");
@@ -458,13 +467,13 @@ void cgit_print_pageheader(char *title, int show_search)
458 html_txt(cgit_repo->owner); 467 html_txt(cgit_repo->owner);
459 } 468 }
460 html("<p>\n<h1>navigate</h1>\n"); 469 html("<p>\n<h1>navigate</h1>\n");
461 reporevlink(NULL, "summary", NULL, "menu", cgit_query_head, 470 reporevlink(NULL, "summary", NULL, "menu", cgit_query_head,
462 NULL, NULL); 471 NULL, NULL);
463 cgit_log_link("log", NULL, "menu", cgit_query_head, 472 cgit_log_link("log", NULL, "menu", cgit_query_head,
464 cgit_query_sha1, cgit_query_path, 0); 473 cgit_query_sha1, cgit_query_path, 0, NULL, NULL);
465 cgit_tree_link("tree", NULL, "menu", cgit_query_head, 474 cgit_tree_link("tree", NULL, "menu", cgit_query_head,
466 cgit_query_sha1, NULL); 475 cgit_query_sha1, NULL);
467 cgit_commit_link("commit", NULL, "menu", cgit_query_head, 476 cgit_commit_link("commit", NULL, "menu", cgit_query_head,
468 cgit_query_sha1); 477 cgit_query_sha1);
469 cgit_diff_link("diff", NULL, "menu", cgit_query_head, 478 cgit_diff_link("diff", NULL, "menu", cgit_query_head,
470 cgit_query_sha1, cgit_query_sha2, 479 cgit_query_sha1, cgit_query_sha2,