author | Jeff Smith <whydoubt@yahoo.com> | 2010-07-29 14:32:30 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2010-08-04 01:10:07 (UTC) |
commit | 059b39344fdcde324dff1099fc4b70c7aab12a96 (patch) (unidiff) | |
tree | 4a12cf7645b89c06684e09a1e5dded9a5ddeae38 | |
parent | f9143171267e39f66a02ad2ecb0da2e8cc7f4142 (diff) | |
download | cgit-059b39344fdcde324dff1099fc4b70c7aab12a96.zip cgit-059b39344fdcde324dff1099fc4b70c7aab12a96.tar.gz cgit-059b39344fdcde324dff1099fc4b70c7aab12a96.tar.bz2 |
ui-commit: Display git notes when present
Signed-off-by: Jeff Smith <whydoubt@yahoo.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | cgit.css | 18 | ||||
-rw-r--r-- | cgit.h | 1 | ||||
-rw-r--r-- | ui-commit.c | 15 |
3 files changed, 34 insertions, 0 deletions
@@ -1,716 +1,734 @@ | |||
1 | body, table, form { | 1 | body, table, form { |
2 | padding: 0em; | 2 | padding: 0em; |
3 | margin: 0em; | 3 | margin: 0em; |
4 | } | 4 | } |
5 | 5 | ||
6 | body { | 6 | body { |
7 | font-family: sans-serif; | 7 | font-family: sans-serif; |
8 | font-size: 10pt; | 8 | font-size: 10pt; |
9 | color: #333; | 9 | color: #333; |
10 | background: white; | 10 | background: white; |
11 | padding: 4px; | 11 | padding: 4px; |
12 | } | 12 | } |
13 | 13 | ||
14 | a { | 14 | a { |
15 | color: blue; | 15 | color: blue; |
16 | text-decoration: none; | 16 | text-decoration: none; |
17 | } | 17 | } |
18 | 18 | ||
19 | a:hover { | 19 | a:hover { |
20 | text-decoration: underline; | 20 | text-decoration: underline; |
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: 250%; | 37 | font-size: 250%; |
38 | padding-left: 10px; | 38 | padding-left: 10px; |
39 | white-space: nowrap; | 39 | white-space: nowrap; |
40 | } | 40 | } |
41 | 41 | ||
42 | table#header td.main a { | 42 | table#header td.main a { |
43 | color: #000; | 43 | color: #000; |
44 | } | 44 | } |
45 | 45 | ||
46 | table#header td.form { | 46 | table#header td.form { |
47 | text-align: right; | 47 | text-align: right; |
48 | vertical-align: bottom; | 48 | vertical-align: bottom; |
49 | padding-right: 1em; | 49 | padding-right: 1em; |
50 | padding-bottom: 2px; | 50 | padding-bottom: 2px; |
51 | white-space: nowrap; | 51 | white-space: nowrap; |
52 | } | 52 | } |
53 | 53 | ||
54 | table#header td.form form, | 54 | table#header td.form form, |
55 | table#header td.form input, | 55 | table#header td.form input, |
56 | table#header td.form select { | 56 | table#header td.form select { |
57 | font-size: 90%; | 57 | font-size: 90%; |
58 | } | 58 | } |
59 | 59 | ||
60 | table#header td.sub { | 60 | table#header td.sub { |
61 | color: #777; | 61 | color: #777; |
62 | border-top: solid 1px #ccc; | 62 | border-top: solid 1px #ccc; |
63 | padding-left: 10px; | 63 | padding-left: 10px; |
64 | } | 64 | } |
65 | 65 | ||
66 | table.tabs { | 66 | table.tabs { |
67 | border-bottom: solid 3px #ccc; | 67 | border-bottom: solid 3px #ccc; |
68 | border-collapse: collapse; | 68 | border-collapse: collapse; |
69 | margin-top: 2em; | 69 | margin-top: 2em; |
70 | margin-bottom: 0px; | 70 | margin-bottom: 0px; |
71 | width: 100%; | 71 | width: 100%; |
72 | } | 72 | } |
73 | 73 | ||
74 | table.tabs td { | 74 | table.tabs td { |
75 | padding: 0px 1em; | 75 | padding: 0px 1em; |
76 | vertical-align: bottom; | 76 | vertical-align: bottom; |
77 | } | 77 | } |
78 | 78 | ||
79 | table.tabs td a { | 79 | table.tabs td a { |
80 | padding: 2px 0.75em; | 80 | padding: 2px 0.75em; |
81 | color: #777; | 81 | color: #777; |
82 | font-size: 110%; | 82 | font-size: 110%; |
83 | } | 83 | } |
84 | 84 | ||
85 | table.tabs td a.active { | 85 | table.tabs td a.active { |
86 | color: #000; | 86 | color: #000; |
87 | background-color: #ccc; | 87 | background-color: #ccc; |
88 | } | 88 | } |
89 | 89 | ||
90 | table.tabs td.form { | 90 | table.tabs td.form { |
91 | text-align: right; | 91 | text-align: right; |
92 | } | 92 | } |
93 | 93 | ||
94 | table.tabs td.form form { | 94 | table.tabs td.form form { |
95 | padding-bottom: 2px; | 95 | padding-bottom: 2px; |
96 | font-size: 90%; | 96 | font-size: 90%; |
97 | white-space: nowrap; | 97 | white-space: nowrap; |
98 | } | 98 | } |
99 | 99 | ||
100 | table.tabs td.form input, | 100 | table.tabs td.form input, |
101 | table.tabs td.form select { | 101 | table.tabs td.form select { |
102 | font-size: 90%; | 102 | font-size: 90%; |
103 | } | 103 | } |
104 | 104 | ||
105 | div.path { | 105 | div.path { |
106 | margin: 0px; | 106 | margin: 0px; |
107 | padding: 5px 2em 2px 2em; | 107 | padding: 5px 2em 2px 2em; |
108 | color: #000; | 108 | color: #000; |
109 | background-color: #eee; | 109 | background-color: #eee; |
110 | } | 110 | } |
111 | 111 | ||
112 | div.content { | 112 | div.content { |
113 | margin: 0px; | 113 | margin: 0px; |
114 | padding: 2em; | 114 | padding: 2em; |
115 | border-bottom: solid 3px #ccc; | 115 | border-bottom: solid 3px #ccc; |
116 | } | 116 | } |
117 | 117 | ||
118 | 118 | ||
119 | table.list { | 119 | table.list { |
120 | width: 100%; | 120 | width: 100%; |
121 | border: none; | 121 | border: none; |
122 | border-collapse: collapse; | 122 | border-collapse: collapse; |
123 | } | 123 | } |
124 | 124 | ||
125 | table.list tr { | 125 | table.list tr { |
126 | background: white; | 126 | background: white; |
127 | } | 127 | } |
128 | 128 | ||
129 | table.list tr.logheader { | 129 | table.list tr.logheader { |
130 | background: #eee; | 130 | background: #eee; |
131 | } | 131 | } |
132 | 132 | ||
133 | table.list tr:hover { | 133 | table.list tr:hover { |
134 | background: #eee; | 134 | background: #eee; |
135 | } | 135 | } |
136 | 136 | ||
137 | table.list tr.nohover:hover { | 137 | table.list tr.nohover:hover { |
138 | background: white; | 138 | background: white; |
139 | } | 139 | } |
140 | 140 | ||
141 | table.list th { | 141 | table.list th { |
142 | font-weight: bold; | 142 | font-weight: bold; |
143 | /* color: #888; | 143 | /* color: #888; |
144 | border-top: dashed 1px #888; | 144 | border-top: dashed 1px #888; |
145 | border-bottom: dashed 1px #888; | 145 | border-bottom: dashed 1px #888; |
146 | */ | 146 | */ |
147 | padding: 0.1em 0.5em 0.05em 0.5em; | 147 | padding: 0.1em 0.5em 0.05em 0.5em; |
148 | vertical-align: baseline; | 148 | vertical-align: baseline; |
149 | } | 149 | } |
150 | 150 | ||
151 | table.list td { | 151 | table.list td { |
152 | border: none; | 152 | border: none; |
153 | padding: 0.1em 0.5em 0.1em 0.5em; | 153 | padding: 0.1em 0.5em 0.1em 0.5em; |
154 | } | 154 | } |
155 | 155 | ||
156 | table.list td.logsubject { | 156 | table.list td.logsubject { |
157 | font-family: monospace; | 157 | font-family: monospace; |
158 | font-weight: bold; | 158 | font-weight: bold; |
159 | } | 159 | } |
160 | 160 | ||
161 | table.list td.logmsg { | 161 | table.list td.logmsg { |
162 | font-family: monospace; | 162 | font-family: monospace; |
163 | white-space: pre; | 163 | white-space: pre; |
164 | padding: 1em 0.5em 2em 0.5em; | 164 | padding: 1em 0.5em 2em 0.5em; |
165 | } | 165 | } |
166 | 166 | ||
167 | table.list td a { | 167 | table.list td a { |
168 | color: black; | 168 | color: black; |
169 | } | 169 | } |
170 | 170 | ||
171 | table.list td a.ls-dir { | 171 | table.list td a.ls-dir { |
172 | font-weight: bold; | 172 | font-weight: bold; |
173 | color: #00f; | 173 | color: #00f; |
174 | } | 174 | } |
175 | 175 | ||
176 | table.list td a:hover { | 176 | table.list td a:hover { |
177 | color: #00f; | 177 | color: #00f; |
178 | } | 178 | } |
179 | 179 | ||
180 | img { | 180 | img { |
181 | border: none; | 181 | border: none; |
182 | } | 182 | } |
183 | 183 | ||
184 | input#switch-btn { | 184 | input#switch-btn { |
185 | margin: 2px 0px 0px 0px; | 185 | margin: 2px 0px 0px 0px; |
186 | } | 186 | } |
187 | 187 | ||
188 | td#sidebar input.txt { | 188 | td#sidebar input.txt { |
189 | width: 100%; | 189 | width: 100%; |
190 | margin: 2px 0px 0px 0px; | 190 | margin: 2px 0px 0px 0px; |
191 | } | 191 | } |
192 | 192 | ||
193 | table#grid { | 193 | table#grid { |
194 | margin: 0px; | 194 | margin: 0px; |
195 | } | 195 | } |
196 | 196 | ||
197 | td#content { | 197 | td#content { |
198 | vertical-align: top; | 198 | vertical-align: top; |
199 | padding: 1em 2em 1em 1em; | 199 | padding: 1em 2em 1em 1em; |
200 | border: none; | 200 | border: none; |
201 | } | 201 | } |
202 | 202 | ||
203 | div#summary { | 203 | div#summary { |
204 | vertical-align: top; | 204 | vertical-align: top; |
205 | margin-bottom: 1em; | 205 | margin-bottom: 1em; |
206 | } | 206 | } |
207 | 207 | ||
208 | table#downloads { | 208 | table#downloads { |
209 | float: right; | 209 | float: right; |
210 | border-collapse: collapse; | 210 | border-collapse: collapse; |
211 | border: solid 1px #777; | 211 | border: solid 1px #777; |
212 | margin-left: 0.5em; | 212 | margin-left: 0.5em; |
213 | margin-bottom: 0.5em; | 213 | margin-bottom: 0.5em; |
214 | } | 214 | } |
215 | 215 | ||
216 | table#downloads th { | 216 | table#downloads th { |
217 | background-color: #ccc; | 217 | background-color: #ccc; |
218 | } | 218 | } |
219 | 219 | ||
220 | div#blob { | 220 | div#blob { |
221 | border: solid 1px black; | 221 | border: solid 1px black; |
222 | } | 222 | } |
223 | 223 | ||
224 | div.error { | 224 | div.error { |
225 | color: red; | 225 | color: red; |
226 | font-weight: bold; | 226 | font-weight: bold; |
227 | margin: 1em 2em; | 227 | margin: 1em 2em; |
228 | } | 228 | } |
229 | 229 | ||
230 | a.ls-blob, a.ls-dir, a.ls-mod { | 230 | a.ls-blob, a.ls-dir, a.ls-mod { |
231 | font-family: monospace; | 231 | font-family: monospace; |
232 | } | 232 | } |
233 | 233 | ||
234 | td.ls-size { | 234 | td.ls-size { |
235 | text-align: right; | 235 | text-align: right; |
236 | font-family: monospace; | 236 | font-family: monospace; |
237 | width: 10em; | 237 | width: 10em; |
238 | } | 238 | } |
239 | 239 | ||
240 | td.ls-mode { | 240 | td.ls-mode { |
241 | font-family: monospace; | 241 | font-family: monospace; |
242 | width: 10em; | 242 | width: 10em; |
243 | } | 243 | } |
244 | 244 | ||
245 | table.blob { | 245 | table.blob { |
246 | margin-top: 0.5em; | 246 | margin-top: 0.5em; |
247 | border-top: solid 1px black; | 247 | border-top: solid 1px black; |
248 | } | 248 | } |
249 | 249 | ||
250 | table.blob td.lines { | 250 | table.blob td.lines { |
251 | margin: 0; padding: 0 0 0 0.5em; | 251 | margin: 0; padding: 0 0 0 0.5em; |
252 | vertical-align: top; | 252 | vertical-align: top; |
253 | color: black; | 253 | color: black; |
254 | } | 254 | } |
255 | 255 | ||
256 | table.blob td.linenumbers { | 256 | table.blob td.linenumbers { |
257 | margin: 0; padding: 0 0.5em 0 0.5em; | 257 | margin: 0; padding: 0 0.5em 0 0.5em; |
258 | vertical-align: top; | 258 | vertical-align: top; |
259 | text-align: right; | 259 | text-align: right; |
260 | border-right: 1px solid gray; | 260 | border-right: 1px solid gray; |
261 | } | 261 | } |
262 | 262 | ||
263 | table.blob pre { | 263 | table.blob pre { |
264 | padding: 0; margin: 0; | 264 | padding: 0; margin: 0; |
265 | } | 265 | } |
266 | 266 | ||
267 | table.blob a.no { | 267 | table.blob a.no { |
268 | color: gray; | 268 | color: gray; |
269 | text-align: right; | 269 | text-align: right; |
270 | text-decoration: none; | 270 | text-decoration: none; |
271 | } | 271 | } |
272 | 272 | ||
273 | table.blob a.no a:hover { | 273 | table.blob a.no a:hover { |
274 | color: black; | 274 | color: black; |
275 | } | 275 | } |
276 | 276 | ||
277 | table.bin-blob { | 277 | table.bin-blob { |
278 | margin-top: 0.5em; | 278 | margin-top: 0.5em; |
279 | border: solid 1px black; | 279 | border: solid 1px black; |
280 | } | 280 | } |
281 | 281 | ||
282 | table.bin-blob th { | 282 | table.bin-blob th { |
283 | font-family: monospace; | 283 | font-family: monospace; |
284 | white-space: pre; | 284 | white-space: pre; |
285 | border: solid 1px #777; | 285 | border: solid 1px #777; |
286 | padding: 0.5em 1em; | 286 | padding: 0.5em 1em; |
287 | } | 287 | } |
288 | 288 | ||
289 | table.bin-blob td { | 289 | table.bin-blob td { |
290 | font-family: monospace; | 290 | font-family: monospace; |
291 | white-space: pre; | 291 | white-space: pre; |
292 | border-left: solid 1px #777; | 292 | border-left: solid 1px #777; |
293 | padding: 0em 1em; | 293 | padding: 0em 1em; |
294 | } | 294 | } |
295 | 295 | ||
296 | table.nowrap td { | 296 | table.nowrap td { |
297 | white-space: nowrap; | 297 | white-space: nowrap; |
298 | } | 298 | } |
299 | 299 | ||
300 | table.commit-info { | 300 | table.commit-info { |
301 | border-collapse: collapse; | 301 | border-collapse: collapse; |
302 | margin-top: 1.5em; | 302 | margin-top: 1.5em; |
303 | } | 303 | } |
304 | 304 | ||
305 | table.commit-info th { | 305 | table.commit-info th { |
306 | text-align: left; | 306 | text-align: left; |
307 | font-weight: normal; | 307 | font-weight: normal; |
308 | padding: 0.1em 1em 0.1em 0.1em; | 308 | padding: 0.1em 1em 0.1em 0.1em; |
309 | vertical-align: top; | 309 | vertical-align: top; |
310 | } | 310 | } |
311 | 311 | ||
312 | table.commit-info td { | 312 | table.commit-info td { |
313 | font-weight: normal; | 313 | font-weight: normal; |
314 | padding: 0.1em 1em 0.1em 0.1em; | 314 | padding: 0.1em 1em 0.1em 0.1em; |
315 | } | 315 | } |
316 | 316 | ||
317 | div.commit-subject { | 317 | div.commit-subject { |
318 | font-weight: bold; | 318 | font-weight: bold; |
319 | font-size: 125%; | 319 | font-size: 125%; |
320 | margin: 1.5em 0em 0.5em 0em; | 320 | margin: 1.5em 0em 0.5em 0em; |
321 | padding: 0em; | 321 | padding: 0em; |
322 | } | 322 | } |
323 | 323 | ||
324 | div.commit-msg { | 324 | div.commit-msg { |
325 | white-space: pre; | 325 | white-space: pre; |
326 | font-family: monospace; | 326 | font-family: monospace; |
327 | } | 327 | } |
328 | 328 | ||
329 | div.notes-header { | ||
330 | font-weight: bold; | ||
331 | padding-top: 1.5em; | ||
332 | } | ||
333 | |||
334 | div.notes { | ||
335 | white-space: pre; | ||
336 | font-family: monospace; | ||
337 | border: solid 1px #ee9; | ||
338 | background-color: #ffd; | ||
339 | padding: 0.3em 2em 0.3em 1em; | ||
340 | float: left; | ||
341 | } | ||
342 | |||
343 | div.notes-footer { | ||
344 | clear: left; | ||
345 | } | ||
346 | |||
329 | div.diffstat-header { | 347 | div.diffstat-header { |
330 | font-weight: bold; | 348 | font-weight: bold; |
331 | padding-top: 1.5em; | 349 | padding-top: 1.5em; |
332 | } | 350 | } |
333 | 351 | ||
334 | table.diffstat { | 352 | table.diffstat { |
335 | border-collapse: collapse; | 353 | border-collapse: collapse; |
336 | border: solid 1px #aaa; | 354 | border: solid 1px #aaa; |
337 | background-color: #eee; | 355 | background-color: #eee; |
338 | } | 356 | } |
339 | 357 | ||
340 | table.diffstat th { | 358 | table.diffstat th { |
341 | font-weight: normal; | 359 | font-weight: normal; |
342 | text-align: left; | 360 | text-align: left; |
343 | text-decoration: underline; | 361 | text-decoration: underline; |
344 | padding: 0.1em 1em 0.1em 0.1em; | 362 | padding: 0.1em 1em 0.1em 0.1em; |
345 | font-size: 100%; | 363 | font-size: 100%; |
346 | } | 364 | } |
347 | 365 | ||
348 | table.diffstat td { | 366 | table.diffstat td { |
349 | padding: 0.2em 0.2em 0.1em 0.1em; | 367 | padding: 0.2em 0.2em 0.1em 0.1em; |
350 | font-size: 100%; | 368 | font-size: 100%; |
351 | border: none; | 369 | border: none; |
352 | } | 370 | } |
353 | 371 | ||
354 | table.diffstat td.mode { | 372 | table.diffstat td.mode { |
355 | white-space: nowrap; | 373 | white-space: nowrap; |
356 | } | 374 | } |
357 | 375 | ||
358 | table.diffstat td span.modechange { | 376 | table.diffstat td span.modechange { |
359 | padding-left: 1em; | 377 | padding-left: 1em; |
360 | color: red; | 378 | color: red; |
361 | } | 379 | } |
362 | 380 | ||
363 | table.diffstat td.add a { | 381 | table.diffstat td.add a { |
364 | color: green; | 382 | color: green; |
365 | } | 383 | } |
366 | 384 | ||
367 | table.diffstat td.del a { | 385 | table.diffstat td.del a { |
368 | color: red; | 386 | color: red; |
369 | } | 387 | } |
370 | 388 | ||
371 | table.diffstat td.upd a { | 389 | table.diffstat td.upd a { |
372 | color: blue; | 390 | color: blue; |
373 | } | 391 | } |
374 | 392 | ||
375 | table.diffstat td.graph { | 393 | table.diffstat td.graph { |
376 | width: 500px; | 394 | width: 500px; |
377 | vertical-align: middle; | 395 | vertical-align: middle; |
378 | } | 396 | } |
379 | 397 | ||
380 | table.diffstat td.graph table { | 398 | table.diffstat td.graph table { |
381 | border: none; | 399 | border: none; |
382 | } | 400 | } |
383 | 401 | ||
384 | table.diffstat td.graph td { | 402 | table.diffstat td.graph td { |
385 | padding: 0px; | 403 | padding: 0px; |
386 | border: 0px; | 404 | border: 0px; |
387 | height: 7pt; | 405 | height: 7pt; |
388 | } | 406 | } |
389 | 407 | ||
390 | table.diffstat td.graph td.add { | 408 | table.diffstat td.graph td.add { |
391 | background-color: #5c5; | 409 | background-color: #5c5; |
392 | } | 410 | } |
393 | 411 | ||
394 | table.diffstat td.graph td.rem { | 412 | table.diffstat td.graph td.rem { |
395 | background-color: #c55; | 413 | background-color: #c55; |
396 | } | 414 | } |
397 | 415 | ||
398 | div.diffstat-summary { | 416 | div.diffstat-summary { |
399 | color: #888; | 417 | color: #888; |
400 | padding-top: 0.5em; | 418 | padding-top: 0.5em; |
401 | } | 419 | } |
402 | 420 | ||
403 | table.diff { | 421 | table.diff { |
404 | width: 100%; | 422 | width: 100%; |
405 | } | 423 | } |
406 | 424 | ||
407 | table.diff td { | 425 | table.diff td { |
408 | font-family: monospace; | 426 | font-family: monospace; |
409 | white-space: pre; | 427 | white-space: pre; |
410 | } | 428 | } |
411 | 429 | ||
412 | table.diff td div.head { | 430 | table.diff td div.head { |
413 | font-weight: bold; | 431 | font-weight: bold; |
414 | margin-top: 1em; | 432 | margin-top: 1em; |
415 | color: black; | 433 | color: black; |
416 | } | 434 | } |
417 | 435 | ||
418 | table.diff td div.hunk { | 436 | table.diff td div.hunk { |
419 | color: #009; | 437 | color: #009; |
420 | } | 438 | } |
421 | 439 | ||
422 | table.diff td div.add { | 440 | table.diff td div.add { |
423 | color: green; | 441 | color: green; |
424 | } | 442 | } |
425 | 443 | ||
426 | table.diff td div.del { | 444 | table.diff td div.del { |
427 | color: red; | 445 | color: red; |
428 | } | 446 | } |
429 | 447 | ||
430 | .sha1 { | 448 | .sha1 { |
431 | font-family: monospace; | 449 | font-family: monospace; |
432 | font-size: 90%; | 450 | font-size: 90%; |
433 | } | 451 | } |
434 | 452 | ||
435 | .left { | 453 | .left { |
436 | text-align: left; | 454 | text-align: left; |
437 | } | 455 | } |
438 | 456 | ||
439 | .right { | 457 | .right { |
440 | text-align: right; | 458 | text-align: right; |
441 | } | 459 | } |
442 | 460 | ||
443 | table.list td.reposection { | 461 | table.list td.reposection { |
444 | font-style: italic; | 462 | font-style: italic; |
445 | color: #888; | 463 | color: #888; |
446 | } | 464 | } |
447 | 465 | ||
448 | a.button { | 466 | a.button { |
449 | font-size: 80%; | 467 | font-size: 80%; |
450 | padding: 0em 0.5em; | 468 | padding: 0em 0.5em; |
451 | } | 469 | } |
452 | 470 | ||
453 | a.primary { | 471 | a.primary { |
454 | font-size: 100%; | 472 | font-size: 100%; |
455 | } | 473 | } |
456 | 474 | ||
457 | a.secondary { | 475 | a.secondary { |
458 | font-size: 90%; | 476 | font-size: 90%; |
459 | } | 477 | } |
460 | 478 | ||
461 | td.toplevel-repo { | 479 | td.toplevel-repo { |
462 | 480 | ||
463 | } | 481 | } |
464 | 482 | ||
465 | table.list td.sublevel-repo { | 483 | table.list td.sublevel-repo { |
466 | padding-left: 1.5em; | 484 | padding-left: 1.5em; |
467 | } | 485 | } |
468 | 486 | ||
469 | div.pager { | 487 | div.pager { |
470 | text-align: center; | 488 | text-align: center; |
471 | margin: 1em 0em 0em 0em; | 489 | margin: 1em 0em 0em 0em; |
472 | } | 490 | } |
473 | 491 | ||
474 | div.pager a { | 492 | div.pager a { |
475 | color: #777; | 493 | color: #777; |
476 | margin: 0em 0.5em; | 494 | margin: 0em 0.5em; |
477 | } | 495 | } |
478 | 496 | ||
479 | span.age-mins { | 497 | span.age-mins { |
480 | font-weight: bold; | 498 | font-weight: bold; |
481 | color: #080; | 499 | color: #080; |
482 | } | 500 | } |
483 | 501 | ||
484 | span.age-hours { | 502 | span.age-hours { |
485 | color: #080; | 503 | color: #080; |
486 | } | 504 | } |
487 | 505 | ||
488 | span.age-days { | 506 | span.age-days { |
489 | color: #040; | 507 | color: #040; |
490 | } | 508 | } |
491 | 509 | ||
492 | span.age-weeks { | 510 | span.age-weeks { |
493 | color: #444; | 511 | color: #444; |
494 | } | 512 | } |
495 | 513 | ||
496 | span.age-months { | 514 | span.age-months { |
497 | color: #888; | 515 | color: #888; |
498 | } | 516 | } |
499 | 517 | ||
500 | span.age-years { | 518 | span.age-years { |
501 | color: #bbb; | 519 | color: #bbb; |
502 | } | 520 | } |
503 | div.footer { | 521 | div.footer { |
504 | margin-top: 0.5em; | 522 | margin-top: 0.5em; |
505 | text-align: center; | 523 | text-align: center; |
506 | font-size: 80%; | 524 | font-size: 80%; |
507 | color: #ccc; | 525 | color: #ccc; |
508 | } | 526 | } |
509 | a.branch-deco { | 527 | a.branch-deco { |
510 | margin: 0px 0.5em; | 528 | margin: 0px 0.5em; |
511 | padding: 0px 0.25em; | 529 | padding: 0px 0.25em; |
512 | background-color: #88ff88; | 530 | background-color: #88ff88; |
513 | border: solid 1px #007700; | 531 | border: solid 1px #007700; |
514 | } | 532 | } |
515 | a.tag-deco { | 533 | a.tag-deco { |
516 | margin: 0px 0.5em; | 534 | margin: 0px 0.5em; |
517 | padding: 0px 0.25em; | 535 | padding: 0px 0.25em; |
518 | background-color: #ffff88; | 536 | background-color: #ffff88; |
519 | border: solid 1px #777700; | 537 | border: solid 1px #777700; |
520 | } | 538 | } |
521 | a.remote-deco { | 539 | a.remote-deco { |
522 | margin: 0px 0.5em; | 540 | margin: 0px 0.5em; |
523 | padding: 0px 0.25em; | 541 | padding: 0px 0.25em; |
524 | background-color: #ccccff; | 542 | background-color: #ccccff; |
525 | border: solid 1px #000077; | 543 | border: solid 1px #000077; |
526 | } | 544 | } |
527 | a.deco { | 545 | a.deco { |
528 | margin: 0px 0.5em; | 546 | margin: 0px 0.5em; |
529 | padding: 0px 0.25em; | 547 | padding: 0px 0.25em; |
530 | background-color: #ff8888; | 548 | background-color: #ff8888; |
531 | border: solid 1px #770000; | 549 | border: solid 1px #770000; |
532 | } | 550 | } |
533 | 551 | ||
534 | div.commit-subject a.branch-deco, | 552 | div.commit-subject a.branch-deco, |
535 | div.commit-subject a.tag-deco, | 553 | div.commit-subject a.tag-deco, |
536 | div.commit-subject a.remote-deco, | 554 | div.commit-subject a.remote-deco, |
537 | div.commit-subject a.deco { | 555 | div.commit-subject a.deco { |
538 | margin-left: 1em; | 556 | margin-left: 1em; |
539 | font-size: 75%; | 557 | font-size: 75%; |
540 | } | 558 | } |
541 | 559 | ||
542 | table.stats { | 560 | table.stats { |
543 | border: solid 1px black; | 561 | border: solid 1px black; |
544 | border-collapse: collapse; | 562 | border-collapse: collapse; |
545 | } | 563 | } |
546 | 564 | ||
547 | table.stats th { | 565 | table.stats th { |
548 | text-align: left; | 566 | text-align: left; |
549 | padding: 1px 0.5em; | 567 | padding: 1px 0.5em; |
550 | background-color: #eee; | 568 | background-color: #eee; |
551 | border: solid 1px black; | 569 | border: solid 1px black; |
552 | } | 570 | } |
553 | 571 | ||
554 | table.stats td { | 572 | table.stats td { |
555 | text-align: right; | 573 | text-align: right; |
556 | padding: 1px 0.5em; | 574 | padding: 1px 0.5em; |
557 | border: solid 1px black; | 575 | border: solid 1px black; |
558 | } | 576 | } |
559 | 577 | ||
560 | table.stats td.total { | 578 | table.stats td.total { |
561 | font-weight: bold; | 579 | font-weight: bold; |
562 | text-align: left; | 580 | text-align: left; |
563 | } | 581 | } |
564 | 582 | ||
565 | table.stats td.sum { | 583 | table.stats td.sum { |
566 | color: #c00; | 584 | color: #c00; |
567 | font-weight: bold; | 585 | font-weight: bold; |
568 | /*background-color: #eee; */ | 586 | /*background-color: #eee; */ |
569 | } | 587 | } |
570 | 588 | ||
571 | table.stats td.left { | 589 | table.stats td.left { |
572 | text-align: left; | 590 | text-align: left; |
573 | } | 591 | } |
574 | 592 | ||
575 | table.vgraph { | 593 | table.vgraph { |
576 | border-collapse: separate; | 594 | border-collapse: separate; |
577 | border: solid 1px black; | 595 | border: solid 1px black; |
578 | height: 200px; | 596 | height: 200px; |
579 | } | 597 | } |
580 | 598 | ||
581 | table.vgraph th { | 599 | table.vgraph th { |
582 | background-color: #eee; | 600 | background-color: #eee; |
583 | font-weight: bold; | 601 | font-weight: bold; |
584 | border: solid 1px white; | 602 | border: solid 1px white; |
585 | padding: 1px 0.5em; | 603 | padding: 1px 0.5em; |
586 | } | 604 | } |
587 | 605 | ||
588 | table.vgraph td { | 606 | table.vgraph td { |
589 | vertical-align: bottom; | 607 | vertical-align: bottom; |
590 | padding: 0px 10px; | 608 | padding: 0px 10px; |
591 | } | 609 | } |
592 | 610 | ||
593 | table.vgraph div.bar { | 611 | table.vgraph div.bar { |
594 | background-color: #eee; | 612 | background-color: #eee; |
595 | } | 613 | } |
596 | 614 | ||
597 | table.hgraph { | 615 | table.hgraph { |
598 | border: solid 1px black; | 616 | border: solid 1px black; |
599 | width: 800px; | 617 | width: 800px; |
600 | } | 618 | } |
601 | 619 | ||
602 | table.hgraph th { | 620 | table.hgraph th { |
603 | background-color: #eee; | 621 | background-color: #eee; |
604 | font-weight: bold; | 622 | font-weight: bold; |
605 | border: solid 1px black; | 623 | border: solid 1px black; |
606 | padding: 1px 0.5em; | 624 | padding: 1px 0.5em; |
607 | } | 625 | } |
608 | 626 | ||
609 | table.hgraph td { | 627 | table.hgraph td { |
610 | vertical-align: center; | 628 | vertical-align: center; |
611 | padding: 2px 2px; | 629 | padding: 2px 2px; |
612 | } | 630 | } |
613 | 631 | ||
614 | table.hgraph div.bar { | 632 | table.hgraph div.bar { |
615 | background-color: #eee; | 633 | background-color: #eee; |
616 | height: 1em; | 634 | height: 1em; |
617 | } | 635 | } |
618 | 636 | ||
619 | table.ssdiff { | 637 | table.ssdiff { |
620 | width: 100%; | 638 | width: 100%; |
621 | } | 639 | } |
622 | 640 | ||
623 | table.ssdiff td { | 641 | table.ssdiff td { |
624 | font-size: 75%; | 642 | font-size: 75%; |
625 | font-family: monospace; | 643 | font-family: monospace; |
626 | white-space: pre; | 644 | white-space: pre; |
627 | padding: 1px 4px 1px 4px; | 645 | padding: 1px 4px 1px 4px; |
628 | border-left: solid 1px #aaa; | 646 | border-left: solid 1px #aaa; |
629 | border-right: solid 1px #aaa; | 647 | border-right: solid 1px #aaa; |
630 | } | 648 | } |
631 | 649 | ||
632 | table.ssdiff td.add { | 650 | table.ssdiff td.add { |
633 | color: black; | 651 | color: black; |
634 | background: #cfc; | 652 | background: #cfc; |
635 | min-width: 50%; | 653 | min-width: 50%; |
636 | } | 654 | } |
637 | 655 | ||
638 | table.ssdiff td.add_dark { | 656 | table.ssdiff td.add_dark { |
639 | color: black; | 657 | color: black; |
640 | background: #aca; | 658 | background: #aca; |
641 | min-width: 50%; | 659 | min-width: 50%; |
642 | } | 660 | } |
643 | 661 | ||
644 | table.ssdiff span.add { | 662 | table.ssdiff span.add { |
645 | background: #cfc; | 663 | background: #cfc; |
646 | font-weight: bold; | 664 | font-weight: bold; |
647 | } | 665 | } |
648 | 666 | ||
649 | table.ssdiff td.del { | 667 | table.ssdiff td.del { |
650 | color: black; | 668 | color: black; |
651 | background: #fcc; | 669 | background: #fcc; |
652 | min-width: 50%; | 670 | min-width: 50%; |
653 | } | 671 | } |
654 | 672 | ||
655 | table.ssdiff td.del_dark { | 673 | table.ssdiff td.del_dark { |
656 | color: black; | 674 | color: black; |
657 | background: #caa; | 675 | background: #caa; |
658 | min-width: 50%; | 676 | min-width: 50%; |
659 | } | 677 | } |
660 | 678 | ||
661 | table.ssdiff span.del { | 679 | table.ssdiff span.del { |
662 | background: #fcc; | 680 | background: #fcc; |
663 | font-weight: bold; | 681 | font-weight: bold; |
664 | } | 682 | } |
665 | 683 | ||
666 | table.ssdiff td.changed { | 684 | table.ssdiff td.changed { |
667 | color: black; | 685 | color: black; |
668 | background: #ffc; | 686 | background: #ffc; |
669 | min-width: 50%; | 687 | min-width: 50%; |
670 | } | 688 | } |
671 | 689 | ||
672 | table.ssdiff td.changed_dark { | 690 | table.ssdiff td.changed_dark { |
673 | color: black; | 691 | color: black; |
674 | background: #cca; | 692 | background: #cca; |
675 | min-width: 50%; | 693 | min-width: 50%; |
676 | } | 694 | } |
677 | 695 | ||
678 | table.ssdiff td.lineno { | 696 | table.ssdiff td.lineno { |
679 | color: black; | 697 | color: black; |
680 | background: #eee; | 698 | background: #eee; |
681 | text-align: right; | 699 | text-align: right; |
682 | width: 3em; | 700 | width: 3em; |
683 | min-width: 3em; | 701 | min-width: 3em; |
684 | } | 702 | } |
685 | 703 | ||
686 | table.ssdiff td.hunk { | 704 | table.ssdiff td.hunk { |
687 | color: #black; | 705 | color: #black; |
688 | background: #ccf; | 706 | background: #ccf; |
689 | border-top: solid 1px #aaa; | 707 | border-top: solid 1px #aaa; |
690 | border-bottom: solid 1px #aaa; | 708 | border-bottom: solid 1px #aaa; |
691 | } | 709 | } |
692 | 710 | ||
693 | table.ssdiff td.head { | 711 | table.ssdiff td.head { |
694 | border-top: solid 1px #aaa; | 712 | border-top: solid 1px #aaa; |
695 | border-bottom: solid 1px #aaa; | 713 | border-bottom: solid 1px #aaa; |
696 | } | 714 | } |
697 | 715 | ||
698 | table.ssdiff td.head div.head { | 716 | table.ssdiff td.head div.head { |
699 | font-weight: bold; | 717 | font-weight: bold; |
700 | color: black; | 718 | color: black; |
701 | } | 719 | } |
702 | 720 | ||
703 | table.ssdiff td.foot { | 721 | table.ssdiff td.foot { |
704 | border-top: solid 1px #aaa; | 722 | border-top: solid 1px #aaa; |
705 | border-left: none; | 723 | border-left: none; |
706 | border-right: none; | 724 | border-right: none; |
707 | border-bottom: none; | 725 | border-bottom: none; |
708 | } | 726 | } |
709 | 727 | ||
710 | table.ssdiff td.space { | 728 | table.ssdiff td.space { |
711 | border: none; | 729 | border: none; |
712 | } | 730 | } |
713 | 731 | ||
714 | table.ssdiff td.space div { | 732 | table.ssdiff td.space div { |
715 | min-height: 3em; | 733 | min-height: 3em; |
716 | } \ No newline at end of file | 734 | } \ No newline at end of file |
@@ -1,309 +1,310 @@ | |||
1 | #ifndef CGIT_H | 1 | #ifndef CGIT_H |
2 | #define CGIT_H | 2 | #define CGIT_H |
3 | 3 | ||
4 | 4 | ||
5 | #include <git-compat-util.h> | 5 | #include <git-compat-util.h> |
6 | #include <cache.h> | 6 | #include <cache.h> |
7 | #include <grep.h> | 7 | #include <grep.h> |
8 | #include <object.h> | 8 | #include <object.h> |
9 | #include <tree.h> | 9 | #include <tree.h> |
10 | #include <commit.h> | 10 | #include <commit.h> |
11 | #include <tag.h> | 11 | #include <tag.h> |
12 | #include <diff.h> | 12 | #include <diff.h> |
13 | #include <diffcore.h> | 13 | #include <diffcore.h> |
14 | #include <refs.h> | 14 | #include <refs.h> |
15 | #include <revision.h> | 15 | #include <revision.h> |
16 | #include <log-tree.h> | 16 | #include <log-tree.h> |
17 | #include <archive.h> | 17 | #include <archive.h> |
18 | #include <string-list.h> | 18 | #include <string-list.h> |
19 | #include <xdiff-interface.h> | 19 | #include <xdiff-interface.h> |
20 | #include <xdiff/xdiff.h> | 20 | #include <xdiff/xdiff.h> |
21 | #include <utf8.h> | 21 | #include <utf8.h> |
22 | #include <notes.h> | ||
22 | 23 | ||
23 | 24 | ||
24 | /* | 25 | /* |
25 | * Dateformats used on misc. pages | 26 | * Dateformats used on misc. pages |
26 | */ | 27 | */ |
27 | #define FMT_LONGDATE "%Y-%m-%d %H:%M:%S (%Z)" | 28 | #define FMT_LONGDATE "%Y-%m-%d %H:%M:%S (%Z)" |
28 | #define FMT_SHORTDATE "%Y-%m-%d" | 29 | #define FMT_SHORTDATE "%Y-%m-%d" |
29 | #define FMT_ATOMDATE "%Y-%m-%dT%H:%M:%SZ" | 30 | #define FMT_ATOMDATE "%Y-%m-%dT%H:%M:%SZ" |
30 | 31 | ||
31 | 32 | ||
32 | /* | 33 | /* |
33 | * Limits used for relative dates | 34 | * Limits used for relative dates |
34 | */ | 35 | */ |
35 | #define TM_MIN 60 | 36 | #define TM_MIN 60 |
36 | #define TM_HOUR (TM_MIN * 60) | 37 | #define TM_HOUR (TM_MIN * 60) |
37 | #define TM_DAY (TM_HOUR * 24) | 38 | #define TM_DAY (TM_HOUR * 24) |
38 | #define TM_WEEK (TM_DAY * 7) | 39 | #define TM_WEEK (TM_DAY * 7) |
39 | #define TM_YEAR (TM_DAY * 365) | 40 | #define TM_YEAR (TM_DAY * 365) |
40 | #define TM_MONTH (TM_YEAR / 12.0) | 41 | #define TM_MONTH (TM_YEAR / 12.0) |
41 | 42 | ||
42 | 43 | ||
43 | /* | 44 | /* |
44 | * Default encoding | 45 | * Default encoding |
45 | */ | 46 | */ |
46 | #define PAGE_ENCODING "UTF-8" | 47 | #define PAGE_ENCODING "UTF-8" |
47 | 48 | ||
48 | typedef void (*configfn)(const char *name, const char *value); | 49 | typedef void (*configfn)(const char *name, const char *value); |
49 | typedef void (*filepair_fn)(struct diff_filepair *pair); | 50 | typedef void (*filepair_fn)(struct diff_filepair *pair); |
50 | typedef void (*linediff_fn)(char *line, int len); | 51 | typedef void (*linediff_fn)(char *line, int len); |
51 | 52 | ||
52 | struct cgit_filter { | 53 | struct cgit_filter { |
53 | char *cmd; | 54 | char *cmd; |
54 | char **argv; | 55 | char **argv; |
55 | int old_stdout; | 56 | int old_stdout; |
56 | int pipe_fh[2]; | 57 | int pipe_fh[2]; |
57 | int pid; | 58 | int pid; |
58 | int exitstatus; | 59 | int exitstatus; |
59 | }; | 60 | }; |
60 | 61 | ||
61 | struct cgit_repo { | 62 | struct cgit_repo { |
62 | char *url; | 63 | char *url; |
63 | char *name; | 64 | char *name; |
64 | char *path; | 65 | char *path; |
65 | char *desc; | 66 | char *desc; |
66 | char *owner; | 67 | char *owner; |
67 | char *defbranch; | 68 | char *defbranch; |
68 | char *module_link; | 69 | char *module_link; |
69 | char *readme; | 70 | char *readme; |
70 | char *section; | 71 | char *section; |
71 | char *clone_url; | 72 | char *clone_url; |
72 | int snapshots; | 73 | int snapshots; |
73 | int enable_log_filecount; | 74 | int enable_log_filecount; |
74 | int enable_log_linecount; | 75 | int enable_log_linecount; |
75 | int enable_remote_branches; | 76 | int enable_remote_branches; |
76 | int enable_subject_links; | 77 | int enable_subject_links; |
77 | int max_stats; | 78 | int max_stats; |
78 | time_t mtime; | 79 | time_t mtime; |
79 | struct cgit_filter *about_filter; | 80 | struct cgit_filter *about_filter; |
80 | struct cgit_filter *commit_filter; | 81 | struct cgit_filter *commit_filter; |
81 | struct cgit_filter *source_filter; | 82 | struct cgit_filter *source_filter; |
82 | }; | 83 | }; |
83 | 84 | ||
84 | typedef void (*repo_config_fn)(struct cgit_repo *repo, const char *name, | 85 | typedef void (*repo_config_fn)(struct cgit_repo *repo, const char *name, |
85 | const char *value); | 86 | const char *value); |
86 | 87 | ||
87 | struct cgit_repolist { | 88 | struct cgit_repolist { |
88 | int length; | 89 | int length; |
89 | int count; | 90 | int count; |
90 | struct cgit_repo *repos; | 91 | struct cgit_repo *repos; |
91 | }; | 92 | }; |
92 | 93 | ||
93 | struct commitinfo { | 94 | struct commitinfo { |
94 | struct commit *commit; | 95 | struct commit *commit; |
95 | char *author; | 96 | char *author; |
96 | char *author_email; | 97 | char *author_email; |
97 | unsigned long author_date; | 98 | unsigned long author_date; |
98 | char *committer; | 99 | char *committer; |
99 | char *committer_email; | 100 | char *committer_email; |
100 | unsigned long committer_date; | 101 | unsigned long committer_date; |
101 | char *subject; | 102 | char *subject; |
102 | char *msg; | 103 | char *msg; |
103 | char *msg_encoding; | 104 | char *msg_encoding; |
104 | }; | 105 | }; |
105 | 106 | ||
106 | struct taginfo { | 107 | struct taginfo { |
107 | char *tagger; | 108 | char *tagger; |
108 | char *tagger_email; | 109 | char *tagger_email; |
109 | unsigned long tagger_date; | 110 | unsigned long tagger_date; |
110 | char *msg; | 111 | char *msg; |
111 | }; | 112 | }; |
112 | 113 | ||
113 | struct refinfo { | 114 | struct refinfo { |
114 | const char *refname; | 115 | const char *refname; |
115 | struct object *object; | 116 | struct object *object; |
116 | union { | 117 | union { |
117 | struct taginfo *tag; | 118 | struct taginfo *tag; |
118 | struct commitinfo *commit; | 119 | struct commitinfo *commit; |
119 | }; | 120 | }; |
120 | }; | 121 | }; |
121 | 122 | ||
122 | struct reflist { | 123 | struct reflist { |
123 | struct refinfo **refs; | 124 | struct refinfo **refs; |
124 | int alloc; | 125 | int alloc; |
125 | int count; | 126 | int count; |
126 | }; | 127 | }; |
127 | 128 | ||
128 | struct cgit_query { | 129 | struct cgit_query { |
129 | int has_symref; | 130 | int has_symref; |
130 | int has_sha1; | 131 | int has_sha1; |
131 | char *raw; | 132 | char *raw; |
132 | char *repo; | 133 | char *repo; |
133 | char *page; | 134 | char *page; |
134 | char *search; | 135 | char *search; |
135 | char *grep; | 136 | char *grep; |
136 | char *head; | 137 | char *head; |
137 | char *sha1; | 138 | char *sha1; |
138 | char *sha2; | 139 | char *sha2; |
139 | char *path; | 140 | char *path; |
140 | char *name; | 141 | char *name; |
141 | char *mimetype; | 142 | char *mimetype; |
142 | char *url; | 143 | char *url; |
143 | char *period; | 144 | char *period; |
144 | int ofs; | 145 | int ofs; |
145 | int nohead; | 146 | int nohead; |
146 | char *sort; | 147 | char *sort; |
147 | int showmsg; | 148 | int showmsg; |
148 | int ssdiff; | 149 | int ssdiff; |
149 | int show_all; | 150 | int show_all; |
150 | int context; | 151 | int context; |
151 | int ignorews; | 152 | int ignorews; |
152 | char *vpath; | 153 | char *vpath; |
153 | }; | 154 | }; |
154 | 155 | ||
155 | struct cgit_config { | 156 | struct cgit_config { |
156 | char *agefile; | 157 | char *agefile; |
157 | char *cache_root; | 158 | char *cache_root; |
158 | char *clone_prefix; | 159 | char *clone_prefix; |
159 | char *css; | 160 | char *css; |
160 | char *favicon; | 161 | char *favicon; |
161 | char *footer; | 162 | char *footer; |
162 | char *head_include; | 163 | char *head_include; |
163 | char *header; | 164 | char *header; |
164 | char *index_header; | 165 | char *index_header; |
165 | char *index_info; | 166 | char *index_info; |
166 | char *logo; | 167 | char *logo; |
167 | char *logo_link; | 168 | char *logo_link; |
168 | char *module_link; | 169 | char *module_link; |
169 | char *robots; | 170 | char *robots; |
170 | char *root_title; | 171 | char *root_title; |
171 | char *root_desc; | 172 | char *root_desc; |
172 | char *root_readme; | 173 | char *root_readme; |
173 | char *script_name; | 174 | char *script_name; |
174 | char *section; | 175 | char *section; |
175 | char *virtual_root; | 176 | char *virtual_root; |
176 | int cache_size; | 177 | int cache_size; |
177 | int cache_dynamic_ttl; | 178 | int cache_dynamic_ttl; |
178 | int cache_max_create_time; | 179 | int cache_max_create_time; |
179 | int cache_repo_ttl; | 180 | int cache_repo_ttl; |
180 | int cache_root_ttl; | 181 | int cache_root_ttl; |
181 | int cache_scanrc_ttl; | 182 | int cache_scanrc_ttl; |
182 | int cache_static_ttl; | 183 | int cache_static_ttl; |
183 | int embedded; | 184 | int embedded; |
184 | int enable_filter_overrides; | 185 | int enable_filter_overrides; |
185 | int enable_index_links; | 186 | int enable_index_links; |
186 | int enable_log_filecount; | 187 | int enable_log_filecount; |
187 | int enable_log_linecount; | 188 | int enable_log_linecount; |
188 | int enable_remote_branches; | 189 | int enable_remote_branches; |
189 | int enable_subject_links; | 190 | int enable_subject_links; |
190 | int enable_tree_linenumbers; | 191 | int enable_tree_linenumbers; |
191 | int local_time; | 192 | int local_time; |
192 | int max_atom_items; | 193 | int max_atom_items; |
193 | int max_repo_count; | 194 | int max_repo_count; |
194 | int max_commit_count; | 195 | int max_commit_count; |
195 | int max_lock_attempts; | 196 | int max_lock_attempts; |
196 | int max_msg_len; | 197 | int max_msg_len; |
197 | int max_repodesc_len; | 198 | int max_repodesc_len; |
198 | int max_blob_size; | 199 | int max_blob_size; |
199 | int max_stats; | 200 | int max_stats; |
200 | int nocache; | 201 | int nocache; |
201 | int noplainemail; | 202 | int noplainemail; |
202 | int noheader; | 203 | int noheader; |
203 | int renamelimit; | 204 | int renamelimit; |
204 | int snapshots; | 205 | int snapshots; |
205 | int summary_branches; | 206 | int summary_branches; |
206 | int summary_log; | 207 | int summary_log; |
207 | int summary_tags; | 208 | int summary_tags; |
208 | int ssdiff; | 209 | int ssdiff; |
209 | struct string_list mimetypes; | 210 | struct string_list mimetypes; |
210 | struct cgit_filter *about_filter; | 211 | struct cgit_filter *about_filter; |
211 | struct cgit_filter *commit_filter; | 212 | struct cgit_filter *commit_filter; |
212 | struct cgit_filter *source_filter; | 213 | struct cgit_filter *source_filter; |
213 | }; | 214 | }; |
214 | 215 | ||
215 | struct cgit_page { | 216 | struct cgit_page { |
216 | time_t modified; | 217 | time_t modified; |
217 | time_t expires; | 218 | time_t expires; |
218 | size_t size; | 219 | size_t size; |
219 | char *mimetype; | 220 | char *mimetype; |
220 | char *charset; | 221 | char *charset; |
221 | char *filename; | 222 | char *filename; |
222 | char *etag; | 223 | char *etag; |
223 | char *title; | 224 | char *title; |
224 | int status; | 225 | int status; |
225 | char *statusmsg; | 226 | char *statusmsg; |
226 | }; | 227 | }; |
227 | 228 | ||
228 | struct cgit_environment { | 229 | struct cgit_environment { |
229 | char *cgit_config; | 230 | char *cgit_config; |
230 | char *http_host; | 231 | char *http_host; |
231 | char *https; | 232 | char *https; |
232 | char *no_http; | 233 | char *no_http; |
233 | char *path_info; | 234 | char *path_info; |
234 | char *query_string; | 235 | char *query_string; |
235 | char *request_method; | 236 | char *request_method; |
236 | char *script_name; | 237 | char *script_name; |
237 | char *server_name; | 238 | char *server_name; |
238 | char *server_port; | 239 | char *server_port; |
239 | }; | 240 | }; |
240 | 241 | ||
241 | struct cgit_context { | 242 | struct cgit_context { |
242 | struct cgit_environment env; | 243 | struct cgit_environment env; |
243 | struct cgit_query qry; | 244 | struct cgit_query qry; |
244 | struct cgit_config cfg; | 245 | struct cgit_config cfg; |
245 | struct cgit_repo *repo; | 246 | struct cgit_repo *repo; |
246 | struct cgit_page page; | 247 | struct cgit_page page; |
247 | }; | 248 | }; |
248 | 249 | ||
249 | struct cgit_snapshot_format { | 250 | struct cgit_snapshot_format { |
250 | const char *suffix; | 251 | const char *suffix; |
251 | const char *mimetype; | 252 | const char *mimetype; |
252 | write_archive_fn_t write_func; | 253 | write_archive_fn_t write_func; |
253 | int bit; | 254 | int bit; |
254 | }; | 255 | }; |
255 | 256 | ||
256 | extern const char *cgit_version; | 257 | extern const char *cgit_version; |
257 | 258 | ||
258 | extern struct cgit_repolist cgit_repolist; | 259 | extern struct cgit_repolist cgit_repolist; |
259 | extern struct cgit_context ctx; | 260 | extern struct cgit_context ctx; |
260 | extern const struct cgit_snapshot_format cgit_snapshot_formats[]; | 261 | extern const struct cgit_snapshot_format cgit_snapshot_formats[]; |
261 | 262 | ||
262 | extern struct cgit_repo *cgit_add_repo(const char *url); | 263 | extern struct cgit_repo *cgit_add_repo(const char *url); |
263 | extern struct cgit_repo *cgit_get_repoinfo(const char *url); | 264 | extern struct cgit_repo *cgit_get_repoinfo(const char *url); |
264 | extern void cgit_repo_config_cb(const char *name, const char *value); | 265 | extern void cgit_repo_config_cb(const char *name, const char *value); |
265 | 266 | ||
266 | extern int chk_zero(int result, char *msg); | 267 | extern int chk_zero(int result, char *msg); |
267 | extern int chk_positive(int result, char *msg); | 268 | extern int chk_positive(int result, char *msg); |
268 | extern int chk_non_negative(int result, char *msg); | 269 | extern int chk_non_negative(int result, char *msg); |
269 | 270 | ||
270 | extern char *trim_end(const char *str, char c); | 271 | extern char *trim_end(const char *str, char c); |
271 | extern char *strlpart(char *txt, int maxlen); | 272 | extern char *strlpart(char *txt, int maxlen); |
272 | extern char *strrpart(char *txt, int maxlen); | 273 | extern char *strrpart(char *txt, int maxlen); |
273 | 274 | ||
274 | extern void cgit_add_ref(struct reflist *list, struct refinfo *ref); | 275 | extern void cgit_add_ref(struct reflist *list, struct refinfo *ref); |
275 | extern int cgit_refs_cb(const char *refname, const unsigned char *sha1, | 276 | extern int cgit_refs_cb(const char *refname, const unsigned char *sha1, |
276 | int flags, void *cb_data); | 277 | int flags, void *cb_data); |
277 | 278 | ||
278 | extern void *cgit_free_commitinfo(struct commitinfo *info); | 279 | extern void *cgit_free_commitinfo(struct commitinfo *info); |
279 | 280 | ||
280 | extern int cgit_diff_files(const unsigned char *old_sha1, | 281 | extern int cgit_diff_files(const unsigned char *old_sha1, |
281 | const unsigned char *new_sha1, | 282 | const unsigned char *new_sha1, |
282 | unsigned long *old_size, unsigned long *new_size, | 283 | unsigned long *old_size, unsigned long *new_size, |
283 | int *binary, int context, int ignorews, | 284 | int *binary, int context, int ignorews, |
284 | linediff_fn fn); | 285 | linediff_fn fn); |
285 | 286 | ||
286 | extern void cgit_diff_tree(const unsigned char *old_sha1, | 287 | extern void cgit_diff_tree(const unsigned char *old_sha1, |
287 | const unsigned char *new_sha1, | 288 | const unsigned char *new_sha1, |
288 | filepair_fn fn, const char *prefix, int ignorews); | 289 | filepair_fn fn, const char *prefix, int ignorews); |
289 | 290 | ||
290 | extern void cgit_diff_commit(struct commit *commit, filepair_fn fn); | 291 | extern void cgit_diff_commit(struct commit *commit, filepair_fn fn); |
291 | 292 | ||
292 | extern char *fmt(const char *format,...); | 293 | extern char *fmt(const char *format,...); |
293 | 294 | ||
294 | extern struct commitinfo *cgit_parse_commit(struct commit *commit); | 295 | extern struct commitinfo *cgit_parse_commit(struct commit *commit); |
295 | extern struct taginfo *cgit_parse_tag(struct tag *tag); | 296 | extern struct taginfo *cgit_parse_tag(struct tag *tag); |
296 | extern void cgit_parse_url(const char *url); | 297 | extern void cgit_parse_url(const char *url); |
297 | 298 | ||
298 | extern const char *cgit_repobasename(const char *reponame); | 299 | extern const char *cgit_repobasename(const char *reponame); |
299 | 300 | ||
300 | extern int cgit_parse_snapshots_mask(const char *str); | 301 | extern int cgit_parse_snapshots_mask(const char *str); |
301 | 302 | ||
302 | extern int cgit_open_filter(struct cgit_filter *filter); | 303 | extern int cgit_open_filter(struct cgit_filter *filter); |
303 | extern int cgit_close_filter(struct cgit_filter *filter); | 304 | extern int cgit_close_filter(struct cgit_filter *filter); |
304 | 305 | ||
305 | extern int readfile(const char *path, char **buf, size_t *size); | 306 | extern int readfile(const char *path, char **buf, size_t *size); |
306 | 307 | ||
307 | extern char *expand_macros(const char *txt); | 308 | extern char *expand_macros(const char *txt); |
308 | 309 | ||
309 | #endif /* CGIT_H */ | 310 | #endif /* CGIT_H */ |
diff --git a/ui-commit.c b/ui-commit.c index a11bc5f..45af450 100644 --- a/ui-commit.c +++ b/ui-commit.c | |||
@@ -1,131 +1,146 @@ | |||
1 | /* ui-commit.c: generate commit view | 1 | /* ui-commit.c: generate commit view |
2 | * | 2 | * |
3 | * Copyright (C) 2006 Lars Hjemli | 3 | * Copyright (C) 2006 Lars Hjemli |
4 | * | 4 | * |
5 | * Licensed under GNU General Public License v2 | 5 | * Licensed under GNU General Public License v2 |
6 | * (see COPYING for full license text) | 6 | * (see COPYING for full license text) |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "cgit.h" | 9 | #include "cgit.h" |
10 | #include "html.h" | 10 | #include "html.h" |
11 | #include "ui-shared.h" | 11 | #include "ui-shared.h" |
12 | #include "ui-diff.h" | 12 | #include "ui-diff.h" |
13 | #include "ui-log.h" | 13 | #include "ui-log.h" |
14 | 14 | ||
15 | void cgit_print_commit(char *hex, const char *prefix) | 15 | void cgit_print_commit(char *hex, const char *prefix) |
16 | { | 16 | { |
17 | struct commit *commit, *parent; | 17 | struct commit *commit, *parent; |
18 | struct commitinfo *info, *parent_info; | 18 | struct commitinfo *info, *parent_info; |
19 | struct commit_list *p; | 19 | struct commit_list *p; |
20 | struct strbuf notes = STRBUF_INIT; | ||
20 | unsigned char sha1[20]; | 21 | unsigned char sha1[20]; |
21 | char *tmp, *tmp2; | 22 | char *tmp, *tmp2; |
22 | int parents = 0; | 23 | int parents = 0; |
23 | 24 | ||
24 | if (!hex) | 25 | if (!hex) |
25 | hex = ctx.qry.head; | 26 | hex = ctx.qry.head; |
26 | 27 | ||
27 | if (get_sha1(hex, sha1)) { | 28 | if (get_sha1(hex, sha1)) { |
28 | cgit_print_error(fmt("Bad object id: %s", hex)); | 29 | cgit_print_error(fmt("Bad object id: %s", hex)); |
29 | return; | 30 | return; |
30 | } | 31 | } |
31 | commit = lookup_commit_reference(sha1); | 32 | commit = lookup_commit_reference(sha1); |
32 | if (!commit) { | 33 | if (!commit) { |
33 | cgit_print_error(fmt("Bad commit reference: %s", hex)); | 34 | cgit_print_error(fmt("Bad commit reference: %s", hex)); |
34 | return; | 35 | return; |
35 | } | 36 | } |
36 | info = cgit_parse_commit(commit); | 37 | info = cgit_parse_commit(commit); |
37 | 38 | ||
39 | get_commit_notes(commit, ¬es, PAGE_ENCODING, 0); | ||
40 | |||
38 | load_ref_decorations(DECORATE_FULL_REFS); | 41 | load_ref_decorations(DECORATE_FULL_REFS); |
39 | 42 | ||
40 | html("<table summary='commit info' class='commit-info'>\n"); | 43 | html("<table summary='commit info' class='commit-info'>\n"); |
41 | html("<tr><th>author</th><td>"); | 44 | html("<tr><th>author</th><td>"); |
42 | html_txt(info->author); | 45 | html_txt(info->author); |
43 | if (!ctx.cfg.noplainemail) { | 46 | if (!ctx.cfg.noplainemail) { |
44 | html(" "); | 47 | html(" "); |
45 | html_txt(info->author_email); | 48 | html_txt(info->author_email); |
46 | } | 49 | } |
47 | html("</td><td class='right'>"); | 50 | html("</td><td class='right'>"); |
48 | cgit_print_date(info->author_date, FMT_LONGDATE, ctx.cfg.local_time); | 51 | cgit_print_date(info->author_date, FMT_LONGDATE, ctx.cfg.local_time); |
49 | html("</td></tr>\n"); | 52 | html("</td></tr>\n"); |
50 | html("<tr><th>committer</th><td>"); | 53 | html("<tr><th>committer</th><td>"); |
51 | html_txt(info->committer); | 54 | html_txt(info->committer); |
52 | if (!ctx.cfg.noplainemail) { | 55 | if (!ctx.cfg.noplainemail) { |
53 | html(" "); | 56 | html(" "); |
54 | html_txt(info->committer_email); | 57 | html_txt(info->committer_email); |
55 | } | 58 | } |
56 | html("</td><td class='right'>"); | 59 | html("</td><td class='right'>"); |
57 | cgit_print_date(info->committer_date, FMT_LONGDATE, ctx.cfg.local_time); | 60 | cgit_print_date(info->committer_date, FMT_LONGDATE, ctx.cfg.local_time); |
58 | html("</td></tr>\n"); | 61 | html("</td></tr>\n"); |
59 | html("<tr><th>commit</th><td colspan='2' class='sha1'>"); | 62 | html("<tr><th>commit</th><td colspan='2' class='sha1'>"); |
60 | tmp = sha1_to_hex(commit->object.sha1); | 63 | tmp = sha1_to_hex(commit->object.sha1); |
61 | cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp, prefix, 0); | 64 | cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp, prefix, 0); |
62 | html(" ("); | 65 | html(" ("); |
63 | cgit_patch_link("patch", NULL, NULL, NULL, tmp, prefix); | 66 | cgit_patch_link("patch", NULL, NULL, NULL, tmp, prefix); |
64 | html(") ("); | 67 | html(") ("); |
65 | if ((ctx.qry.ssdiff && !ctx.cfg.ssdiff) || (!ctx.qry.ssdiff && ctx.cfg.ssdiff)) | 68 | if ((ctx.qry.ssdiff && !ctx.cfg.ssdiff) || (!ctx.qry.ssdiff && ctx.cfg.ssdiff)) |
66 | cgit_commit_link("unidiff", NULL, NULL, ctx.qry.head, tmp, prefix, 1); | 69 | cgit_commit_link("unidiff", NULL, NULL, ctx.qry.head, tmp, prefix, 1); |
67 | else | 70 | else |
68 | cgit_commit_link("side-by-side diff", NULL, NULL, ctx.qry.head, tmp, prefix, 1); | 71 | cgit_commit_link("side-by-side diff", NULL, NULL, ctx.qry.head, tmp, prefix, 1); |
69 | html(")</td></tr>\n"); | 72 | html(")</td></tr>\n"); |
70 | html("<tr><th>tree</th><td colspan='2' class='sha1'>"); | 73 | html("<tr><th>tree</th><td colspan='2' class='sha1'>"); |
71 | tmp = xstrdup(hex); | 74 | tmp = xstrdup(hex); |
72 | cgit_tree_link(sha1_to_hex(commit->tree->object.sha1), NULL, NULL, | 75 | cgit_tree_link(sha1_to_hex(commit->tree->object.sha1), NULL, NULL, |
73 | ctx.qry.head, tmp, NULL); | 76 | ctx.qry.head, tmp, NULL); |
74 | if (prefix) { | 77 | if (prefix) { |
75 | html(" /"); | 78 | html(" /"); |
76 | cgit_tree_link(prefix, NULL, NULL, ctx.qry.head, tmp, prefix); | 79 | cgit_tree_link(prefix, NULL, NULL, ctx.qry.head, tmp, prefix); |
77 | } | 80 | } |
78 | html("</td></tr>\n"); | 81 | html("</td></tr>\n"); |
79 | for (p = commit->parents; p ; p = p->next) { | 82 | for (p = commit->parents; p ; p = p->next) { |
80 | parent = lookup_commit_reference(p->item->object.sha1); | 83 | parent = lookup_commit_reference(p->item->object.sha1); |
81 | if (!parent) { | 84 | if (!parent) { |
82 | html("<tr><td colspan='3'>"); | 85 | html("<tr><td colspan='3'>"); |
83 | cgit_print_error("Error reading parent commit"); | 86 | cgit_print_error("Error reading parent commit"); |
84 | html("</td></tr>"); | 87 | html("</td></tr>"); |
85 | continue; | 88 | continue; |
86 | } | 89 | } |
87 | html("<tr><th>parent</th>" | 90 | html("<tr><th>parent</th>" |
88 | "<td colspan='2' class='sha1'>"); | 91 | "<td colspan='2' class='sha1'>"); |
89 | tmp = tmp2 = sha1_to_hex(p->item->object.sha1); | 92 | tmp = tmp2 = sha1_to_hex(p->item->object.sha1); |
90 | if (ctx.repo->enable_subject_links) { | 93 | if (ctx.repo->enable_subject_links) { |
91 | parent_info = cgit_parse_commit(parent); | 94 | parent_info = cgit_parse_commit(parent); |
92 | tmp2 = parent_info->subject; | 95 | tmp2 = parent_info->subject; |
93 | } | 96 | } |
94 | cgit_commit_link(tmp2, NULL, NULL, ctx.qry.head, tmp, prefix, 0); | 97 | cgit_commit_link(tmp2, NULL, NULL, ctx.qry.head, tmp, prefix, 0); |
95 | html(" ("); | 98 | html(" ("); |
96 | cgit_diff_link("diff", NULL, NULL, ctx.qry.head, hex, | 99 | cgit_diff_link("diff", NULL, NULL, ctx.qry.head, hex, |
97 | sha1_to_hex(p->item->object.sha1), prefix, 0); | 100 | sha1_to_hex(p->item->object.sha1), prefix, 0); |
98 | html(")</td></tr>"); | 101 | html(")</td></tr>"); |
99 | parents++; | 102 | parents++; |
100 | } | 103 | } |
101 | if (ctx.repo->snapshots) { | 104 | if (ctx.repo->snapshots) { |
102 | html("<tr><th>download</th><td colspan='2' class='sha1'>"); | 105 | html("<tr><th>download</th><td colspan='2' class='sha1'>"); |
103 | cgit_print_snapshot_links(ctx.qry.repo, ctx.qry.head, | 106 | cgit_print_snapshot_links(ctx.qry.repo, ctx.qry.head, |
104 | hex, ctx.repo->snapshots); | 107 | hex, ctx.repo->snapshots); |
105 | html("</td></tr>"); | 108 | html("</td></tr>"); |
106 | } | 109 | } |
107 | html("</table>\n"); | 110 | html("</table>\n"); |
108 | html("<div class='commit-subject'>"); | 111 | html("<div class='commit-subject'>"); |
109 | if (ctx.repo->commit_filter) | 112 | if (ctx.repo->commit_filter) |
110 | cgit_open_filter(ctx.repo->commit_filter); | 113 | cgit_open_filter(ctx.repo->commit_filter); |
111 | html_txt(info->subject); | 114 | html_txt(info->subject); |
112 | if (ctx.repo->commit_filter) | 115 | if (ctx.repo->commit_filter) |
113 | cgit_close_filter(ctx.repo->commit_filter); | 116 | cgit_close_filter(ctx.repo->commit_filter); |
114 | show_commit_decorations(commit); | 117 | show_commit_decorations(commit); |
115 | html("</div>"); | 118 | html("</div>"); |
116 | html("<div class='commit-msg'>"); | 119 | html("<div class='commit-msg'>"); |
117 | if (ctx.repo->commit_filter) | 120 | if (ctx.repo->commit_filter) |
118 | cgit_open_filter(ctx.repo->commit_filter); | 121 | cgit_open_filter(ctx.repo->commit_filter); |
119 | html_txt(info->msg); | 122 | html_txt(info->msg); |
120 | if (ctx.repo->commit_filter) | 123 | if (ctx.repo->commit_filter) |
121 | cgit_close_filter(ctx.repo->commit_filter); | 124 | cgit_close_filter(ctx.repo->commit_filter); |
122 | html("</div>"); | 125 | html("</div>"); |
126 | if (notes.len != 0) { | ||
127 | html("<div class='notes-header'>Notes</div>"); | ||
128 | html("<div class='notes'>"); | ||
129 | if (ctx.repo->commit_filter) | ||
130 | cgit_open_filter(ctx.repo->commit_filter); | ||
131 | html_txt(notes.buf); | ||
132 | if (ctx.repo->commit_filter) | ||
133 | cgit_close_filter(ctx.repo->commit_filter); | ||
134 | html("</div>"); | ||
135 | html("<div class='notes-footer'></div>"); | ||
136 | } | ||
123 | if (parents < 3) { | 137 | if (parents < 3) { |
124 | if (parents) | 138 | if (parents) |
125 | tmp = sha1_to_hex(commit->parents->item->object.sha1); | 139 | tmp = sha1_to_hex(commit->parents->item->object.sha1); |
126 | else | 140 | else |
127 | tmp = NULL; | 141 | tmp = NULL; |
128 | cgit_print_diff(ctx.qry.sha1, tmp, prefix); | 142 | cgit_print_diff(ctx.qry.sha1, tmp, prefix); |
129 | } | 143 | } |
144 | strbuf_release(¬es); | ||
130 | cgit_free_commitinfo(info); | 145 | cgit_free_commitinfo(info); |
131 | } | 146 | } |