-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
@@ -10,62 +10,58 @@ body { | |||
10 | h2 { | 10 | h2 { |
11 | font-size: 120%; | 11 | font-size: 120%; |
12 | font-weight: bold; | 12 | font-weight: bold; |
13 | margin-bottom: 0.5em; | 13 | margin-bottom: 0.5em; |
14 | } | 14 | } |
15 | 15 | ||
16 | a { | 16 | a { |
17 | color: blue; | 17 | color: blue; |
18 | text-decoration: none; | 18 | text-decoration: none; |
19 | } | 19 | } |
20 | 20 | ||
21 | a:hover { | 21 | a:hover { |
22 | text-decoration: underline; | 22 | text-decoration: underline; |
23 | } | 23 | } |
24 | 24 | ||
25 | table.list { | 25 | table.list { |
26 | border: solid 1px black; | 26 | border: none; |
27 | border-collapse: collapse; | 27 | border-collapse: collapse; |
28 | border: solid 1px #aaa; | ||
29 | } | 28 | } |
30 | table.list tr { | 29 | table.list tr { |
31 | background: white; | 30 | background: white; |
32 | } | 31 | } |
33 | table.list tr:hover { | 32 | table.list tr:hover { |
34 | background: #eeb; | 33 | background: #eee; |
35 | } | 34 | } |
36 | table.list tr.nohover:hover { | 35 | table.list tr.nohover:hover { |
37 | background: white; | 36 | background: white; |
38 | } | 37 | } |
39 | table.list th { | 38 | table.list th { |
40 | font-weight: normal; | 39 | font-weight: normal; |
41 | background: #ddd; | 40 | border-bottom: solid 1px #777; |
42 | border-top: solid 1px #aaa; | ||
43 | border-bottom: solid 1px #aaa; | ||
44 | padding: 0.1em 0.5em 0.1em 0.5em; | 41 | padding: 0.1em 0.5em 0.1em 0.5em; |
45 | vertical-align: baseline; | 42 | vertical-align: baseline; |
46 | } | 43 | } |
47 | table.list td { | 44 | table.list td { |
48 | border: none; | 45 | border: none; |
49 | padding: 0.1em 0.5em 0.1em 0.5em; | 46 | padding: 0.1em 0.5em 0.1em 0.5em; |
50 | } | 47 | } |
51 | img { | 48 | img { |
52 | border: none; | 49 | border: none; |
53 | } | 50 | } |
54 | 51 | ||
55 | |||
56 | div#header { | 52 | div#header { |
57 | background-color: #ddd; | 53 | background-color: #ddd; |
58 | padding: 0.25em 0.25em 0.25em 0.5em; | 54 | padding: 0.25em 0.25em 0.25em 0.5em; |
59 | font-size: 150%; | 55 | font-size: 150%; |
60 | font-weight: bold; | 56 | font-weight: bold; |
61 | border: solid 1px #aaa; | 57 | border: solid 1px #aaa; |
62 | vertical-align: middle; | 58 | vertical-align: middle; |
63 | margin-bottom: 2em; | 59 | margin-bottom: 2em; |
64 | } | 60 | } |
65 | div#header img#logo { | 61 | div#header img#logo { |
66 | float: right; | 62 | float: right; |
67 | } | 63 | } |
68 | 64 | ||
69 | div#header input { | 65 | div#header input { |
70 | float: right; | 66 | float: right; |
71 | margin: 0.25em 1em; | 67 | margin: 0.25em 1em; |
@@ -43,33 +43,33 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep) | |||
43 | if (grep) | 43 | if (grep) |
44 | argv[argc++] = fmt("--grep=%s", grep); | 44 | argv[argc++] = fmt("--grep=%s", grep); |
45 | init_revisions(&rev, NULL); | 45 | init_revisions(&rev, NULL); |
46 | rev.abbrev = DEFAULT_ABBREV; | 46 | rev.abbrev = DEFAULT_ABBREV; |
47 | rev.commit_format = CMIT_FMT_DEFAULT; | 47 | rev.commit_format = CMIT_FMT_DEFAULT; |
48 | rev.verbose_header = 1; | 48 | rev.verbose_header = 1; |
49 | rev.show_root_diff = 0; | 49 | rev.show_root_diff = 0; |
50 | setup_revisions(argc, argv, &rev, NULL); | 50 | setup_revisions(argc, argv, &rev, NULL); |
51 | if (rev.grep_filter) { | 51 | if (rev.grep_filter) { |
52 | rev.grep_filter->regflags |= REG_ICASE; | 52 | rev.grep_filter->regflags |= REG_ICASE; |
53 | compile_grep_patterns(rev.grep_filter); | 53 | compile_grep_patterns(rev.grep_filter); |
54 | } | 54 | } |
55 | prepare_revision_walk(&rev); | 55 | prepare_revision_walk(&rev); |
56 | 56 | ||
57 | html("<h2>Log</h2>"); | 57 | html("<h2>Log</h2>"); |
58 | html("<table class='list nowrap'>"); | 58 | html("<table class='list nowrap'>"); |
59 | html("<tr><th class='left'>Date</th>" | 59 | html("<tr class='nohover'><th class='left'>Date</th>" |
60 | "<th class='left'>Message</th>" | 60 | "<th class='left'>Message</th>" |
61 | "<th class='left'>Author</th></tr>\n"); | 61 | "<th class='left'>Author</th></tr>\n"); |
62 | 62 | ||
63 | if (ofs<0) | 63 | if (ofs<0) |
64 | ofs = 0; | 64 | ofs = 0; |
65 | 65 | ||
66 | for (i = 0; i < ofs && (commit = get_revision(&rev)) != NULL; i++) { | 66 | for (i = 0; i < ofs && (commit = get_revision(&rev)) != NULL; i++) { |
67 | free(commit->buffer); | 67 | free(commit->buffer); |
68 | commit->buffer = NULL; | 68 | commit->buffer = NULL; |
69 | free_commit_list(commit->parents); | 69 | free_commit_list(commit->parents); |
70 | commit->parents = NULL; | 70 | commit->parents = NULL; |
71 | } | 71 | } |
72 | 72 | ||
73 | for (i = 0; i < cnt && (commit = get_revision(&rev)) != NULL; i++) { | 73 | for (i = 0; i < cnt && (commit = get_revision(&rev)) != NULL; i++) { |
74 | print_commit(commit); | 74 | print_commit(commit); |
75 | free(commit->buffer); | 75 | free(commit->buffer); |
diff --git a/ui-repolist.c b/ui-repolist.c index 9f12b18..bd4af59 100644 --- a/ui-repolist.c +++ b/ui-repolist.c | |||
@@ -15,33 +15,33 @@ void cgit_print_repolist(struct cacheitem *item) | |||
15 | struct stat st; | 15 | struct stat st; |
16 | char *name; | 16 | char *name; |
17 | 17 | ||
18 | chdir(cgit_root); | 18 | chdir(cgit_root); |
19 | cgit_print_docstart(cgit_root_title, item); | 19 | cgit_print_docstart(cgit_root_title, item); |
20 | cgit_print_pageheader(cgit_root_title, 0); | 20 | cgit_print_pageheader(cgit_root_title, 0); |
21 | 21 | ||
22 | if (!(d = opendir("."))) { | 22 | if (!(d = opendir("."))) { |
23 | cgit_print_error(fmt("Unable to scan repository directory: %s", | 23 | cgit_print_error(fmt("Unable to scan repository directory: %s", |
24 | strerror(errno))); | 24 | strerror(errno))); |
25 | cgit_print_docend(); | 25 | cgit_print_docend(); |
26 | return; | 26 | return; |
27 | } | 27 | } |
28 | 28 | ||
29 | html("<h2>Repositories</h2>\n"); | 29 | html("<h2>Repositories</h2>\n"); |
30 | html("<table class='list nowrap'>"); | 30 | html("<table class='list nowrap'>"); |
31 | html("<tr>" | 31 | html("<tr class='nohover'>" |
32 | "<th class='left'>Name</th>" | 32 | "<th class='left'>Name</th>" |
33 | "<th class='left'>Description</th>" | 33 | "<th class='left'>Description</th>" |
34 | "<th class='left'>Owner</th></tr>\n"); | 34 | "<th class='left'>Owner</th></tr>\n"); |
35 | while ((de = readdir(d)) != NULL) { | 35 | while ((de = readdir(d)) != NULL) { |
36 | if (de->d_name[0] == '.') | 36 | if (de->d_name[0] == '.') |
37 | continue; | 37 | continue; |
38 | if (stat(de->d_name, &st) < 0) | 38 | if (stat(de->d_name, &st) < 0) |
39 | continue; | 39 | continue; |
40 | if (!S_ISDIR(st.st_mode)) | 40 | if (!S_ISDIR(st.st_mode)) |
41 | continue; | 41 | continue; |
42 | 42 | ||
43 | cgit_repo_name = cgit_repo_desc = cgit_repo_owner = NULL; | 43 | cgit_repo_name = cgit_repo_desc = cgit_repo_owner = NULL; |
44 | name = fmt("%s/info/cgit", de->d_name); | 44 | name = fmt("%s/info/cgit", de->d_name); |
45 | if (cgit_read_config(name, cgit_repo_config_cb)) | 45 | if (cgit_read_config(name, cgit_repo_config_cb)) |
46 | continue; | 46 | continue; |
47 | 47 | ||
diff --git a/ui-summary.c b/ui-summary.c index 1591632..04d4912 100644 --- a/ui-summary.c +++ b/ui-summary.c | |||
@@ -83,42 +83,42 @@ static int cgit_print_tag_cb(const char *refname, const unsigned char *sha1, | |||
83 | htmlf("%s %s", type_names[tag->tagged->type], | 83 | htmlf("%s %s", type_names[tag->tagged->type], |
84 | sha1_to_hex(tag->tagged->sha1)); | 84 | sha1_to_hex(tag->tagged->sha1)); |
85 | html_link_close(); | 85 | html_link_close(); |
86 | html("</td></tr>\n"); | 86 | html("</td></tr>\n"); |
87 | } else { | 87 | } else { |
88 | html("<tr><td>"); | 88 | html("<tr><td>"); |
89 | html_txt(buf); | 89 | html_txt(buf); |
90 | html("</td><td colspan='3'>"); | 90 | html("</td><td colspan='3'>"); |
91 | htmlf("*** bad ref %s ***", sha1_to_hex(sha1)); | 91 | htmlf("*** bad ref %s ***", sha1_to_hex(sha1)); |
92 | html("</td></tr>\n"); | 92 | html("</td></tr>\n"); |
93 | } | 93 | } |
94 | return 0; | 94 | return 0; |
95 | } | 95 | } |
96 | 96 | ||
97 | static void cgit_print_branches() | 97 | static void cgit_print_branches() |
98 | { | 98 | { |
99 | html("<tr><th class='left'>Branch</th>" | 99 | html("<tr class='nohover'><th class='left'>Branch</th>" |
100 | "<th class='left'>Updated</th>" | 100 | "<th class='left'>Updated</th>" |
101 | "<th class='left'>Author</th>" | 101 | "<th class='left'>Author</th>" |
102 | "<th class='left'>Head commit</th></tr>\n"); | 102 | "<th class='left'>Head commit</th></tr>\n"); |
103 | for_each_branch_ref(cgit_print_branch_cb, NULL); | 103 | for_each_branch_ref(cgit_print_branch_cb, NULL); |
104 | } | 104 | } |
105 | 105 | ||
106 | static void cgit_print_tags() | 106 | static void cgit_print_tags() |
107 | { | 107 | { |
108 | html("<tr><th class='left'>Tag</th>" | 108 | html("<tr class='nohover'><th class='left'>Tag</th>" |
109 | "<th class='left'>Created</th>" | 109 | "<th class='left'>Created</th>" |
110 | "<th class='left'>Author</th>" | 110 | "<th class='left'>Author</th>" |
111 | "<th class='left'>Reference</th></tr>\n"); | 111 | "<th class='left'>Reference</th></tr>\n"); |
112 | for_each_tag_ref(cgit_print_tag_cb, NULL); | 112 | for_each_tag_ref(cgit_print_tag_cb, NULL); |
113 | } | 113 | } |
114 | 114 | ||
115 | void cgit_print_summary() | 115 | void cgit_print_summary() |
116 | { | 116 | { |
117 | html("<h2>"); | 117 | html("<h2>"); |
118 | html_txt("Repo summary page"); | 118 | html_txt("Repo summary page"); |
119 | html("</h2>"); | 119 | html("</h2>"); |
120 | html("<table class='list nowrap'>"); | 120 | html("<table class='list nowrap'>"); |
121 | cgit_print_branches(); | 121 | cgit_print_branches(); |
122 | html("<tr class='nohover'><td colspan='4'> </td></tr>"); | 122 | html("<tr class='nohover'><td colspan='4'> </td></tr>"); |
123 | cgit_print_tags(); | 123 | cgit_print_tags(); |
124 | html("</table>"); | 124 | html("</table>"); |
@@ -56,24 +56,24 @@ void cgit_print_tree(const char *hex, char *path) | |||
56 | struct tree *tree; | 56 | struct tree *tree; |
57 | unsigned char sha1[20]; | 57 | unsigned char sha1[20]; |
58 | 58 | ||
59 | if (get_sha1_hex(hex, sha1)) { | 59 | if (get_sha1_hex(hex, sha1)) { |
60 | cgit_print_error(fmt("Invalid object id: %s", hex)); | 60 | cgit_print_error(fmt("Invalid object id: %s", hex)); |
61 | return; | 61 | return; |
62 | } | 62 | } |
63 | tree = parse_tree_indirect(sha1); | 63 | tree = parse_tree_indirect(sha1); |
64 | if (!tree) { | 64 | if (!tree) { |
65 | cgit_print_error(fmt("Not a tree object: %s", hex)); | 65 | cgit_print_error(fmt("Not a tree object: %s", hex)); |
66 | return; | 66 | return; |
67 | } | 67 | } |
68 | 68 | ||
69 | html("<h2>Tree content</h2>\n"); | 69 | html("<h2>Tree content</h2>\n"); |
70 | html_txt(path); | 70 | html_txt(path); |
71 | html("<table class='list'>\n"); | 71 | html("<table class='list'>\n"); |
72 | html("<tr>"); | 72 | html("<tr class='nohover'>"); |
73 | html("<th class='left'>Mode</th>"); | 73 | html("<th class='left'>Mode</th>"); |
74 | html("<th class='left'>Name</th>"); | 74 | html("<th class='left'>Name</th>"); |
75 | html("<th class='right'>Size</th>"); | 75 | html("<th class='right'>Size</th>"); |
76 | html("</tr>\n"); | 76 | html("</tr>\n"); |
77 | read_tree_recursive(tree, "", 0, 1, NULL, print_entry); | 77 | read_tree_recursive(tree, "", 0, 1, NULL, print_entry); |
78 | html("</table>\n"); | 78 | html("</table>\n"); |
79 | } | 79 | } |
@@ -21,22 +21,22 @@ void cgit_print_view(const char *hex) | |||
21 | } | 21 | } |
22 | 22 | ||
23 | if (sha1_object_info(sha1, type, &size)){ | 23 | if (sha1_object_info(sha1, type, &size)){ |
24 | cgit_print_error("Bad object name"); | 24 | cgit_print_error("Bad object name"); |
25 | return; | 25 | return; |
26 | } | 26 | } |
27 | 27 | ||
28 | buf = read_sha1_file(sha1, type, &size); | 28 | buf = read_sha1_file(sha1, type, &size); |
29 | if (!buf) { | 29 | if (!buf) { |
30 | cgit_print_error("Error reading object"); | 30 | cgit_print_error("Error reading object"); |
31 | return; | 31 | return; |
32 | } | 32 | } |
33 | 33 | ||
34 | buf[size] = '\0'; | 34 | buf[size] = '\0'; |
35 | html("<h2>Object content</h2>\n"); | 35 | html("<h2>Object content</h2>\n"); |
36 | html("<table class='list'>\n"); | 36 | html("<table class='list'>\n"); |
37 | htmlf("<tr><th>%s %s, %li bytes</th></tr>\n", type, hex, size); | 37 | htmlf("<tr class='nohover'><th class='left'>%s %s, %li bytes</th></tr>\n", type, hex, size); |
38 | html("<tr><td class='blob'>\n"); | 38 | html("<tr><td class='blob'>\n"); |
39 | html_txt(buf); | 39 | html_txt(buf); |
40 | html("\n</td></tr>\n"); | 40 | html("\n</td></tr>\n"); |
41 | html("</table>\n"); | 41 | html("</table>\n"); |
42 | } | 42 | } |