summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--cgit.css49
-rw-r--r--ui-shared.c22
2 files changed, 41 insertions, 30 deletions
diff --git a/cgit.css b/cgit.css
index 565427f..17c2712 100644
--- a/cgit.css
+++ b/cgit.css
@@ -8,7 +8,7 @@ body {
font-size: 10pt;
color: #333;
background: white;
- padding-left: 4px;
+ padding: 4px;
}
table {
@@ -78,29 +78,39 @@ img {
border: none;
}
-div#sidebar {
+table#layout {
+ border-collapse: collapse;
+ border: none;
+ margin: 0px;
+}
+
+td#sidebar {
vertical-align: top;
width: 162px;
padding: 0px 0px 0px 0px;
- margin: 4px;
- float: left;
+ margin: 0px;
}
-div#logo {
+td#sidebar table {
+ border-collapse: separate;
+ border-spacing: 0px;
margin: 0px;
- padding: 4px 0px 4px 0px;
- text-align: center;
+ padding: 0px;
background-color: #ccc;
+}
+
+td#sidebar table.sidebar td.sidebar {
+ padding: 4px;
border-top: solid 1px #eee;
border-left: solid 1px #eee;
border-right: solid 1px #aaa;
border-bottom: solid 1px #aaa;
}
-div#sidebar div.infobox {
- margin: 0px 0px 0px 0px;
- padding: 0.5em;
- text-align: left;
+div#logo {
+ margin: 0px;
+ padding: 4px 0px 4px 0px;
+ text-align: center;
background-color: #ccc;
border-top: solid 1px #eee;
border-left: solid 1px #eee;
@@ -108,43 +118,42 @@ div#sidebar div.infobox {
border-bottom: solid 1px #aaa;
}
-div#sidebar div.infobox h1 {
+td#sidebar h1 {
font-size: 10pt;
font-weight: bold;
margin: 8px 0px 0px 0px;
}
-div#sidebar div.infobox h1.first {
+td#sidebar h1.first {
margin-top: 0px;
}
-div#sidebar div.infobox a.menu {
+td#sidebar a.menu {
display: block;
background-color: #ccc;
padding: 0.1em 0.5em;
text-decoration: none;
}
-div#sidebar div.infobox a.menu:hover {
+td#sidebar a.menu:hover {
background-color: #bbb;
text-decoration: none;
}
-div#sidebar div.infobox select {
+td#sidebar select {
width: 100%;
margin: 2px 0px 0px 0px;
}
-td#branch-dropdown-cell {
- width: 99%;
+td#sidebar form {
+ text-align: right;
}
input#switch-btn {
- width: 20px;
margin: 2px 0px 0px 0px;
}
-div#sidebar div.infobox input.txt {
+td#sidebar input.txt {
width: 100%;
margin: 2px 0px 0px 0px;
}
diff --git a/ui-shared.c b/ui-shared.c
index 2f771da..4c0613a 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -457,12 +457,14 @@ void cgit_print_pageheader(char *title, int show_search)
static const char *default_info = "This is cgit, a fast webinterface for git repositories";
int header = 0;
- html("<div id='sidebar'>\n");
- html("<div id='logo'><a href='");
+ html("<table id='layout' summary=''>\n");
+ html("<tr><td id='sidebar'>\n");
+ html("<table class='sidebar' summary=''>\n");
+ html("<tr><td class='sidebar'>\n<a href='");
html_attr(cgit_rooturl());
- htmlf("'><img src='%s' alt='cgit'/></a></div>\n",
+ htmlf("'><img src='%s' alt='cgit'/></a>\n",
cgit_logo);
- html("<div class='infobox'>");
+ html("</td></tr>\n<tr><td class='sidebar'>\n");
if (cgit_query_repo) {
html("<h1 class='first'>");
html_txt(strrpart(cgit_repo->name, 20));
@@ -489,13 +491,13 @@ void cgit_print_pageheader(char *title, int show_search)
html("<h1>branch</h1>\n");
html("<form method='get' action=''>\n");
add_hidden_formfields(0, 1, cgit_query_page);
- html("<table summary='branch selector' class='grid'><tr><td id='branch-dropdown-cell'>");
+// html("<table summary='branch selector' class='grid'><tr><td id='branch-dropdown-cell'>");
html("<select name='h' onchange='this.form.submit();'>\n");
for_each_branch_ref(print_branch_option, cgit_query_head);
html("</select>\n");
- html("</td><td>");
- html("<noscript><input type='submit' id='switch-btn' value='..'/></noscript>\n");
- html("</td></tr></table>");
+// html("</td><td>");
+ html("<noscript><input type='submit' id='switch-btn' value='switch'/></noscript>\n");
+// html("</td></tr></table>");
html("</form>\n");
html("<h1>search</h1>\n");
@@ -519,9 +521,9 @@ void cgit_print_pageheader(char *title, int show_search)
html(default_info);
}
- html("</div>\n");
+ html("</td></tr></table></td>\n");
- html("</div>\n<table summary='page content' class='grid'><tr><td id='content'>\n");
+ html("<td id='content'>\n");
}
an>return; if (line[0] == '+') add_lines++; else if (line[0] == '-') rem_lines++; } void inspect_files(struct diff_filepair *pair) { files++; if (cgit_repo->enable_log_linecount) cgit_diff_files(pair->one->sha1, pair->two->sha1, count_lines); } void print_commit(struct commit *commit) { struct commitinfo *info; info = cgit_parse_commit(commit); html("<tr><td>"); cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE); html("</td><td>"); cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, sha1_to_hex(commit->object.sha1)); if (cgit_repo->enable_log_filecount) { files = 0; add_lines = 0; rem_lines = 0; cgit_diff_commit(commit, inspect_files); html("</td><td class='right'>"); htmlf("%d", files); if (cgit_repo->enable_log_linecount) { html("</td><td class='right'>"); htmlf("-%d/+%d", rem_lines, add_lines); } } html("</td><td>"); html_txt(info->author); html("</td></tr>\n"); cgit_free_commitinfo(info); } void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern, char *path, int pager) { struct rev_info rev; struct commit *commit; const char *argv[] = {NULL, tip, NULL, NULL, NULL}; int argc = 2; int i; if (!tip) argv[1] = ctx.qry.head; if (grep && pattern && (!strcmp(grep, "grep") || !strcmp(grep, "author") || !strcmp(grep, "committer"))) argv[argc++] = fmt("--%s=%s", grep, pattern); if (path) { argv[argc++] = "--"; argv[argc++] = path; } init_revisions(&rev, NULL); rev.abbrev = DEFAULT_ABBREV; rev.commit_format = CMIT_FMT_DEFAULT; rev.verbose_header = 1; rev.show_root_diff = 0; setup_revisions(argc, argv, &rev, NULL); if (rev.grep_filter) { rev.grep_filter->regflags |= REG_ICASE; compile_grep_patterns(rev.grep_filter); } prepare_revision_walk(&rev); html("<table summary='log' class='list nowrap'>"); html("<tr class='nohover'><th class='left'>Age</th>" "<th class='left'>Message</th>"); if (cgit_repo->enable_log_filecount) { html("<th class='right'>Files</th>"); if (cgit_repo->enable_log_linecount) html("<th class='right'>Lines</th>"); } html("<th class='left'>Author</th></tr>\n"); if (ofs<0) ofs = 0; for (i = 0; i < ofs && (commit = get_revision(&rev)) != NULL; i++) { free(commit->buffer); commit->buffer = NULL; free_commit_list(commit->parents); commit->parents = NULL; } for (i = 0; i < cnt && (commit = get_revision(&rev)) != NULL; i++) { print_commit(commit); free(commit->buffer); commit->buffer = NULL; free_commit_list(commit->parents); commit->parents = NULL; } html("</table>\n"); if (pager) { html("<div class='pager'>"); if (ofs > 0) { cgit_log_link("[prev]", NULL, NULL, ctx.qry.head, ctx.qry.sha1, ctx.qry.path, ofs - cnt, ctx.qry.grep, ctx.qry.search); html("&nbsp;"); } if ((commit = get_revision(&rev)) != NULL) { cgit_log_link("[next]", NULL, NULL, ctx.qry.head, ctx.qry.sha1, ctx.qry.path, ofs + cnt, ctx.qry.grep, ctx.qry.search); } html("</div>"); } }