diff options
Diffstat (limited to 'ui-shared.c')
-rw-r--r-- | ui-shared.c | 83 |
1 files changed, 42 insertions, 41 deletions
diff --git a/ui-shared.c b/ui-shared.c index d3e6488..968933f 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
@@ -425,58 +425,59 @@ static void cgit_self_link(char *name, const char *title, const char *class, | |||
425 | struct cgit_context *ctx) | 425 | struct cgit_context *ctx) |
426 | { | 426 | { |
427 | if (!strcmp(ctx->qry.page, "repolist")) | 427 | if (!strcmp(ctx->qry.page, "repolist")) |
428 | return cgit_index_link(name, title, class, ctx->qry.search, ctx->qry.sort, | 428 | cgit_index_link(name, title, class, ctx->qry.search, ctx->qry.sort, |
429 | ctx->qry.ofs); | 429 | ctx->qry.ofs); |
430 | else if (!strcmp(ctx->qry.page, "summary")) | 430 | else if (!strcmp(ctx->qry.page, "summary")) |
431 | return cgit_summary_link(name, title, class, ctx->qry.head); | 431 | cgit_summary_link(name, title, class, ctx->qry.head); |
432 | else if (!strcmp(ctx->qry.page, "tag")) | 432 | else if (!strcmp(ctx->qry.page, "tag")) |
433 | return cgit_tag_link(name, title, class, ctx->qry.head, | 433 | cgit_tag_link(name, title, class, ctx->qry.head, |
434 | ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL); | 434 | ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL); |
435 | else if (!strcmp(ctx->qry.page, "tree")) | 435 | else if (!strcmp(ctx->qry.page, "tree")) |
436 | return cgit_tree_link(name, title, class, ctx->qry.head, | 436 | cgit_tree_link(name, title, class, ctx->qry.head, |
437 | ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL, | 437 | ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL, |
438 | ctx->qry.path); | 438 | ctx->qry.path); |
439 | else if (!strcmp(ctx->qry.page, "plain")) | 439 | else if (!strcmp(ctx->qry.page, "plain")) |
440 | return cgit_plain_link(name, title, class, ctx->qry.head, | 440 | cgit_plain_link(name, title, class, ctx->qry.head, |
441 | ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL, | 441 | ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL, |
442 | ctx->qry.path); | 442 | ctx->qry.path); |
443 | else if (!strcmp(ctx->qry.page, "log")) | 443 | else if (!strcmp(ctx->qry.page, "log")) |
444 | return cgit_log_link(name, title, class, ctx->qry.head, | 444 | cgit_log_link(name, title, class, ctx->qry.head, |
445 | ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL, | 445 | ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL, |
446 | ctx->qry.path, ctx->qry.ofs, | 446 | ctx->qry.path, ctx->qry.ofs, |
447 | ctx->qry.grep, ctx->qry.search, | 447 | ctx->qry.grep, ctx->qry.search, |
448 | ctx->qry.showmsg); | 448 | ctx->qry.showmsg); |
449 | else if (!strcmp(ctx->qry.page, "commit")) | 449 | else if (!strcmp(ctx->qry.page, "commit")) |
450 | return cgit_commit_link(name, title, class, ctx->qry.head, | 450 | cgit_commit_link(name, title, class, ctx->qry.head, |
451 | ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL, | 451 | ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL, |
452 | ctx->qry.path, 0); | 452 | ctx->qry.path, 0); |
453 | else if (!strcmp(ctx->qry.page, "patch")) | 453 | else if (!strcmp(ctx->qry.page, "patch")) |
454 | return cgit_patch_link(name, title, class, ctx->qry.head, | 454 | cgit_patch_link(name, title, class, ctx->qry.head, |
455 | ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL, | 455 | ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL, |
456 | ctx->qry.path); | 456 | ctx->qry.path); |
457 | else if (!strcmp(ctx->qry.page, "refs")) | 457 | else if (!strcmp(ctx->qry.page, "refs")) |
458 | return cgit_refs_link(name, title, class, ctx->qry.head, | 458 | cgit_refs_link(name, title, class, ctx->qry.head, |
459 | ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL, | 459 | ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL, |
460 | ctx->qry.path); | 460 | ctx->qry.path); |
461 | else if (!strcmp(ctx->qry.page, "snapshot")) | 461 | else if (!strcmp(ctx->qry.page, "snapshot")) |
462 | return cgit_snapshot_link(name, title, class, ctx->qry.head, | 462 | cgit_snapshot_link(name, title, class, ctx->qry.head, |
463 | ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL, | 463 | ctx->qry.has_sha1 ? ctx->qry.sha1 : NULL, |
464 | ctx->qry.path); | 464 | ctx->qry.path); |
465 | else if (!strcmp(ctx->qry.page, "diff")) | 465 | else if (!strcmp(ctx->qry.page, "diff")) |
466 | return cgit_diff_link(name, title, class, ctx->qry.head, | 466 | cgit_diff_link(name, title, class, ctx->qry.head, |
467 | ctx->qry.sha1, ctx->qry.sha2, | 467 | ctx->qry.sha1, ctx->qry.sha2, |
468 | ctx->qry.path, 0); | 468 | ctx->qry.path, 0); |
469 | else if (!strcmp(ctx->qry.page, "stats")) | 469 | else if (!strcmp(ctx->qry.page, "stats")) |
470 | return cgit_stats_link(name, title, class, ctx->qry.head, | 470 | cgit_stats_link(name, title, class, ctx->qry.head, |
471 | ctx->qry.path); | 471 | ctx->qry.path); |
472 | 472 | else { | |
473 | /* Don't known how to make link for this page */ | 473 | /* Don't known how to make link for this page */ |
474 | repolink(title, class, ctx->qry.page, ctx->qry.head, ctx->qry.path); | 474 | repolink(title, class, ctx->qry.page, ctx->qry.head, ctx->qry.path); |
475 | html("><!-- cgit_self_link() doesn't know how to make link for page '"); | 475 | html("><!-- cgit_self_link() doesn't know how to make link for page '"); |
476 | html_txt(ctx->qry.page); | 476 | html_txt(ctx->qry.page); |
477 | html("' -->"); | 477 | html("' -->"); |
478 | html_txt(name); | 478 | html_txt(name); |
479 | html("</a>"); | 479 | html("</a>"); |
480 | } | ||
480 | } | 481 | } |
481 | 482 | ||
482 | void cgit_object_link(struct object *obj) | 483 | void cgit_object_link(struct object *obj) |