summaryrefslogtreecommitdiffabout
path: root/ui-shared.c
authorLars Hjemli <hjemli@gmail.com>2007-11-11 12:17:13 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2007-11-11 12:17:13 (UTC)
commita7cf406c802394460cb14c79f3f43582d1428a45 (patch) (unidiff)
tree71f3069c782698ae2972459258d551055f502c4f /ui-shared.c
parentab21082c21867e035cd925a06d6d55fb3143d883 (diff)
parent2ff33a8a0405b420cd75e0e207c7efeecd6f130b (diff)
downloadcgit-a7cf406c802394460cb14c79f3f43582d1428a45.zip
cgit-a7cf406c802394460cb14c79f3f43582d1428a45.tar.gz
cgit-a7cf406c802394460cb14c79f3f43582d1428a45.tar.bz2
Merge branch 'lh/testsuite'
* lh/testsuite: Set commit date on snapshot contents Fix html error detected by test-suite Create initial testsuite
Diffstat (limited to 'ui-shared.c') (more/less context) (ignore whitespace changes)
-rw-r--r--ui-shared.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/ui-shared.c b/ui-shared.c
index 7c69f60..9ec646b 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -355,13 +355,13 @@ void cgit_print_docstart(char *title, struct cacheitem *item)
355 html("Content-Type: text/html; charset=" PAGE_ENCODING "\n"); 355 html("Content-Type: text/html; charset=" PAGE_ENCODING "\n");
356 htmlf("Last-Modified: %s\n", http_date(item->st.st_mtime)); 356 htmlf("Last-Modified: %s\n", http_date(item->st.st_mtime));
357 htmlf("Expires: %s\n", http_date(item->st.st_mtime + 357 htmlf("Expires: %s\n", http_date(item->st.st_mtime +
358 ttl_seconds(item->ttl))); 358 ttl_seconds(item->ttl)));
359 html("\n"); 359 html("\n");
360 html(cgit_doctype); 360 html(cgit_doctype);
361 html("<html>\n"); 361 html("<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>\n");
362 html("<head>\n"); 362 html("<head>\n");
363 html("<title>"); 363 html("<title>");
364 html_txt(title); 364 html_txt(title);
365 html("</title>\n"); 365 html("</title>\n");
366 htmlf("<meta name='generator' content='cgit %s'/>\n", cgit_version); 366 htmlf("<meta name='generator' content='cgit %s'/>\n", cgit_version);
367 html("<link rel='stylesheet' type='text/css' href='"); 367 html("<link rel='stylesheet' type='text/css' href='");
@@ -370,13 +370,13 @@ void cgit_print_docstart(char *title, struct cacheitem *item)
370 html("</head>\n"); 370 html("</head>\n");
371 html("<body>\n"); 371 html("<body>\n");
372} 372}
373 373
374void cgit_print_docend() 374void cgit_print_docend()
375{ 375{
376 html("</td>\n</tr>\n<table>\n</body>\n</html>\n"); 376 html("</td>\n</tr>\n</table>\n</body>\n</html>\n");
377} 377}
378 378
379int print_branch_option(const char *refname, const unsigned char *sha1, 379int print_branch_option(const char *refname, const unsigned char *sha1,
380 int flags, void *cb_data) 380 int flags, void *cb_data)
381{ 381{
382 char *name = (char *)refname; 382 char *name = (char *)refname;
@@ -453,27 +453,27 @@ void add_hidden_formfields(int incl_head, int incl_search, char *page)
453void cgit_print_pageheader(char *title, int show_search) 453void cgit_print_pageheader(char *title, int show_search)
454{ 454{
455 static const char *default_info = "This is cgit, a fast webinterface for git repositories"; 455 static const char *default_info = "This is cgit, a fast webinterface for git repositories";
456 int header = 0; 456 int header = 0;
457 457
458 html("<div id='sidebar'>\n"); 458 html("<div id='sidebar'>\n");
459 html("<a href='"); 459 html("<div id='logo'><a href='");
460 html_attr(cgit_rooturl()); 460 html_attr(cgit_rooturl());
461 htmlf("'><div id='logo'><img src='%s' alt='cgit'/></div></a>\n", 461 htmlf("'><img src='%s' alt='cgit'/></a></div>\n",
462 cgit_logo); 462 cgit_logo);
463 html("<div class='infobox'>"); 463 html("<div class='infobox'>");
464 if (cgit_query_repo) { 464 if (cgit_query_repo) {
465 html("<h1>"); 465 html("<h1 class='first'>");
466 html_txt(strrpart(cgit_repo->name, 20)); 466 html_txt(strrpart(cgit_repo->name, 20));
467 html("</h1>\n"); 467 html("</h1>\n");
468 html_txt(cgit_repo->desc); 468 html_txt(cgit_repo->desc);
469 if (cgit_repo->owner) { 469 if (cgit_repo->owner) {
470 html("<p>\n<h1>owner</h1>\n"); 470 html("<h1>owner</h1>\n");
471 html_txt(cgit_repo->owner); 471 html_txt(cgit_repo->owner);
472 } 472 }
473 html("<p>\n<h1>navigate</h1>\n"); 473 html("<h1>navigate</h1>\n");
474 reporevlink(NULL, "summary", NULL, "menu", cgit_query_head, 474 reporevlink(NULL, "summary", NULL, "menu", cgit_query_head,
475 NULL, NULL); 475 NULL, NULL);
476 cgit_log_link("log", NULL, "menu", cgit_query_head, NULL, NULL, 476 cgit_log_link("log", NULL, "menu", cgit_query_head, NULL, NULL,
477 0, NULL, NULL); 477 0, NULL, NULL);
478 cgit_tree_link("tree", NULL, "menu", cgit_query_head, 478 cgit_tree_link("tree", NULL, "menu", cgit_query_head,
479 cgit_query_sha1, NULL); 479 cgit_query_sha1, NULL);
@@ -481,25 +481,25 @@ void cgit_print_pageheader(char *title, int show_search)
481 cgit_query_sha1); 481 cgit_query_sha1);
482 cgit_diff_link("diff", NULL, "menu", cgit_query_head, 482 cgit_diff_link("diff", NULL, "menu", cgit_query_head,
483 cgit_query_sha1, cgit_query_sha2, NULL); 483 cgit_query_sha1, cgit_query_sha2, NULL);
484 484
485 for_each_ref(print_archive_ref, &header); 485 for_each_ref(print_archive_ref, &header);
486 486
487 html("<p>\n<h1>branch</h1>\n"); 487 html("<h1>branch</h1>\n");
488 html("<form method='get' action=''>\n"); 488 html("<form method='get' action=''>\n");
489 add_hidden_formfields(0, 1, cgit_query_page); 489 add_hidden_formfields(0, 1, cgit_query_page);
490 html("<table class='grid'><tr><td id='branch-dropdown-cell'>"); 490 html("<table summary='branch selector' class='grid'><tr><td id='branch-dropdown-cell'>");
491 html("<select name='h' onchange='this.form.submit();'>\n"); 491 html("<select name='h' onchange='this.form.submit();'>\n");
492 for_each_branch_ref(print_branch_option, cgit_query_head); 492 for_each_branch_ref(print_branch_option, cgit_query_head);
493 html("</select>\n"); 493 html("</select>\n");
494 html("</td><td>"); 494 html("</td><td>");
495 html("<noscript><input type='submit' id='switch-btn' value='..'></noscript>\n"); 495 html("<noscript><input type='submit' id='switch-btn' value='..'/></noscript>\n");
496 html("</td></tr></table>"); 496 html("</td></tr></table>");
497 html("</form>\n"); 497 html("</form>\n");
498 498
499 html("<p>\n<h1>search</h1>\n"); 499 html("<h1>search</h1>\n");
500 html("<form method='get' action='"); 500 html("<form method='get' action='");
501 if (cgit_virtual_root) 501 if (cgit_virtual_root)
502 html_attr(cgit_fileurl(cgit_query_repo, "log", 502 html_attr(cgit_fileurl(cgit_query_repo, "log",
503 cgit_query_path, NULL)); 503 cgit_query_path, NULL));
504 html("'>\n"); 504 html("'>\n");
505 add_hidden_formfields(1, 0, "log"); 505 add_hidden_formfields(1, 0, "log");
@@ -516,13 +516,13 @@ void cgit_print_pageheader(char *title, int show_search)
516 if (!cgit_index_info || html_include(cgit_index_info)) 516 if (!cgit_index_info || html_include(cgit_index_info))
517 html(default_info); 517 html(default_info);
518 } 518 }
519 519
520 html("</div>\n"); 520 html("</div>\n");
521 521
522 html("</div>\n<table class='grid'><tr><td id='content'>\n"); 522 html("</div>\n<table summary='page content' class='grid'><tr><td id='content'>\n");
523} 523}
524 524
525 525
526void cgit_print_snapshot_start(const char *mimetype, const char *filename, 526void cgit_print_snapshot_start(const char *mimetype, const char *filename,
527 struct cacheitem *item) 527 struct cacheitem *item)
528{ 528{