|
diff --git a/cgit.css b/cgit.css index 30fde03..cda437e 100644 --- a/ cgit.css+++ b/ cgit.css |
|
@@ -153,70 +153,61 @@ table#downloads { |
153 | border-collapse: collapse; |
153 | border-collapse: collapse; |
154 | border: solid 1px #777; |
154 | border: solid 1px #777; |
155 | margin-left: 0.5em; |
155 | margin-left: 0.5em; |
156 | margin-bottom: 0.5em; |
156 | margin-bottom: 0.5em; |
157 | } |
157 | } |
158 | |
158 | |
159 | table#downloads th { |
159 | table#downloads th { |
160 | background-color: #ccc; |
160 | background-color: #ccc; |
161 | } |
161 | } |
162 | |
162 | |
163 | td#content { |
163 | td#content { |
164 | padding: 1em 0.5em; |
164 | padding: 1em 0.5em; |
165 | } |
165 | } |
166 | |
166 | |
167 | div#blob { |
167 | div#blob { |
168 | border: solid 1px black; |
168 | border: solid 1px black; |
169 | } |
169 | } |
170 | |
170 | |
171 | div.error { |
171 | div.error { |
172 | color: red; |
172 | color: red; |
173 | font-weight: bold; |
173 | font-weight: bold; |
174 | margin: 1em 2em; |
174 | margin: 1em 2em; |
175 | } |
175 | } |
176 | |
176 | |
177 | td.ls-blob, td.ls-dir, td.ls-mod { |
177 | a.ls-blob, a.ls-dir, a.ls-mod { |
178 | font-family: monospace; |
178 | font-family: monospace; |
179 | } |
179 | } |
180 | |
180 | |
181 | div.ls-dir a { |
181 | td.ls-size { |
182 | font-weight: bold; |
| |
183 | } |
| |
184 | |
| |
185 | th.filesize, td.filesize { |
| |
186 | text-align: right; |
182 | text-align: right; |
187 | } |
183 | } |
188 | |
184 | |
189 | td.filesize { |
185 | td.ls-size { |
190 | font-family: monospace; |
186 | font-family: monospace; |
191 | } |
187 | } |
192 | |
188 | |
193 | td.links { |
189 | td.ls-mode { |
194 | font-size: 80%; |
| |
195 | padding-left: 2em; |
| |
196 | } |
| |
197 | |
| |
198 | td.filemode { |
| |
199 | font-family: monospace; |
190 | font-family: monospace; |
200 | } |
191 | } |
201 | |
192 | |
202 | table.blob { |
193 | table.blob { |
203 | margin-top: 0.5em; |
194 | margin-top: 0.5em; |
204 | border-top: solid 1px black; |
195 | border-top: solid 1px black; |
205 | } |
196 | } |
206 | |
197 | |
207 | table.blob td.no { |
198 | table.blob td.no { |
208 | border-right: solid 1px black; |
199 | border-right: solid 1px black; |
209 | color: black; |
200 | color: black; |
210 | background-color: #eee; |
201 | background-color: #eee; |
211 | text-align: right; |
202 | text-align: right; |
212 | } |
203 | } |
213 | |
204 | |
214 | table.blob td.txt { |
205 | table.blob td.txt { |
215 | white-space: pre; |
206 | white-space: pre; |
216 | font-family: monospace; |
207 | font-family: monospace; |
217 | padding-left: 0.5em; |
208 | padding-left: 0.5em; |
218 | } |
209 | } |
219 | |
210 | |
220 | table.nowrap td { |
211 | table.nowrap td { |
221 | white-space: nowrap; |
212 | white-space: nowrap; |
222 | } |
213 | } |
|
|
diff --git a/ui-tree.c b/ui-tree.c index 3b82374..d503bee 100644 --- a/ ui-tree.c+++ b/ ui-tree.c |
|
@@ -51,77 +51,75 @@ static void print_object(const unsigned char *sha1, char *path) |
51 | } |
51 | } |
52 | |
52 | |
53 | |
53 | |
54 | static int ls_item(const unsigned char *sha1, const char *base, int baselen, |
54 | static int ls_item(const unsigned char *sha1, const char *base, int baselen, |
55 | const char *pathname, unsigned int mode, int stage) |
55 | const char *pathname, unsigned int mode, int stage) |
56 | { |
56 | { |
57 | char *name; |
57 | char *name; |
58 | char *fullpath; |
58 | char *fullpath; |
59 | enum object_type type; |
59 | enum object_type type; |
60 | unsigned long size = 0; |
60 | unsigned long size = 0; |
61 | char *url, *qry; |
61 | char *url, *qry; |
62 | |
62 | |
63 | name = xstrdup(pathname); |
63 | name = xstrdup(pathname); |
64 | fullpath = fmt("%s%s%s", cgit_query_path ? cgit_query_path : "", |
64 | fullpath = fmt("%s%s%s", cgit_query_path ? cgit_query_path : "", |
65 | cgit_query_path ? "/" : "", name); |
65 | cgit_query_path ? "/" : "", name); |
66 | |
66 | |
67 | type = sha1_object_info(sha1, &size); |
67 | type = sha1_object_info(sha1, &size); |
68 | if (type == OBJ_BAD && !S_ISDIRLNK(mode)) { |
68 | if (type == OBJ_BAD && !S_ISDIRLNK(mode)) { |
69 | htmlf("<tr><td colspan='3'>Bad object: %s %s</td></tr>", |
69 | htmlf("<tr><td colspan='3'>Bad object: %s %s</td></tr>", |
70 | name, |
70 | name, |
71 | sha1_to_hex(sha1)); |
71 | sha1_to_hex(sha1)); |
72 | return 0; |
72 | return 0; |
73 | } |
73 | } |
74 | |
74 | |
75 | html("<tr><td class='filemode'>"); |
75 | html("<tr><td class='ls-mode'>"); |
76 | html_filemode(mode); |
76 | html_filemode(mode); |
77 | html("</td><td "); |
77 | html("</td><td>"); |
78 | if (S_ISDIRLNK(mode)) { |
78 | if (S_ISDIRLNK(mode)) { |
79 | htmlf("class='ls-mod'><a href='"); |
79 | htmlf("<a class='ls-mod' href='"); |
80 | html_attr(fmt(cgit_repo->module_link, |
80 | html_attr(fmt(cgit_repo->module_link, |
81 | name, |
81 | name, |
82 | sha1_to_hex(sha1))); |
82 | sha1_to_hex(sha1))); |
83 | html("'>"); |
83 | html("'>"); |
84 | html_txt(name); |
84 | html_txt(name); |
85 | html("</a>"); |
85 | html("</a>"); |
86 | } else if (S_ISDIR(mode)) { |
86 | } else if (S_ISDIR(mode)) { |
87 | html("class='ls-dir'>"); |
87 | cgit_tree_link(name, NULL, "ls-dir", cgit_query_head, |
88 | cgit_tree_link(name, NULL, NULL, cgit_query_head, |
| |
89 | curr_rev, fullpath); |
88 | curr_rev, fullpath); |
90 | } else { |
89 | } else { |
91 | html("class='ls-blob'>"); |
90 | cgit_tree_link(name, NULL, "ls-blob", cgit_query_head, |
92 | cgit_tree_link(name, NULL, NULL, cgit_query_head, |
| |
93 | curr_rev, fullpath); |
91 | curr_rev, fullpath); |
94 | } |
92 | } |
95 | htmlf("</td><td class='filesize'>%li</td>", size); |
93 | htmlf("</td><td class='ls-size'>%li</td>", size); |
96 | |
94 | |
97 | html("<td class='links'><a href='"); |
95 | html("<td><a href='"); |
98 | qry = fmt("h=%s&path=%s%s%s", curr_rev, |
96 | qry = fmt("h=%s&path=%s%s%s", curr_rev, |
99 | cgit_query_path ? cgit_query_path : "", |
97 | cgit_query_path ? cgit_query_path : "", |
100 | cgit_query_path ? "/" : "", pathname); |
98 | cgit_query_path ? "/" : "", pathname); |
101 | url = cgit_pageurl(cgit_query_repo, "log", qry); |
99 | url = cgit_pageurl(cgit_query_repo, "log", qry); |
102 | html_attr(url); |
100 | html_attr(url); |
103 | html("' class='button'>H</a></td>"); |
101 | html("' title='Log' class='button'>L</a></td>"); |
104 | html("</tr>\n"); |
102 | html("</tr>\n"); |
105 | free(name); |
103 | free(name); |
106 | return 0; |
104 | return 0; |
107 | } |
105 | } |
108 | |
106 | |
109 | static void ls_head() |
107 | static void ls_head() |
110 | { |
108 | { |
111 | html("<table class='list'>\n"); |
109 | html("<table class='list'>\n"); |
112 | html("<tr class='nohover'>"); |
110 | html("<tr class='nohover'>"); |
113 | html("<th class='left'>Mode</th>"); |
111 | html("<th class='left'>Mode</th>"); |
114 | html("<th class='left'>Name</th>"); |
112 | html("<th class='left'>Name</th>"); |
115 | html("<th class='right'>Size</th>"); |
113 | html("<th class='right'>Size</th>"); |
116 | html("<th/>"); |
114 | html("<th/>"); |
117 | html("</tr>\n"); |
115 | html("</tr>\n"); |
118 | header = 1; |
116 | header = 1; |
119 | } |
117 | } |
120 | |
118 | |
121 | static void ls_tail() |
119 | static void ls_tail() |
122 | { |
120 | { |
123 | if (!header) |
121 | if (!header) |
124 | return; |
122 | return; |
125 | html("</table>\n"); |
123 | html("</table>\n"); |
126 | header = 0; |
124 | header = 0; |
127 | } |
125 | } |
|