summaryrefslogtreecommitdiffabout
path: root/ui-shared.c
authorLars Hjemli <hjemli@gmail.com>2008-04-28 22:55:34 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2008-04-28 22:55:34 (UTC)
commit4c9916043d6aabb8278e0d78f5fa71a59f82889d (patch) (unidiff)
tree02259d3ef9c31379c2733d1944412a9015e2f311 /ui-shared.c
parent8062817885495b07cf70304c484e8f18c78ab2b5 (diff)
downloadcgit-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>
Diffstat (limited to 'ui-shared.c') (more/less context) (ignore whitespace changes)
-rw-r--r--ui-shared.c5
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
@@ -497,33 +497,36 @@ void cgit_print_pageheader(struct cgit_context *ctx)
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,