summaryrefslogtreecommitdiffabout
path: root/ui-shared.c
Unidiff
Diffstat (limited to 'ui-shared.c') (more/less context) (ignore whitespace changes)
-rw-r--r--ui-shared.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/ui-shared.c b/ui-shared.c
index 3e13c86..ece041c 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -455,16 +455,17 @@ void add_hidden_formfields(int incl_head, int incl_search, char *page)
455 html_hidden("q", cgit_query_search); 455 html_hidden("q", cgit_query_search);
456 } 456 }
457} 457}
458 458
459void cgit_print_pageheader(char *title, int show_search) 459void cgit_print_pageheader(char *title, int show_search)
460{ 460{
461 static const char *default_info = "This is cgit, a fast webinterface for git repositories"; 461 static const char *default_info = "This is cgit, a fast webinterface for git repositories";
462 int header = 0; 462 int header = 0;
463 char *url;
463 464
464 html("<table id='layout' summary=''>\n"); 465 html("<table id='layout' summary=''>\n");
465 html("<tr><td id='sidebar'>\n"); 466 html("<tr><td id='sidebar'>\n");
466 html("<table class='sidebar' cellspacing='0' summary=''>\n"); 467 html("<table class='sidebar' cellspacing='0' summary=''>\n");
467 html("<tr><td class='sidebar'>\n<a href='"); 468 html("<tr><td class='sidebar'>\n<a href='");
468 html_attr(cgit_rooturl()); 469 html_attr(cgit_rooturl());
469 htmlf("'><img src='%s' alt='cgit'/></a>\n", 470 htmlf("'><img src='%s' alt='cgit'/></a>\n",
470 cgit_logo); 471 cgit_logo);
@@ -487,16 +488,32 @@ void cgit_print_pageheader(char *title, int show_search)
487 cgit_query_sha1, NULL); 488 cgit_query_sha1, NULL);
488 cgit_commit_link("commit", NULL, "menu", cgit_query_head, 489 cgit_commit_link("commit", NULL, "menu", cgit_query_head,
489 cgit_query_sha1); 490 cgit_query_sha1);
490 cgit_diff_link("diff", NULL, "menu", cgit_query_head, 491 cgit_diff_link("diff", NULL, "menu", cgit_query_head,
491 cgit_query_sha1, cgit_query_sha2, NULL); 492 cgit_query_sha1, cgit_query_sha2, NULL);
492 493
493 for_each_ref(print_archive_ref, &header); 494 for_each_ref(print_archive_ref, &header);
494 495
496 if (cgit_repo->clone_url || cgit_clone_prefix) {
497 html("<h1>clone</h1>\n");
498 if (cgit_repo->clone_url)
499 url = cgit_repo->clone_url;
500 else
501 url = fmt("%s%s", cgit_clone_prefix,
502 cgit_repo->url);
503 html("<a class='menu' href='");
504 html_attr(url);
505 html("' title='");
506 html_attr(url);
507 html("'>\n");
508 html_txt(strrpart(url, 20));
509 html("</a>\n");
510 }
511
495 html("<h1>branch</h1>\n"); 512 html("<h1>branch</h1>\n");
496 html("<form method='get' action=''>\n"); 513 html("<form method='get' action=''>\n");
497 add_hidden_formfields(0, 1, cgit_query_page); 514 add_hidden_formfields(0, 1, cgit_query_page);
498 // html("<table summary='branch selector' class='grid'><tr><td id='branch-dropdown-cell'>"); 515 // html("<table summary='branch selector' class='grid'><tr><td id='branch-dropdown-cell'>");
499 html("<select name='h' onchange='this.form.submit();'>\n"); 516 html("<select name='h' onchange='this.form.submit();'>\n");
500 for_each_branch_ref(print_branch_option, cgit_query_head); 517 for_each_branch_ref(print_branch_option, cgit_query_head);
501 html("</select>\n"); 518 html("</select>\n");
502 // html("</td><td>"); 519 // html("</td><td>");