-rw-r--r-- | ui-shared.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ui-shared.c b/ui-shared.c index 9319881..95dfeb4 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
@@ -276,17 +276,18 @@ void cgit_tree_link(char *name, char *title, char *class, char *head, | |||
276 | 276 | ||
277 | void cgit_plain_link(char *name, char *title, char *class, char *head, | 277 | void cgit_plain_link(char *name, char *title, char *class, char *head, |
278 | char *rev, char *path) | 278 | char *rev, char *path) |
279 | { | 279 | { |
280 | reporevlink("plain", name, title, class, head, rev, path); | 280 | reporevlink("plain", name, title, class, head, rev, path); |
281 | } | 281 | } |
282 | 282 | ||
283 | void cgit_log_link(char *name, char *title, char *class, char *head, | 283 | void cgit_log_link(char *name, char *title, char *class, char *head, |
284 | char *rev, char *path, int ofs, char *grep, char *pattern) | 284 | char *rev, char *path, int ofs, char *grep, char *pattern, |
285 | int showmsg) | ||
285 | { | 286 | { |
286 | char *delim; | 287 | char *delim; |
287 | 288 | ||
288 | delim = repolink(title, class, "log", head, path); | 289 | delim = repolink(title, class, "log", head, path); |
289 | if (rev && strcmp(rev, ctx.qry.head)) { | 290 | if (rev && strcmp(rev, ctx.qry.head)) { |
290 | html(delim); | 291 | html(delim); |
291 | html("id="); | 292 | html("id="); |
292 | html_url_arg(rev); | 293 | html_url_arg(rev); |
@@ -300,16 +301,21 @@ void cgit_log_link(char *name, char *title, char *class, char *head, | |||
300 | html(delim); | 301 | html(delim); |
301 | html("q="); | 302 | html("q="); |
302 | html_url_arg(pattern); | 303 | html_url_arg(pattern); |
303 | } | 304 | } |
304 | if (ofs > 0) { | 305 | if (ofs > 0) { |
305 | html(delim); | 306 | html(delim); |
306 | html("ofs="); | 307 | html("ofs="); |
307 | htmlf("%d", ofs); | 308 | htmlf("%d", ofs); |
309 | delim = "&"; | ||
310 | } | ||
311 | if (showmsg) { | ||
312 | html(delim); | ||
313 | html("showmsg=1"); | ||
308 | } | 314 | } |
309 | html("'>"); | 315 | html("'>"); |
310 | html_txt(name); | 316 | html_txt(name); |
311 | html("</a>"); | 317 | html("</a>"); |
312 | } | 318 | } |
313 | 319 | ||
314 | void cgit_commit_link(char *name, char *title, char *class, char *head, | 320 | void cgit_commit_link(char *name, char *title, char *class, char *head, |
315 | char *rev) | 321 | char *rev) |
@@ -565,16 +571,18 @@ void add_hidden_formfields(int incl_head, int incl_search, char *page) | |||
565 | if (incl_head && ctx.qry.head && ctx.repo->defbranch && | 571 | if (incl_head && ctx.qry.head && ctx.repo->defbranch && |
566 | strcmp(ctx.qry.head, ctx.repo->defbranch)) | 572 | strcmp(ctx.qry.head, ctx.repo->defbranch)) |
567 | html_hidden("h", ctx.qry.head); | 573 | html_hidden("h", ctx.qry.head); |
568 | 574 | ||
569 | if (ctx.qry.sha1) | 575 | if (ctx.qry.sha1) |
570 | html_hidden("id", ctx.qry.sha1); | 576 | html_hidden("id", ctx.qry.sha1); |
571 | if (ctx.qry.sha2) | 577 | if (ctx.qry.sha2) |
572 | html_hidden("id2", ctx.qry.sha2); | 578 | html_hidden("id2", ctx.qry.sha2); |
579 | if (ctx.qry.showmsg) | ||
580 | html_hidden("showmsg", "1"); | ||
573 | 581 | ||
574 | if (incl_search) { | 582 | if (incl_search) { |
575 | if (ctx.qry.grep) | 583 | if (ctx.qry.grep) |
576 | html_hidden("qt", ctx.qry.grep); | 584 | html_hidden("qt", ctx.qry.grep); |
577 | if (ctx.qry.search) | 585 | if (ctx.qry.search) |
578 | html_hidden("q", ctx.qry.search); | 586 | html_hidden("q", ctx.qry.search); |
579 | } | 587 | } |
580 | } | 588 | } |
@@ -631,17 +639,17 @@ void cgit_print_pageheader(struct cgit_context *ctx) | |||
631 | 639 | ||
632 | html("<table class='tabs'><tr><td>\n"); | 640 | html("<table class='tabs'><tr><td>\n"); |
633 | if (ctx->repo) { | 641 | if (ctx->repo) { |
634 | cgit_summary_link("summary", NULL, hc(cmd, "summary"), | 642 | cgit_summary_link("summary", NULL, hc(cmd, "summary"), |
635 | ctx->qry.head); | 643 | ctx->qry.head); |
636 | cgit_refs_link("refs", NULL, hc(cmd, "refs"), ctx->qry.head, | 644 | cgit_refs_link("refs", NULL, hc(cmd, "refs"), ctx->qry.head, |
637 | ctx->qry.sha1, NULL); | 645 | ctx->qry.sha1, NULL); |
638 | cgit_log_link("log", NULL, hc(cmd, "log"), ctx->qry.head, | 646 | cgit_log_link("log", NULL, hc(cmd, "log"), ctx->qry.head, |
639 | NULL, NULL, 0, NULL, NULL); | 647 | NULL, NULL, 0, NULL, NULL, ctx->qry.showmsg); |
640 | cgit_tree_link("tree", NULL, hc(cmd, "tree"), ctx->qry.head, | 648 | cgit_tree_link("tree", NULL, hc(cmd, "tree"), ctx->qry.head, |
641 | ctx->qry.sha1, NULL); | 649 | ctx->qry.sha1, NULL); |
642 | cgit_commit_link("commit", NULL, hc(cmd, "commit"), | 650 | cgit_commit_link("commit", NULL, hc(cmd, "commit"), |
643 | ctx->qry.head, ctx->qry.sha1); | 651 | ctx->qry.head, ctx->qry.sha1); |
644 | cgit_diff_link("diff", NULL, hc(cmd, "diff"), ctx->qry.head, | 652 | cgit_diff_link("diff", NULL, hc(cmd, "diff"), ctx->qry.head, |
645 | ctx->qry.sha1, ctx->qry.sha2, NULL); | 653 | ctx->qry.sha1, ctx->qry.sha2, NULL); |
646 | if (ctx->repo->readme) | 654 | if (ctx->repo->readme) |
647 | reporevlink("about", "about", NULL, | 655 | reporevlink("about", "about", NULL, |