-rw-r--r-- | cgit.css | 10 | ||||
-rw-r--r-- | ui-log.c | 2 | ||||
-rw-r--r-- | ui-repolist.c | 2 | ||||
-rw-r--r-- | ui-summary.c | 4 | ||||
-rw-r--r-- | ui-tree.c | 2 | ||||
-rw-r--r-- | ui-view.c | 2 |
6 files changed, 9 insertions, 13 deletions
@@ -2,78 +2,74 @@ body { font-family: arial; font-size: normal; background: white; padding: 0em; margin: 0.5em 1em; } h2 { font-size: 120%; font-weight: bold; margin-bottom: 0.5em; } a { color: blue; text-decoration: none; } a:hover { text-decoration: underline; } table.list { - border: solid 1px black; + border: none; border-collapse: collapse; - border: solid 1px #aaa; } table.list tr { background: white; } table.list tr:hover { - background: #eeb; + background: #eee; } table.list tr.nohover:hover { background: white; } table.list th { font-weight: normal; - background: #ddd; - border-top: solid 1px #aaa; - border-bottom: solid 1px #aaa; + border-bottom: solid 1px #777; padding: 0.1em 0.5em 0.1em 0.5em; vertical-align: baseline; } table.list td { border: none; padding: 0.1em 0.5em 0.1em 0.5em; } img { border: none; } - div#header { background-color: #ddd; padding: 0.25em 0.25em 0.25em 0.5em; font-size: 150%; font-weight: bold; border: solid 1px #aaa; vertical-align: middle; margin-bottom: 2em; } div#header img#logo { float: right; } div#header input { float: right; margin: 0.25em 1em; } div#header a { color: black; } div#content { margin: 0.5em 0.5em; } @@ -35,49 +35,49 @@ void print_commit(struct commit *commit) void cgit_print_log(const char *tip, int ofs, int cnt, char *grep) { struct rev_info rev; struct commit *commit; const char *argv[3] = {NULL, tip, NULL}; int argc = 2; int i; if (grep) argv[argc++] = fmt("--grep=%s", grep); 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("<h2>Log</h2>"); html("<table class='list nowrap'>"); - html("<tr><th class='left'>Date</th>" + html("<tr class='nohover'><th class='left'>Date</th>" "<th class='left'>Message</th>" "<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"); html("<div class='pager'>"); if (ofs > 0) { diff --git a/ui-repolist.c b/ui-repolist.c index 9f12b18..bd4af59 100644 --- a/ui-repolist.c +++ b/ui-repolist.c @@ -7,49 +7,49 @@ */ #include "cgit.h" void cgit_print_repolist(struct cacheitem *item) { DIR *d; struct dirent *de; struct stat st; char *name; chdir(cgit_root); cgit_print_docstart(cgit_root_title, item); cgit_print_pageheader(cgit_root_title, 0); if (!(d = opendir("."))) { cgit_print_error(fmt("Unable to scan repository directory: %s", strerror(errno))); cgit_print_docend(); return; } html("<h2>Repositories</h2>\n"); html("<table class='list nowrap'>"); - html("<tr>" + html("<tr class='nohover'>" "<th class='left'>Name</th>" "<th class='left'>Description</th>" "<th class='left'>Owner</th></tr>\n"); while ((de = readdir(d)) != NULL) { if (de->d_name[0] == '.') continue; if (stat(de->d_name, &st) < 0) continue; if (!S_ISDIR(st.st_mode)) continue; cgit_repo_name = cgit_repo_desc = cgit_repo_owner = NULL; name = fmt("%s/info/cgit", de->d_name); if (cgit_read_config(name, cgit_repo_config_cb)) continue; html("<tr><td>"); html_link_open(cgit_repourl(de->d_name), NULL, NULL); html_txt(cgit_repo_name); html_link_close(); html("</td><td>"); html_txt(cgit_repo_desc); html("</td><td>"); html_txt(cgit_repo_owner); diff --git a/ui-summary.c b/ui-summary.c index 1591632..04d4912 100644 --- a/ui-summary.c +++ b/ui-summary.c @@ -75,51 +75,51 @@ static int cgit_print_tag_cb(const char *refname, const unsigned char *sha1, else if (tag->tagged->type == OBJ_TREE) page = "tree"; else page = "view"; url = cgit_pageurl(cgit_query_repo, page, fmt("id=%s", sha1_to_hex(tag->tagged->sha1))); html_link_open(url, NULL, NULL); htmlf("%s %s", type_names[tag->tagged->type], sha1_to_hex(tag->tagged->sha1)); html_link_close(); html("</td></tr>\n"); } else { html("<tr><td>"); html_txt(buf); html("</td><td colspan='3'>"); htmlf("*** bad ref %s ***", sha1_to_hex(sha1)); html("</td></tr>\n"); } return 0; } static void cgit_print_branches() { - html("<tr><th class='left'>Branch</th>" + html("<tr class='nohover'><th class='left'>Branch</th>" "<th class='left'>Updated</th>" "<th class='left'>Author</th>" "<th class='left'>Head commit</th></tr>\n"); for_each_branch_ref(cgit_print_branch_cb, NULL); } static void cgit_print_tags() { - html("<tr><th class='left'>Tag</th>" + html("<tr class='nohover'><th class='left'>Tag</th>" "<th class='left'>Created</th>" "<th class='left'>Author</th>" "<th class='left'>Reference</th></tr>\n"); for_each_tag_ref(cgit_print_tag_cb, NULL); } void cgit_print_summary() { html("<h2>"); html_txt("Repo summary page"); html("</h2>"); html("<table class='list nowrap'>"); cgit_print_branches(); html("<tr class='nohover'><td colspan='4'> </td></tr>"); cgit_print_tags(); html("</table>"); } @@ -48,32 +48,32 @@ static int print_entry(const unsigned char *sha1, const char *base, htmlf("<td class='filesize'>%li</td>", size); html("</tr>\n"); free(name); return 0; } void cgit_print_tree(const char *hex, char *path) { struct tree *tree; unsigned char sha1[20]; if (get_sha1_hex(hex, sha1)) { cgit_print_error(fmt("Invalid object id: %s", hex)); return; } tree = parse_tree_indirect(sha1); if (!tree) { cgit_print_error(fmt("Not a tree object: %s", hex)); return; } html("<h2>Tree content</h2>\n"); html_txt(path); html("<table class='list'>\n"); - html("<tr>"); + html("<tr class='nohover'>"); html("<th class='left'>Mode</th>"); html("<th class='left'>Name</th>"); html("<th class='right'>Size</th>"); html("</tr>\n"); read_tree_recursive(tree, "", 0, 1, NULL, print_entry); html("</table>\n"); } @@ -13,30 +13,30 @@ void cgit_print_view(const char *hex) unsigned char sha1[20]; char type[20]; unsigned char *buf; unsigned long size; if (get_sha1_hex(hex, sha1)){ cgit_print_error(fmt("Bad hex value: %s", hex)); return; } if (sha1_object_info(sha1, type, &size)){ cgit_print_error("Bad object name"); return; } buf = read_sha1_file(sha1, type, &size); if (!buf) { cgit_print_error("Error reading object"); return; } buf[size] = '\0'; html("<h2>Object content</h2>\n"); html("<table class='list'>\n"); - htmlf("<tr><th>%s %s, %li bytes</th></tr>\n", type, hex, size); + htmlf("<tr class='nohover'><th class='left'>%s %s, %li bytes</th></tr>\n", type, hex, size); html("<tr><td class='blob'>\n"); html_txt(buf); html("\n</td></tr>\n"); html("</table>\n"); } |