aboutsummaryrefslogtreecommitdiffstats
path: root/ui-shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-shared.c')
-rw-r--r--ui-shared.c65
1 files changed, 50 insertions, 15 deletions
diff --git a/ui-shared.c b/ui-shared.c
index 73e3d4c..782caa7 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -389,7 +389,7 @@ void cgit_print_docstart(struct cgit_context *ctx)
389 389
390void cgit_print_docend() 390void cgit_print_docend()
391{ 391{
392 html("</td>\n</tr>\n</table>\n</body>\n</html>\n"); 392 html("</div>\n</body>\n</html>\n");
393} 393}
394 394
395int print_branch_option(const char *refname, const unsigned char *sha1, 395int print_branch_option(const char *refname, const unsigned char *sha1,
@@ -485,21 +485,46 @@ void cgit_print_pageheader(struct cgit_context *ctx)
485 html("'><img src='"); 485 html("'><img src='");
486 html_attr(ctx->cfg.logo); 486 html_attr(ctx->cfg.logo);
487 html("'/></a></td>\n"); 487 html("'/></a></td>\n");
488
488 html("<td class='main'>"); 489 html("<td class='main'>");
489 if (ctx->repo) { 490 if (ctx->repo) {
491/*
490 html("<a href='"); 492 html("<a href='");
491 html_attr(cgit_rooturl()); 493 html_attr(cgit_rooturl());
492 html("'>index</a> / "); 494 html("'>index</a> : ");
493 html_txt(ctx->repo->name); 495*/
496 reporevlink(NULL, ctx->repo->name, NULL, hc(cmd, "summary"),
497 ctx->qry.head, NULL, NULL);
498 html(" : ");
499 html_txt(ctx->qry.page);
500 html("</td><td class='form'>");
501 html("<form method='get' action=''>\n");
502 add_hidden_formfields(0, 1, ctx->qry.page);
503 html("<select name='h' onchange='this.form.submit();'>\n");
504 for_each_branch_ref(print_branch_option, ctx->qry.head);
505 html("</select> ");
506 html("<input type='submit' name='' value='switch'/>");
507 html("</form>");
494 } else 508 } else
495 html_txt(ctx->cfg.root_title); 509 html_txt(ctx->cfg.root_title);
496 html("</td></tr>\n"); 510 html("</td>\n");
497 html("<tr><td class='sub'>"); 511
498 if (ctx->repo) 512 html("<tr><td class='sub'");
513 if (ctx->repo) {
514 html(" colspan='2'>");
499 html_txt(ctx->repo->desc); 515 html_txt(ctx->repo->desc);
500 else 516 }
501 html_txt(ctx->cfg.index_info); 517/*
518 else if (ctx->cfg.root_subtitle)
519 html_txt(ctx->cfg.root_subtitle);
520*/
521 else {
522 html(">");
523 html_txt("a fast webinterface for the git dscm");
524 }
502 html("</td></tr>\n"); 525 html("</td></tr>\n");
526
527 html("</tr>\n");
503 html("</table>\n"); 528 html("</table>\n");
504 529
505 html("<table class='tabs'><tr><td>\n"); 530 html("<table class='tabs'><tr><td>\n");
@@ -518,13 +543,23 @@ void cgit_print_pageheader(struct cgit_context *ctx)
518 ctx->qry.sha1, ctx->qry.sha2, NULL); 543 ctx->qry.sha1, ctx->qry.sha2, NULL);
519 cgit_patch_link("patch", NULL, hc(cmd, "patch"), ctx->qry.head, 544 cgit_patch_link("patch", NULL, hc(cmd, "patch"), ctx->qry.head,
520 ctx->qry.sha1); 545 ctx->qry.sha1);
521 html("</td><td class='branch'>"); 546 html("</td><td class='form'>");
522 html("<form method='get' action=''>\n"); 547 html("<form class='right' method='get' action='");
523 add_hidden_formfields(0, 1, ctx->qry.page); 548 if (ctx->cfg.virtual_root)
524 html("<select name='h' onchange='this.form.submit();'>\n"); 549 html_attr(cgit_fileurl(ctx->qry.repo, "log",
525 for_each_branch_ref(print_branch_option, ctx->qry.head); 550 ctx->qry.path, NULL));
526 html("</select> "); 551 html("'>\n");
527 html("<input type='submit' name='' value='switch'/>"); 552 add_hidden_formfields(1, 0, "log");
553 html("<select name='qt'>\n");
554 html_option("grep", "log msg", ctx->qry.grep);
555 html_option("author", "author", ctx->qry.grep);
556 html_option("committer", "committer", ctx->qry.grep);
557 html("</select>\n");
558 html("<input class='txt' type='text' size='8' name='q' value='");
559 html_attr(ctx->qry.search);
560 html("'/>\n");
561 html("<input type='submit' value='search'/>\n");
562 html("</form>\n");
528 } else { 563 } else {
529 html("<a class='active' href='"); 564 html("<a class='active' href='");
530 html_attr(cgit_rooturl()); 565 html_attr(cgit_rooturl());