author | Lars Hjemli <hjemli@gmail.com> | 2008-04-28 22:55:34 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2008-04-28 22:55:34 (UTC) |
commit | 4c9916043d6aabb8278e0d78f5fa71a59f82889d (patch) (unidiff) | |
tree | 02259d3ef9c31379c2733d1944412a9015e2f311 /ui-shared.c | |
parent | 8062817885495b07cf70304c484e8f18c78ab2b5 (diff) | |
download | cgit-4c9916043d6aabb8278e0d78f5fa71a59f82889d.zip cgit-4c9916043d6aabb8278e0d78f5fa71a59f82889d.tar.gz cgit-4c9916043d6aabb8278e0d78f5fa71a59f82889d.tar.bz2 |
Re-enable 'index-info' and add support for 'root-desc' in cgitrc
The 'index-info' option got lost when the layout was converted from
sidebar to old-fashioned header (noticed by Harley Laue, thanks!), and
this commit re-enables it.
But there is now also an alternative in the 'root-desc' option; where
'index-info' specifies a file to include, 'root-desc' specifies the text
literally. This might be nicer for the one-liner descriptions which these
options typically provides.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | ui-shared.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ui-shared.c b/ui-shared.c index 8a804c2..83758f7 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
@@ -481,65 +481,68 @@ void cgit_print_pageheader(struct cgit_context *ctx) | |||
481 | if (ctx->cfg.logo_link) | 481 | if (ctx->cfg.logo_link) |
482 | html_attr(ctx->cfg.logo_link); | 482 | html_attr(ctx->cfg.logo_link); |
483 | else | 483 | else |
484 | html_attr(cgit_rooturl()); | 484 | html_attr(cgit_rooturl()); |
485 | html("'><img src='"); | 485 | html("'><img src='"); |
486 | html_attr(ctx->cfg.logo); | 486 | html_attr(ctx->cfg.logo); |
487 | html("' alt='cgit logo'/></a></td>\n"); | 487 | html("' alt='cgit logo'/></a></td>\n"); |
488 | 488 | ||
489 | html("<td class='main'>"); | 489 | html("<td class='main'>"); |
490 | if (ctx->repo) { | 490 | if (ctx->repo) { |
491 | reporevlink(NULL, ctx->repo->name, NULL, hc(cmd, "summary"), | 491 | reporevlink(NULL, ctx->repo->name, NULL, hc(cmd, "summary"), |
492 | ctx->qry.head, NULL, NULL); | 492 | ctx->qry.head, NULL, NULL); |
493 | html(" : "); | 493 | html(" : "); |
494 | html_txt(ctx->qry.page); | 494 | html_txt(ctx->qry.page); |
495 | html("</td><td class='form'>"); | 495 | html("</td><td class='form'>"); |
496 | html("<form method='get' action=''>\n"); | 496 | html("<form method='get' action=''>\n"); |
497 | add_hidden_formfields(0, 1, ctx->qry.page); | 497 | add_hidden_formfields(0, 1, ctx->qry.page); |
498 | html("<select name='h' onchange='this.form.submit();'>\n"); | 498 | html("<select name='h' onchange='this.form.submit();'>\n"); |
499 | for_each_branch_ref(print_branch_option, ctx->qry.head); | 499 | for_each_branch_ref(print_branch_option, ctx->qry.head); |
500 | html("</select> "); | 500 | html("</select> "); |
501 | html("<input type='submit' name='' value='switch'/>"); | 501 | html("<input type='submit' name='' value='switch'/>"); |
502 | html("</form>"); | 502 | html("</form>"); |
503 | } else | 503 | } else |
504 | html_txt(ctx->cfg.root_title); | 504 | html_txt(ctx->cfg.root_title); |
505 | html("</td></tr>\n"); | 505 | html("</td></tr>\n"); |
506 | 506 | ||
507 | html("<tr><td class='sub'"); | 507 | html("<tr><td class='sub'"); |
508 | if (ctx->repo) { | 508 | if (ctx->repo) { |
509 | html(" colspan='2'>"); | 509 | html(" colspan='2'>"); |
510 | html_txt(ctx->repo->desc); | 510 | html_txt(ctx->repo->desc); |
511 | } else { | 511 | } else { |
512 | html(">"); | 512 | html(">"); |
513 | html_txt("a fast webinterface for the git dscm"); | 513 | if (ctx->cfg.root_desc) |
514 | html_txt(ctx->cfg.root_desc); | ||
515 | else if (ctx->cfg.index_info) | ||
516 | html_include(ctx->cfg.index_info); | ||
514 | } | 517 | } |
515 | html("</td></tr></table>\n"); | 518 | html("</td></tr></table>\n"); |
516 | 519 | ||
517 | html("<table class='tabs'><tr><td>\n"); | 520 | html("<table class='tabs'><tr><td>\n"); |
518 | if (ctx->repo) { | 521 | if (ctx->repo) { |
519 | reporevlink(NULL, "summary", NULL, hc(cmd, "summary"), | 522 | reporevlink(NULL, "summary", NULL, hc(cmd, "summary"), |
520 | ctx->qry.head, NULL, NULL); | 523 | ctx->qry.head, NULL, NULL); |
521 | cgit_refs_link("refs", NULL, hc(cmd, "refs"), ctx->qry.head, | 524 | cgit_refs_link("refs", NULL, hc(cmd, "refs"), ctx->qry.head, |
522 | ctx->qry.sha1, NULL); | 525 | ctx->qry.sha1, NULL); |
523 | cgit_log_link("log", NULL, hc(cmd, "log"), ctx->qry.head, | 526 | cgit_log_link("log", NULL, hc(cmd, "log"), ctx->qry.head, |
524 | NULL, NULL, 0, NULL, NULL); | 527 | NULL, NULL, 0, NULL, NULL); |
525 | cgit_tree_link("tree", NULL, hc(cmd, "tree"), ctx->qry.head, | 528 | cgit_tree_link("tree", NULL, hc(cmd, "tree"), ctx->qry.head, |
526 | ctx->qry.sha1, NULL); | 529 | ctx->qry.sha1, NULL); |
527 | cgit_commit_link("commit", NULL, hc(cmd, "commit"), | 530 | cgit_commit_link("commit", NULL, hc(cmd, "commit"), |
528 | ctx->qry.head, ctx->qry.sha1); | 531 | ctx->qry.head, ctx->qry.sha1); |
529 | cgit_diff_link("diff", NULL, hc(cmd, "diff"), ctx->qry.head, | 532 | cgit_diff_link("diff", NULL, hc(cmd, "diff"), ctx->qry.head, |
530 | ctx->qry.sha1, ctx->qry.sha2, NULL); | 533 | ctx->qry.sha1, ctx->qry.sha2, NULL); |
531 | html("</td><td class='form'>"); | 534 | html("</td><td class='form'>"); |
532 | html("<form class='right' method='get' action='"); | 535 | html("<form class='right' method='get' action='"); |
533 | if (ctx->cfg.virtual_root) | 536 | if (ctx->cfg.virtual_root) |
534 | html_attr(cgit_fileurl(ctx->qry.repo, "log", | 537 | html_attr(cgit_fileurl(ctx->qry.repo, "log", |
535 | ctx->qry.path, NULL)); | 538 | ctx->qry.path, NULL)); |
536 | html("'>\n"); | 539 | html("'>\n"); |
537 | add_hidden_formfields(1, 0, "log"); | 540 | add_hidden_formfields(1, 0, "log"); |
538 | html("<select name='qt'>\n"); | 541 | html("<select name='qt'>\n"); |
539 | html_option("grep", "log msg", ctx->qry.grep); | 542 | html_option("grep", "log msg", ctx->qry.grep); |
540 | html_option("author", "author", ctx->qry.grep); | 543 | html_option("author", "author", ctx->qry.grep); |
541 | html_option("committer", "committer", ctx->qry.grep); | 544 | html_option("committer", "committer", ctx->qry.grep); |
542 | html("</select>\n"); | 545 | html("</select>\n"); |
543 | html("<input class='txt' type='text' size='10' name='q' value='"); | 546 | html("<input class='txt' type='text' size='10' name='q' value='"); |
544 | html_attr(ctx->qry.search); | 547 | html_attr(ctx->qry.search); |
545 | html("'/>\n"); | 548 | html("'/>\n"); |