summaryrefslogtreecommitdiffabout
path: root/ui-shared.c
Unidiff
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
@@ -185,35 +185,44 @@ static void reporevlink(char *page, char *name, char *title, char *class,
185 html("'>"); 185 html("'>");
186 html_txt(name); 186 html_txt(name);
187 html("</a>"); 187 html("</a>");
188} 188}
189 189
190void cgit_tree_link(char *name, char *title, char *class, char *head, 190void 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("'>");
214 html_txt(name); 223 html_txt(name);
215 html("</a>"); 224 html("</a>");
216} 225}
217 226
218void cgit_commit_link(char *name, char *title, char *class, char *head, 227void cgit_commit_link(char *name, char *title, char *class, char *head,
219 char *rev) 228 char *rev)
@@ -452,25 +461,25 @@ void cgit_print_pageheader(char *title, int show_search)
452 html("<h1>"); 461 html("<h1>");
453 html_txt(strrpart(cgit_repo->name, 20)); 462 html_txt(strrpart(cgit_repo->name, 20));
454 html("</h1>\n"); 463 html("</h1>\n");
455 html_txt(cgit_repo->desc); 464 html_txt(cgit_repo->desc);
456 if (cgit_repo->owner) { 465 if (cgit_repo->owner) {
457 html("<p>\n<h1>owner</h1>\n"); 466 html("<p>\n<h1>owner</h1>\n");
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,
471 cgit_query_path); 480 cgit_query_path);
472 481
473 for_each_ref(print_archive_ref, &header); 482 for_each_ref(print_archive_ref, &header);
474 483
475 html("<p>\n<h1>branch</h1>\n"); 484 html("<p>\n<h1>branch</h1>\n");
476 html("<form method='get' action=''>\n"); 485 html("<form method='get' action=''>\n");