author | Lars Hjemli <hjemli@gmail.com> | 2008-04-13 08:57:11 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2008-04-13 08:57:11 (UTC) |
commit | 931fc6d1e4986a4566647dda16af09bf69a28b89 (patch) (unidiff) | |
tree | 733a9b7292e98d60ae0e40b5f249fa250f32b2d6 | |
parent | 72a69b77e7bf10cc3674e61e1ddd4d81618ee533 (diff) | |
download | cgit-931fc6d1e4986a4566647dda16af09bf69a28b89.zip cgit-931fc6d1e4986a4566647dda16af09bf69a28b89.tar.gz cgit-931fc6d1e4986a4566647dda16af09bf69a28b89.tar.bz2 |
More layout fixes
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | cgit.css | 64 | ||||
-rw-r--r-- | ui-repolist.c | 2 | ||||
-rw-r--r-- | ui-shared.c | 65 |
3 files changed, 98 insertions, 33 deletions
@@ -21,100 +21,130 @@ a:hover { | |||
21 | } | 21 | } |
22 | 22 | ||
23 | table { | 23 | table { |
24 | border-collapse: collapse; | 24 | border-collapse: collapse; |
25 | } | 25 | } |
26 | 26 | ||
27 | table#header { | 27 | table#header { |
28 | width: 100%; | 28 | width: 100%; |
29 | margin-bottom: 1em; | 29 | margin-bottom: 1em; |
30 | } | 30 | } |
31 | 31 | ||
32 | table#header td.logo { | 32 | table#header td.logo { |
33 | width: 96px; | 33 | width: 96px; |
34 | } | 34 | } |
35 | 35 | ||
36 | table#header td.main { | 36 | table#header td.main { |
37 | font-size: 200%; | 37 | font-size: 250%; |
38 | padding-left: 10px; | ||
39 | } | ||
40 | |||
41 | table#header td.main a { | ||
42 | color: #000; | ||
43 | } | ||
44 | |||
45 | table#header td.form { | ||
46 | text-align: right; | ||
47 | vertical-align: bottom; | ||
48 | padding-right: 1em; | ||
49 | padding-bottom: 2px; | ||
50 | } | ||
51 | |||
52 | table#header td.form form, | ||
53 | table#header td.form input, | ||
54 | table#header td.form select { | ||
55 | font-size: 90%; | ||
38 | } | 56 | } |
39 | 57 | ||
40 | table#header td.sub { | 58 | table#header td.sub { |
41 | color: #777; | 59 | color: #777; |
42 | border-top: solid 1px #ccc; | 60 | border-top: solid 1px #ccc; |
61 | padding-left: 10px; | ||
43 | } | 62 | } |
44 | 63 | ||
45 | table.tabs { | 64 | table.tabs { |
46 | border-bottom: solid 2px #ccc; | 65 | /* border-bottom: solid 2px #ccc; */ |
47 | border-collapse: collapse; | 66 | border-collapse: collapse; |
48 | margin-top: 2em; | 67 | margin-top: 2em; |
49 | margin-bottom: 1em; | 68 | margin-bottom: 0px; |
50 | width: 100%; | 69 | width: 100%; |
51 | } | 70 | } |
52 | 71 | ||
53 | table.tabs td { | 72 | table.tabs td { |
54 | padding: 0px 0.5em; | 73 | padding: 0px 1em; |
55 | vertical-align: bottom; | 74 | vertical-align: bottom; |
56 | } | 75 | } |
57 | 76 | ||
58 | table.tabs td a { | 77 | table.tabs td a { |
59 | padding: 2px 1em; | 78 | padding: 2px 0.75em; |
60 | color: #007; | 79 | color: #777; |
80 | font-size: 110%; | ||
61 | } | 81 | } |
62 | 82 | ||
63 | table.tabs td a.active { | 83 | table.tabs td a.active { |
64 | color: #000; | 84 | color: #000; |
65 | background-color: #ccc; | 85 | background-color: #ccc; |
66 | } | 86 | } |
67 | 87 | ||
68 | table.tabs td.branch { | 88 | table.tabs td.form { |
69 | text-align: right; | 89 | text-align: right; |
70 | } | 90 | } |
71 | 91 | ||
72 | table.tabs td.branch form { | 92 | table.tabs td.form form { |
73 | padding-bottom: 2px; | 93 | padding-bottom: 2px; |
74 | font-size: 90%; | 94 | font-size: 90%; |
75 | } | 95 | } |
76 | 96 | ||
97 | table.tabs td.form input, | ||
98 | table.tabs td.form select { | ||
99 | font-size: 90%; | ||
100 | } | ||
101 | |||
77 | div.content { | 102 | div.content { |
78 | margin: 0px; | 103 | margin: 0px; |
79 | padding: 1em; | 104 | padding: 2em; |
105 | border-top: solid 3px #ccc; | ||
106 | border-bottom: solid 3px #ccc; | ||
80 | } | 107 | } |
81 | 108 | ||
82 | 109 | ||
83 | table.list { | 110 | table.list { |
84 | width: 100%; | 111 | width: 100%; |
85 | border: none; | 112 | border: none; |
86 | border-collapse: collapse; | 113 | border-collapse: collapse; |
87 | } | 114 | } |
88 | 115 | ||
89 | table.list tr { | 116 | table.list tr { |
90 | background: white; | 117 | background: white; |
91 | } | 118 | } |
92 | 119 | ||
93 | table.list tr:hover { | 120 | table.list tr:hover { |
94 | background: #eee; | 121 | background: #eee; |
95 | } | 122 | } |
96 | 123 | ||
97 | table.list tr.nohover:hover { | 124 | table.list tr.nohover:hover { |
98 | background: white; | 125 | background: white; |
99 | } | 126 | } |
100 | 127 | ||
101 | table.list th { | 128 | table.list th { |
102 | font-weight: normal; | 129 | font-weight: bold; |
103 | border-bottom: solid 1px #ccc; | 130 | /* color: #888; |
104 | padding: 0.1em 0.5em 0.1em 0.5em; | 131 | border-top: dashed 1px #888; |
132 | border-bottom: dashed 1px #888; | ||
133 | */ | ||
134 | padding: 0.1em 0.5em 0.05em 0.5em; | ||
105 | vertical-align: baseline; | 135 | vertical-align: baseline; |
106 | } | 136 | } |
107 | 137 | ||
108 | table.list td { | 138 | table.list td { |
109 | border: none; | 139 | border: none; |
110 | padding: 0.1em 0.5em 0.1em 0.5em; | 140 | padding: 0.1em 0.5em 0.1em 0.5em; |
111 | } | 141 | } |
112 | 142 | ||
113 | table.list td a { | 143 | table.list td a { |
114 | color: black; | 144 | color: black; |
115 | } | 145 | } |
116 | 146 | ||
117 | img { | 147 | img { |
118 | border: none; | 148 | border: none; |
119 | } | 149 | } |
120 | 150 | ||
@@ -347,43 +377,43 @@ table.diff td div.del { | |||
347 | 377 | ||
348 | .left { | 378 | .left { |
349 | text-align: left; | 379 | text-align: left; |
350 | } | 380 | } |
351 | 381 | ||
352 | .right { | 382 | .right { |
353 | text-align: right; | 383 | text-align: right; |
354 | } | 384 | } |
355 | 385 | ||
356 | table.list td.repogroup { | 386 | table.list td.repogroup { |
357 | font-style: italic; | 387 | font-style: italic; |
358 | color: #888; | 388 | color: #888; |
359 | } | 389 | } |
360 | 390 | ||
361 | a.button { | 391 | a.button { |
362 | font-size: 80%; | 392 | font-size: 80%; |
363 | color: #aaa; | 393 | color: #33c; |
394 | /* | ||
364 | background-color: #eee; | 395 | background-color: #eee; |
365 | border: solid 1px #aaa; | 396 | border: solid 1px #aaa; |
366 | padding: 0em 0.5em; | ||
367 | margin: 0.1em 0.25em; | 397 | margin: 0.1em 0.25em; |
398 | */ | ||
399 | padding: 0em 0.5em; | ||
368 | } | 400 | } |
369 | 401 | ||
370 | a.button:hover { | 402 | a.button:hover { |
371 | text-decoration: none; | 403 | text-decoration: underline; |
372 | color: #333; | ||
373 | background-color: #ccc; | ||
374 | } | 404 | } |
375 | 405 | ||
376 | a.primary { | 406 | a.primary { |
377 | font-size: 100%; | 407 | font-size: 100%; |
378 | } | 408 | } |
379 | 409 | ||
380 | a.secondary { | 410 | a.secondary { |
381 | font-size: 90%; | 411 | font-size: 90%; |
382 | } | 412 | } |
383 | 413 | ||
384 | td.toplevel-repo { | 414 | td.toplevel-repo { |
385 | 415 | ||
386 | } | 416 | } |
387 | 417 | ||
388 | table.list td.sublevel-repo { | 418 | table.list td.sublevel-repo { |
389 | padding-left: 1.5em; | 419 | padding-left: 1.5em; |
diff --git a/ui-repolist.c b/ui-repolist.c index eeeaf3d..9eba222 100644 --- a/ui-repolist.c +++ b/ui-repolist.c | |||
@@ -57,33 +57,33 @@ void cgit_print_repolist() | |||
57 | cgit_print_docstart(&ctx); | 57 | cgit_print_docstart(&ctx); |
58 | cgit_print_pageheader(&ctx); | 58 | cgit_print_pageheader(&ctx); |
59 | 59 | ||
60 | html("<table summary='repository list' class='list nowrap'>"); | 60 | html("<table summary='repository list' class='list nowrap'>"); |
61 | if (ctx.cfg.index_header) { | 61 | if (ctx.cfg.index_header) { |
62 | htmlf("<tr class='nohover'><td colspan='%d' class='include-block'>", | 62 | htmlf("<tr class='nohover'><td colspan='%d' class='include-block'>", |
63 | columns); | 63 | columns); |
64 | html_include(ctx.cfg.index_header); | 64 | html_include(ctx.cfg.index_header); |
65 | html("</td></tr>"); | 65 | html("</td></tr>"); |
66 | } | 66 | } |
67 | html("<tr class='nohover'>" | 67 | html("<tr class='nohover'>" |
68 | "<th class='left'>Name</th>" | 68 | "<th class='left'>Name</th>" |
69 | "<th class='left'>Description</th>" | 69 | "<th class='left'>Description</th>" |
70 | "<th class='left'>Owner</th>" | 70 | "<th class='left'>Owner</th>" |
71 | "<th class='left'>Idle</th>"); | 71 | "<th class='left'>Idle</th>"); |
72 | if (ctx.cfg.enable_index_links) | 72 | if (ctx.cfg.enable_index_links) |
73 | html("<th>Links</th>"); | 73 | html("<th class='left'>Links</th>"); |
74 | html("</tr>\n"); | 74 | html("</tr>\n"); |
75 | 75 | ||
76 | for (i=0; i<cgit_repolist.count; i++) { | 76 | for (i=0; i<cgit_repolist.count; i++) { |
77 | ctx.repo = &cgit_repolist.repos[i]; | 77 | ctx.repo = &cgit_repolist.repos[i]; |
78 | if ((last_group == NULL && ctx.repo->group != NULL) || | 78 | if ((last_group == NULL && ctx.repo->group != NULL) || |
79 | (last_group != NULL && ctx.repo->group == NULL) || | 79 | (last_group != NULL && ctx.repo->group == NULL) || |
80 | (last_group != NULL && ctx.repo->group != NULL && | 80 | (last_group != NULL && ctx.repo->group != NULL && |
81 | strcmp(ctx.repo->group, last_group))) { | 81 | strcmp(ctx.repo->group, last_group))) { |
82 | htmlf("<tr class='nohover'><td colspan='%d' class='repogroup'>", | 82 | htmlf("<tr class='nohover'><td colspan='%d' class='repogroup'>", |
83 | columns); | 83 | columns); |
84 | html_txt(ctx.repo->group); | 84 | html_txt(ctx.repo->group); |
85 | html("</td></tr>"); | 85 | html("</td></tr>"); |
86 | last_group = ctx.repo->group; | 86 | last_group = ctx.repo->group; |
87 | } | 87 | } |
88 | htmlf("<tr><td class='%s'>", | 88 | htmlf("<tr><td class='%s'>", |
89 | ctx.repo->group ? "sublevel-repo" : "toplevel-repo"); | 89 | ctx.repo->group ? "sublevel-repo" : "toplevel-repo"); |
diff --git a/ui-shared.c b/ui-shared.c index 73e3d4c..782caa7 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
@@ -376,33 +376,33 @@ void cgit_print_docstart(struct cgit_context *ctx) | |||
376 | html("<head>\n"); | 376 | html("<head>\n"); |
377 | html("<title>"); | 377 | html("<title>"); |
378 | html_txt(ctx->page.title); | 378 | html_txt(ctx->page.title); |
379 | html("</title>\n"); | 379 | html("</title>\n"); |
380 | htmlf("<meta name='generator' content='cgit %s'/>\n", cgit_version); | 380 | htmlf("<meta name='generator' content='cgit %s'/>\n", cgit_version); |
381 | if (ctx->cfg.robots && *ctx->cfg.robots) | 381 | if (ctx->cfg.robots && *ctx->cfg.robots) |
382 | htmlf("<meta name='robots' content='%s'/>\n", ctx->cfg.robots); | 382 | htmlf("<meta name='robots' content='%s'/>\n", ctx->cfg.robots); |
383 | html("<link rel='stylesheet' type='text/css' href='"); | 383 | html("<link rel='stylesheet' type='text/css' href='"); |
384 | html_attr(ctx->cfg.css); | 384 | html_attr(ctx->cfg.css); |
385 | html("'/>\n"); | 385 | html("'/>\n"); |
386 | html("</head>\n"); | 386 | html("</head>\n"); |
387 | html("<body>\n"); | 387 | html("<body>\n"); |
388 | } | 388 | } |
389 | 389 | ||
390 | void cgit_print_docend() | 390 | void 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 | ||
395 | int print_branch_option(const char *refname, const unsigned char *sha1, | 395 | int print_branch_option(const char *refname, const unsigned char *sha1, |
396 | int flags, void *cb_data) | 396 | int flags, void *cb_data) |
397 | { | 397 | { |
398 | char *name = (char *)refname; | 398 | char *name = (char *)refname; |
399 | html_option(name, name, ctx.qry.head); | 399 | html_option(name, name, ctx.qry.head); |
400 | return 0; | 400 | return 0; |
401 | } | 401 | } |
402 | 402 | ||
403 | int print_archive_ref(const char *refname, const unsigned char *sha1, | 403 | int print_archive_ref(const char *refname, const unsigned char *sha1, |
404 | int flags, void *cb_data) | 404 | int flags, void *cb_data) |
405 | { | 405 | { |
406 | struct tag *tag; | 406 | struct tag *tag; |
407 | struct taginfo *info; | 407 | struct taginfo *info; |
408 | struct object *obj; | 408 | struct object *obj; |
@@ -472,72 +472,107 @@ char *hc(struct cgit_cmd *cmd, const char *page) | |||
472 | } | 472 | } |
473 | 473 | ||
474 | void cgit_print_pageheader(struct cgit_context *ctx) | 474 | void cgit_print_pageheader(struct cgit_context *ctx) |
475 | { | 475 | { |
476 | struct cgit_cmd *cmd = cgit_get_cmd(ctx); | 476 | struct cgit_cmd *cmd = cgit_get_cmd(ctx); |
477 | 477 | ||
478 | html("<table id='header'>\n"); | 478 | html("<table id='header'>\n"); |
479 | html("<tr>\n"); | 479 | html("<tr>\n"); |
480 | html("<td class='logo' rowspan='2'><a href='"); | 480 | html("<td class='logo' rowspan='2'><a href='"); |
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("'/></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"); |
506 | if (ctx->repo) { | 531 | if (ctx->repo) { |
507 | reporevlink(NULL, "summary", NULL, hc(cmd, "summary"), | 532 | reporevlink(NULL, "summary", NULL, hc(cmd, "summary"), |
508 | ctx->qry.head, NULL, NULL); | 533 | ctx->qry.head, NULL, NULL); |
509 | cgit_refs_link("refs", NULL, hc(cmd, "refs"), ctx->qry.head, | 534 | cgit_refs_link("refs", NULL, hc(cmd, "refs"), ctx->qry.head, |
510 | ctx->qry.sha1, NULL); | 535 | ctx->qry.sha1, NULL); |
511 | cgit_log_link("log", NULL, hc(cmd, "log"), ctx->qry.head, | 536 | cgit_log_link("log", NULL, hc(cmd, "log"), ctx->qry.head, |
512 | NULL, NULL, 0, NULL, NULL); | 537 | NULL, NULL, 0, NULL, NULL); |
513 | cgit_tree_link("tree", NULL, hc(cmd, "tree"), ctx->qry.head, | 538 | cgit_tree_link("tree", NULL, hc(cmd, "tree"), ctx->qry.head, |
514 | ctx->qry.sha1, NULL); | 539 | ctx->qry.sha1, NULL); |
515 | cgit_commit_link("commit", NULL, hc(cmd, "commit"), | 540 | cgit_commit_link("commit", NULL, hc(cmd, "commit"), |
516 | ctx->qry.head, ctx->qry.sha1); | 541 | ctx->qry.head, ctx->qry.sha1); |
517 | cgit_diff_link("diff", NULL, hc(cmd, "diff"), ctx->qry.head, | 542 | cgit_diff_link("diff", NULL, hc(cmd, "diff"), ctx->qry.head, |
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()); |
531 | html("'>index</a>\n"); | 566 | html("'>index</a>\n"); |
532 | } | 567 | } |
533 | html("</td></tr></table>\n"); | 568 | html("</td></tr></table>\n"); |
534 | html("<div class='content'>"); | 569 | html("<div class='content'>"); |
535 | } | 570 | } |
536 | 571 | ||
537 | void cgit_print_filemode(unsigned short mode) | 572 | void cgit_print_filemode(unsigned short mode) |
538 | { | 573 | { |
539 | if (S_ISDIR(mode)) | 574 | if (S_ISDIR(mode)) |
540 | html("d"); | 575 | html("d"); |
541 | else if (S_ISLNK(mode)) | 576 | else if (S_ISLNK(mode)) |
542 | html("l"); | 577 | html("l"); |
543 | else if (S_ISGITLINK(mode)) | 578 | else if (S_ISGITLINK(mode)) |