|
diff --git a/cgit.css b/cgit.css index a37d218..7928c2f 100644 --- a/ cgit.css+++ b/ cgit.css |
|
@@ -1,458 +1,473 @@ |
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 2px #ccc; */ |
67 | /* border-bottom: solid 2px #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.content { |
105 | div.content { |
106 | margin: 0px; |
106 | margin: 0px; |
107 | padding: 2em; |
107 | padding: 2em; |
108 | border-top: solid 3px #ccc; |
108 | border-top: solid 3px #ccc; |
109 | border-bottom: solid 3px #ccc; |
109 | border-bottom: solid 3px #ccc; |
110 | } |
110 | } |
111 | |
111 | |
112 | |
112 | |
113 | table.list { |
113 | table.list { |
114 | width: 100%; |
114 | width: 100%; |
115 | border: none; |
115 | border: none; |
116 | border-collapse: collapse; |
116 | border-collapse: collapse; |
117 | } |
117 | } |
118 | |
118 | |
119 | table.list tr { |
119 | table.list tr { |
120 | background: white; |
120 | background: white; |
121 | } |
121 | } |
122 | |
122 | |
| |
123 | table.list tr.logheader { |
| |
124 | background: #eee; |
| |
125 | } |
| |
126 | |
123 | table.list tr:hover { |
127 | table.list tr:hover { |
124 | background: #eee; |
128 | background: #eee; |
125 | } |
129 | } |
126 | |
130 | |
127 | table.list tr.nohover:hover { |
131 | table.list tr.nohover:hover { |
128 | background: white; |
132 | background: white; |
129 | } |
133 | } |
130 | |
134 | |
131 | table.list th { |
135 | table.list th { |
132 | font-weight: bold; |
136 | font-weight: bold; |
133 | /* color: #888; |
137 | /* color: #888; |
134 | border-top: dashed 1px #888; |
138 | border-top: dashed 1px #888; |
135 | border-bottom: dashed 1px #888; |
139 | border-bottom: dashed 1px #888; |
136 | */ |
140 | */ |
137 | padding: 0.1em 0.5em 0.05em 0.5em; |
141 | padding: 0.1em 0.5em 0.05em 0.5em; |
138 | vertical-align: baseline; |
142 | vertical-align: baseline; |
139 | } |
143 | } |
140 | |
144 | |
141 | table.list td { |
145 | table.list td { |
142 | border: none; |
146 | border: none; |
143 | padding: 0.1em 0.5em 0.1em 0.5em; |
147 | padding: 0.1em 0.5em 0.1em 0.5em; |
144 | } |
148 | } |
145 | |
149 | |
| |
150 | table.list td.logsubject { |
| |
151 | font-family: monospace; |
| |
152 | font-weight: bold; |
| |
153 | } |
| |
154 | |
| |
155 | table.list td.logmsg { |
| |
156 | font-family: monospace; |
| |
157 | white-space: pre; |
| |
158 | padding: 1em 0em 2em 0em; |
| |
159 | } |
| |
160 | |
146 | table.list td a { |
161 | table.list td a { |
147 | color: black; |
162 | color: black; |
148 | } |
163 | } |
149 | |
164 | |
150 | table.list td a:hover { |
165 | table.list td a:hover { |
151 | color: #00f; |
166 | color: #00f; |
152 | } |
167 | } |
153 | |
168 | |
154 | img { |
169 | img { |
155 | border: none; |
170 | border: none; |
156 | } |
171 | } |
157 | |
172 | |
158 | input#switch-btn { |
173 | input#switch-btn { |
159 | margin: 2px 0px 0px 0px; |
174 | margin: 2px 0px 0px 0px; |
160 | } |
175 | } |
161 | |
176 | |
162 | td#sidebar input.txt { |
177 | td#sidebar input.txt { |
163 | width: 100%; |
178 | width: 100%; |
164 | margin: 2px 0px 0px 0px; |
179 | margin: 2px 0px 0px 0px; |
165 | } |
180 | } |
166 | |
181 | |
167 | table#grid { |
182 | table#grid { |
168 | margin: 0px; |
183 | margin: 0px; |
169 | } |
184 | } |
170 | |
185 | |
171 | td#content { |
186 | td#content { |
172 | vertical-align: top; |
187 | vertical-align: top; |
173 | padding: 1em 2em 1em 1em; |
188 | padding: 1em 2em 1em 1em; |
174 | border: none; |
189 | border: none; |
175 | } |
190 | } |
176 | |
191 | |
177 | div#summary { |
192 | div#summary { |
178 | vertical-align: top; |
193 | vertical-align: top; |
179 | margin-bottom: 1em; |
194 | margin-bottom: 1em; |
180 | } |
195 | } |
181 | |
196 | |
182 | table#downloads { |
197 | table#downloads { |
183 | float: right; |
198 | float: right; |
184 | border-collapse: collapse; |
199 | border-collapse: collapse; |
185 | border: solid 1px #777; |
200 | border: solid 1px #777; |
186 | margin-left: 0.5em; |
201 | margin-left: 0.5em; |
187 | margin-bottom: 0.5em; |
202 | margin-bottom: 0.5em; |
188 | } |
203 | } |
189 | |
204 | |
190 | table#downloads th { |
205 | table#downloads th { |
191 | background-color: #ccc; |
206 | background-color: #ccc; |
192 | } |
207 | } |
193 | |
208 | |
194 | div#blob { |
209 | div#blob { |
195 | border: solid 1px black; |
210 | border: solid 1px black; |
196 | } |
211 | } |
197 | |
212 | |
198 | div.error { |
213 | div.error { |
199 | color: red; |
214 | color: red; |
200 | font-weight: bold; |
215 | font-weight: bold; |
201 | margin: 1em 2em; |
216 | margin: 1em 2em; |
202 | } |
217 | } |
203 | |
218 | |
204 | a.ls-blob, a.ls-dir, a.ls-mod { |
219 | a.ls-blob, a.ls-dir, a.ls-mod { |
205 | font-family: monospace; |
220 | font-family: monospace; |
206 | } |
221 | } |
207 | |
222 | |
208 | td.ls-size { |
223 | td.ls-size { |
209 | text-align: right; |
224 | text-align: right; |
210 | font-family: monospace; |
225 | font-family: monospace; |
211 | width: 10em; |
226 | width: 10em; |
212 | } |
227 | } |
213 | |
228 | |
214 | td.ls-mode { |
229 | td.ls-mode { |
215 | font-family: monospace; |
230 | font-family: monospace; |
216 | width: 10em; |
231 | width: 10em; |
217 | } |
232 | } |
218 | |
233 | |
219 | table.blob { |
234 | table.blob { |
220 | margin-top: 0.5em; |
235 | margin-top: 0.5em; |
221 | border-top: solid 1px black; |
236 | border-top: solid 1px black; |
222 | } |
237 | } |
223 | |
238 | |
224 | table.blob td.no { |
239 | table.blob td.no { |
225 | border-right: solid 1px black; |
240 | border-right: solid 1px black; |
226 | color: black; |
241 | color: black; |
227 | background-color: #eee; |
242 | background-color: #eee; |
228 | text-align: right; |
243 | text-align: right; |
229 | } |
244 | } |
230 | |
245 | |
231 | table.blob td.no a { |
246 | table.blob td.no a { |
232 | color: black; |
247 | color: black; |
233 | } |
248 | } |
234 | |
249 | |
235 | table.blob td.no a:hover { |
250 | table.blob td.no a:hover { |
236 | color: black; |
251 | color: black; |
237 | text-decoration: none; |
252 | text-decoration: none; |
238 | } |
253 | } |
239 | |
254 | |
240 | table.blob td.txt { |
255 | table.blob td.txt { |
241 | white-space: pre; |
256 | white-space: pre; |
242 | font-family: monospace; |
257 | font-family: monospace; |
243 | padding-left: 0.5em; |
258 | padding-left: 0.5em; |
244 | } |
259 | } |
245 | |
260 | |
246 | table.nowrap td { |
261 | table.nowrap td { |
247 | white-space: nowrap; |
262 | white-space: nowrap; |
248 | } |
263 | } |
249 | |
264 | |
250 | table.commit-info { |
265 | table.commit-info { |
251 | border-collapse: collapse; |
266 | border-collapse: collapse; |
252 | margin-top: 1.5em; |
267 | margin-top: 1.5em; |
253 | } |
268 | } |
254 | |
269 | |
255 | table.commit-info th { |
270 | table.commit-info th { |
256 | text-align: left; |
271 | text-align: left; |
257 | font-weight: normal; |
272 | font-weight: normal; |
258 | padding: 0.1em 1em 0.1em 0.1em; |
273 | padding: 0.1em 1em 0.1em 0.1em; |
259 | vertical-align: top; |
274 | vertical-align: top; |
260 | } |
275 | } |
261 | |
276 | |
262 | table.commit-info td { |
277 | table.commit-info td { |
263 | font-weight: normal; |
278 | font-weight: normal; |
264 | padding: 0.1em 1em 0.1em 0.1em; |
279 | padding: 0.1em 1em 0.1em 0.1em; |
265 | } |
280 | } |
266 | |
281 | |
267 | div.commit-subject { |
282 | div.commit-subject { |
268 | font-weight: bold; |
283 | font-weight: bold; |
269 | font-size: 125%; |
284 | font-size: 125%; |
270 | margin: 1.5em 0em 0.5em 0em; |
285 | margin: 1.5em 0em 0.5em 0em; |
271 | padding: 0em; |
286 | padding: 0em; |
272 | } |
287 | } |
273 | |
288 | |
274 | div.commit-msg { |
289 | div.commit-msg { |
275 | white-space: pre; |
290 | white-space: pre; |
276 | font-family: monospace; |
291 | font-family: monospace; |
277 | } |
292 | } |
278 | |
293 | |
279 | div.diffstat-header { |
294 | div.diffstat-header { |
280 | font-weight: bold; |
295 | font-weight: bold; |
281 | padding-top: 1.5em; |
296 | padding-top: 1.5em; |
282 | } |
297 | } |
283 | |
298 | |
284 | table.diffstat { |
299 | table.diffstat { |
285 | border-collapse: collapse; |
300 | border-collapse: collapse; |
286 | border: solid 1px #aaa; |
301 | border: solid 1px #aaa; |
287 | background-color: #eee; |
302 | background-color: #eee; |
288 | } |
303 | } |
289 | |
304 | |
290 | table.diffstat th { |
305 | table.diffstat th { |
291 | font-weight: normal; |
306 | font-weight: normal; |
292 | text-align: left; |
307 | text-align: left; |
293 | text-decoration: underline; |
308 | text-decoration: underline; |
294 | padding: 0.1em 1em 0.1em 0.1em; |
309 | padding: 0.1em 1em 0.1em 0.1em; |
295 | font-size: 100%; |
310 | font-size: 100%; |
296 | } |
311 | } |
297 | |
312 | |
298 | table.diffstat td { |
313 | table.diffstat td { |
299 | padding: 0.2em 0.2em 0.1em 0.1em; |
314 | padding: 0.2em 0.2em 0.1em 0.1em; |
300 | font-size: 100%; |
315 | font-size: 100%; |
301 | border: none; |
316 | border: none; |
302 | } |
317 | } |
303 | |
318 | |
304 | table.diffstat td.mode { |
319 | table.diffstat td.mode { |
305 | white-space: nowrap; |
320 | white-space: nowrap; |
306 | } |
321 | } |
307 | |
322 | |
308 | table.diffstat td span.modechange { |
323 | table.diffstat td span.modechange { |
309 | padding-left: 1em; |
324 | padding-left: 1em; |
310 | color: red; |
325 | color: red; |
311 | } |
326 | } |
312 | |
327 | |
313 | table.diffstat td.add a { |
328 | table.diffstat td.add a { |
314 | color: green; |
329 | color: green; |
315 | } |
330 | } |
316 | |
331 | |
317 | table.diffstat td.del a { |
332 | table.diffstat td.del a { |
318 | color: red; |
333 | color: red; |
319 | } |
334 | } |
320 | |
335 | |
321 | table.diffstat td.upd a { |
336 | table.diffstat td.upd a { |
322 | color: blue; |
337 | color: blue; |
323 | } |
338 | } |
324 | |
339 | |
325 | table.diffstat td.graph { |
340 | table.diffstat td.graph { |
326 | width: 500px; |
341 | width: 500px; |
327 | vertical-align: middle; |
342 | vertical-align: middle; |
328 | } |
343 | } |
329 | |
344 | |
330 | table.diffstat td.graph table { |
345 | table.diffstat td.graph table { |
331 | border: none; |
346 | border: none; |
332 | } |
347 | } |
333 | |
348 | |
334 | table.diffstat td.graph td { |
349 | table.diffstat td.graph td { |
335 | padding: 0px; |
350 | padding: 0px; |
336 | border: 0px; |
351 | border: 0px; |
337 | height: 7pt; |
352 | height: 7pt; |
338 | } |
353 | } |
339 | |
354 | |
340 | table.diffstat td.graph td.add { |
355 | table.diffstat td.graph td.add { |
341 | background-color: #5c5; |
356 | background-color: #5c5; |
342 | } |
357 | } |
343 | |
358 | |
344 | table.diffstat td.graph td.rem { |
359 | table.diffstat td.graph td.rem { |
345 | background-color: #c55; |
360 | background-color: #c55; |
346 | } |
361 | } |
347 | |
362 | |
348 | div.diffstat-summary { |
363 | div.diffstat-summary { |
349 | color: #888; |
364 | color: #888; |
350 | padding-top: 0.5em; |
365 | padding-top: 0.5em; |
351 | } |
366 | } |
352 | |
367 | |
353 | table.diff { |
368 | table.diff { |
354 | width: 100%; |
369 | width: 100%; |
355 | } |
370 | } |
356 | |
371 | |
357 | table.diff td { |
372 | table.diff td { |
358 | font-family: monospace; |
373 | font-family: monospace; |
359 | white-space: pre; |
374 | white-space: pre; |
360 | } |
375 | } |
361 | |
376 | |
362 | table.diff td div.head { |
377 | table.diff td div.head { |
363 | font-weight: bold; |
378 | font-weight: bold; |
364 | margin-top: 1em; |
379 | margin-top: 1em; |
365 | color: black; |
380 | color: black; |
366 | } |
381 | } |
367 | |
382 | |
368 | table.diff td div.hunk { |
383 | table.diff td div.hunk { |
369 | color: #009; |
384 | color: #009; |
370 | } |
385 | } |
371 | |
386 | |
372 | table.diff td div.add { |
387 | table.diff td div.add { |
373 | color: green; |
388 | color: green; |
374 | } |
389 | } |
375 | |
390 | |
376 | table.diff td div.del { |
391 | table.diff td div.del { |
377 | color: red; |
392 | color: red; |
378 | } |
393 | } |
379 | |
394 | |
380 | .sha1 { |
395 | .sha1 { |
381 | font-family: monospace; |
396 | font-family: monospace; |
382 | font-size: 90%; |
397 | font-size: 90%; |
383 | } |
398 | } |
384 | |
399 | |
385 | .left { |
400 | .left { |
386 | text-align: left; |
401 | text-align: left; |
387 | } |
402 | } |
388 | |
403 | |
389 | .right { |
404 | .right { |
390 | text-align: right; |
405 | text-align: right; |
391 | } |
406 | } |
392 | |
407 | |
393 | table.list td.repogroup { |
408 | table.list td.repogroup { |
394 | font-style: italic; |
409 | font-style: italic; |
395 | color: #888; |
410 | color: #888; |
396 | } |
411 | } |
397 | |
412 | |
398 | a.button { |
413 | a.button { |
399 | font-size: 80%; |
414 | font-size: 80%; |
400 | padding: 0em 0.5em; |
415 | padding: 0em 0.5em; |
401 | } |
416 | } |
402 | |
417 | |
403 | a.primary { |
418 | a.primary { |
404 | font-size: 100%; |
419 | font-size: 100%; |
405 | } |
420 | } |
406 | |
421 | |
407 | a.secondary { |
422 | a.secondary { |
408 | font-size: 90%; |
423 | font-size: 90%; |
409 | } |
424 | } |
410 | |
425 | |
411 | td.toplevel-repo { |
426 | td.toplevel-repo { |
412 | |
427 | |
413 | } |
428 | } |
414 | |
429 | |
415 | table.list td.sublevel-repo { |
430 | table.list td.sublevel-repo { |
416 | padding-left: 1.5em; |
431 | padding-left: 1.5em; |
417 | } |
432 | } |
418 | |
433 | |
419 | div.pager { |
434 | div.pager { |
420 | text-align: center; |
435 | text-align: center; |
421 | margin: 1em 0em 0em 0em; |
436 | margin: 1em 0em 0em 0em; |
422 | } |
437 | } |
423 | |
438 | |
424 | div.pager a { |
439 | div.pager a { |
425 | color: #777; |
440 | color: #777; |
426 | margin: 0em 0.5em; |
441 | margin: 0em 0.5em; |
427 | } |
442 | } |
428 | |
443 | |
429 | span.age-mins { |
444 | span.age-mins { |
430 | font-weight: bold; |
445 | font-weight: bold; |
431 | color: #080; |
446 | color: #080; |
432 | } |
447 | } |
433 | |
448 | |
434 | span.age-hours { |
449 | span.age-hours { |
435 | color: #080; |
450 | color: #080; |
436 | } |
451 | } |
437 | |
452 | |
438 | span.age-days { |
453 | span.age-days { |
439 | color: #040; |
454 | color: #040; |
440 | } |
455 | } |
441 | |
456 | |
442 | span.age-weeks { |
457 | span.age-weeks { |
443 | color: #444; |
458 | color: #444; |
444 | } |
459 | } |
445 | |
460 | |
446 | span.age-months { |
461 | span.age-months { |
447 | color: #888; |
462 | color: #888; |
448 | } |
463 | } |
449 | |
464 | |
450 | span.age-years { |
465 | span.age-years { |
451 | color: #bbb; |
466 | color: #bbb; |
452 | } |
467 | } |
453 | div.footer { |
468 | div.footer { |
454 | margin-top: 0.5em; |
469 | margin-top: 0.5em; |
455 | text-align: center; |
470 | text-align: center; |
456 | font-size: 80%; |
471 | font-size: 80%; |
457 | color: #ccc; |
472 | color: #ccc; |
458 | } |
473 | } |
|
|
diff --git a/ui-log.c b/ui-log.c index adc9a66..00ecd4e 100644 --- a/ ui-log.c+++ b/ ui-log.c |
|
@@ -1,178 +1,176 @@ |
1 | /* ui-log.c: functions for log output |
1 | /* ui-log.c: functions for log output |
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 | |
12 | |
13 | int files, add_lines, rem_lines; |
13 | int files, add_lines, rem_lines; |
14 | |
14 | |
15 | void count_lines(char *line, int size) |
15 | void count_lines(char *line, int size) |
16 | { |
16 | { |
17 | if (size <= 0) |
17 | if (size <= 0) |
18 | return; |
18 | return; |
19 | |
19 | |
20 | if (line[0] == '+') |
20 | if (line[0] == '+') |
21 | add_lines++; |
21 | add_lines++; |
22 | |
22 | |
23 | else if (line[0] == '-') |
23 | else if (line[0] == '-') |
24 | rem_lines++; |
24 | rem_lines++; |
25 | } |
25 | } |
26 | |
26 | |
27 | void inspect_files(struct diff_filepair *pair) |
27 | void inspect_files(struct diff_filepair *pair) |
28 | { |
28 | { |
29 | files++; |
29 | files++; |
30 | if (ctx.repo->enable_log_linecount) |
30 | if (ctx.repo->enable_log_linecount) |
31 | cgit_diff_files(pair->one->sha1, pair->two->sha1, count_lines); |
31 | cgit_diff_files(pair->one->sha1, pair->two->sha1, count_lines); |
32 | } |
32 | } |
33 | |
33 | |
34 | void print_commit(struct commit *commit) |
34 | void print_commit(struct commit *commit) |
35 | { |
35 | { |
36 | struct commitinfo *info; |
36 | struct commitinfo *info; |
37 | char *tmp; |
37 | char *tmp; |
38 | int cols = 2; |
38 | int cols = 2; |
39 | |
39 | |
40 | info = cgit_parse_commit(commit); |
40 | info = cgit_parse_commit(commit); |
41 | html("<tr><td>"); |
41 | htmlf("<tr%s><td>", |
| |
42 | ctx.qry.showmsg ? " class='logheader'" : ""); |
42 | tmp = fmt("id=%s", sha1_to_hex(commit->object.sha1)); |
43 | tmp = fmt("id=%s", sha1_to_hex(commit->object.sha1)); |
43 | tmp = cgit_pageurl(ctx.repo->url, "commit", tmp); |
44 | tmp = cgit_pageurl(ctx.repo->url, "commit", tmp); |
44 | html_link_open(tmp, NULL, NULL); |
45 | html_link_open(tmp, NULL, NULL); |
45 | cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE); |
46 | cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE); |
46 | html_link_close(); |
47 | html_link_close(); |
47 | html("</td><td>"); |
48 | htmlf("</td><td%s>", |
48 | if (ctx.qry.showmsg) |
49 | ctx.qry.showmsg ? " class='logsubject'" : ""); |
49 | html("<u>"); |
| |
50 | cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, |
50 | cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, |
51 | sha1_to_hex(commit->object.sha1)); |
51 | sha1_to_hex(commit->object.sha1)); |
52 | if (ctx.qry.showmsg) |
| |
53 | html("</u>"); |
| |
54 | html("</td><td>"); |
52 | html("</td><td>"); |
55 | html_txt(info->author); |
53 | html_txt(info->author); |
56 | if (ctx.repo->enable_log_filecount) { |
54 | if (ctx.repo->enable_log_filecount) { |
57 | files = 0; |
55 | files = 0; |
58 | add_lines = 0; |
56 | add_lines = 0; |
59 | rem_lines = 0; |
57 | rem_lines = 0; |
60 | cgit_diff_commit(commit, inspect_files); |
58 | cgit_diff_commit(commit, inspect_files); |
61 | html("</td><td>"); |
59 | html("</td><td>"); |
62 | htmlf("%d", files); |
60 | htmlf("%d", files); |
63 | if (ctx.repo->enable_log_linecount) { |
61 | if (ctx.repo->enable_log_linecount) { |
64 | html("</td><td>"); |
62 | html("</td><td>"); |
65 | htmlf("-%d/+%d", rem_lines, add_lines); |
63 | htmlf("-%d/+%d", rem_lines, add_lines); |
66 | } |
64 | } |
67 | } |
65 | } |
68 | html("</td></tr>\n"); |
66 | html("</td></tr>\n"); |
69 | if (ctx.qry.showmsg) { |
67 | if (ctx.qry.showmsg) { |
70 | if (ctx.repo->enable_log_filecount) { |
68 | if (ctx.repo->enable_log_filecount) { |
71 | cols++; |
69 | cols++; |
72 | if (ctx.repo->enable_log_linecount) |
70 | if (ctx.repo->enable_log_linecount) |
73 | cols++; |
71 | cols++; |
74 | } |
72 | } |
75 | htmlf("<tr class='nohover'><td></td><td colspan='%d'><div class='commit-msg'>", |
73 | htmlf("<tr class='nohover'><td/><td colspan='%d' class='logmsg'>", |
76 | cols); |
74 | cols); |
77 | html_txt(info->msg); |
75 | html_txt(info->msg); |
78 | html("</div><br/></td></tr>\n"); |
76 | html("</td></tr>\n"); |
79 | } |
77 | } |
80 | cgit_free_commitinfo(info); |
78 | cgit_free_commitinfo(info); |
81 | } |
79 | } |
82 | |
80 | |
83 | |
81 | |
84 | void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern, |
82 | void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern, |
85 | char *path, int pager) |
83 | char *path, int pager) |
86 | { |
84 | { |
87 | struct rev_info rev; |
85 | struct rev_info rev; |
88 | struct commit *commit; |
86 | struct commit *commit; |
89 | const char *argv[] = {NULL, tip, NULL, NULL, NULL}; |
87 | const char *argv[] = {NULL, tip, NULL, NULL, NULL}; |
90 | int argc = 2; |
88 | int argc = 2; |
91 | int i, columns = 3; |
89 | int i, columns = 3; |
92 | |
90 | |
93 | if (!tip) |
91 | if (!tip) |
94 | argv[1] = ctx.qry.head; |
92 | argv[1] = ctx.qry.head; |
95 | |
93 | |
96 | if (grep && pattern && (!strcmp(grep, "grep") || |
94 | if (grep && pattern && (!strcmp(grep, "grep") || |
97 | !strcmp(grep, "author") || |
95 | !strcmp(grep, "author") || |
98 | !strcmp(grep, "committer"))) |
96 | !strcmp(grep, "committer"))) |
99 | argv[argc++] = fmt("--%s=%s", grep, pattern); |
97 | argv[argc++] = fmt("--%s=%s", grep, pattern); |
100 | |
98 | |
101 | if (path) { |
99 | if (path) { |
102 | argv[argc++] = "--"; |
100 | argv[argc++] = "--"; |
103 | argv[argc++] = path; |
101 | argv[argc++] = path; |
104 | } |
102 | } |
105 | init_revisions(&rev, NULL); |
103 | init_revisions(&rev, NULL); |
106 | rev.abbrev = DEFAULT_ABBREV; |
104 | rev.abbrev = DEFAULT_ABBREV; |
107 | rev.commit_format = CMIT_FMT_DEFAULT; |
105 | rev.commit_format = CMIT_FMT_DEFAULT; |
108 | rev.verbose_header = 1; |
106 | rev.verbose_header = 1; |
109 | rev.show_root_diff = 0; |
107 | rev.show_root_diff = 0; |
110 | setup_revisions(argc, argv, &rev, NULL); |
108 | setup_revisions(argc, argv, &rev, NULL); |
111 | rev.grep_filter.regflags |= REG_ICASE; |
109 | rev.grep_filter.regflags |= REG_ICASE; |
112 | compile_grep_patterns(&rev.grep_filter); |
110 | compile_grep_patterns(&rev.grep_filter); |
113 | prepare_revision_walk(&rev); |
111 | prepare_revision_walk(&rev); |
114 | |
112 | |
115 | if (pager) |
113 | if (pager) |
116 | html("<table class='list nowrap'>"); |
114 | html("<table class='list nowrap'>"); |
117 | |
115 | |
118 | html("<tr class='nohover'><th class='left'>Age</th>" |
116 | html("<tr class='nohover'><th class='left'>Age</th>" |
119 | "<th class='left'>Commit message"); |
117 | "<th class='left'>Commit message"); |
120 | if (pager) { |
118 | if (pager) { |
121 | html(" ("); |
119 | html(" ("); |
122 | cgit_log_link("toggle", NULL, NULL, ctx.qry.head, ctx.qry.sha1, |
120 | cgit_log_link("toggle", NULL, NULL, ctx.qry.head, ctx.qry.sha1, |
123 | ctx.qry.path, ctx.qry.ofs, ctx.qry.grep, |
121 | ctx.qry.path, ctx.qry.ofs, ctx.qry.grep, |
124 | ctx.qry.search, ctx.qry.showmsg ? 0 : 1); |
122 | ctx.qry.search, ctx.qry.showmsg ? 0 : 1); |
125 | html(")"); |
123 | html(")"); |
126 | } |
124 | } |
127 | html("</th><th class='left'>Author</th>"); |
125 | html("</th><th class='left'>Author</th>"); |
128 | if (ctx.repo->enable_log_filecount) { |
126 | if (ctx.repo->enable_log_filecount) { |
129 | html("<th class='left'>Files</th>"); |
127 | html("<th class='left'>Files</th>"); |
130 | columns++; |
128 | columns++; |
131 | if (ctx.repo->enable_log_linecount) { |
129 | if (ctx.repo->enable_log_linecount) { |
132 | html("<th class='left'>Lines</th>"); |
130 | html("<th class='left'>Lines</th>"); |
133 | columns++; |
131 | columns++; |
134 | } |
132 | } |
135 | } |
133 | } |
136 | html("</tr>\n"); |
134 | html("</tr>\n"); |
137 | |
135 | |
138 | if (ofs<0) |
136 | if (ofs<0) |
139 | ofs = 0; |
137 | ofs = 0; |
140 | |
138 | |
141 | for (i = 0; i < ofs && (commit = get_revision(&rev)) != NULL; i++) { |
139 | for (i = 0; i < ofs && (commit = get_revision(&rev)) != NULL; i++) { |
142 | free(commit->buffer); |
140 | free(commit->buffer); |
143 | commit->buffer = NULL; |
141 | commit->buffer = NULL; |
144 | free_commit_list(commit->parents); |
142 | free_commit_list(commit->parents); |
145 | commit->parents = NULL; |
143 | commit->parents = NULL; |
146 | } |
144 | } |
147 | |
145 | |
148 | for (i = 0; i < cnt && (commit = get_revision(&rev)) != NULL; i++) { |
146 | for (i = 0; i < cnt && (commit = get_revision(&rev)) != NULL; i++) { |
149 | print_commit(commit); |
147 | print_commit(commit); |
150 | free(commit->buffer); |
148 | free(commit->buffer); |
151 | commit->buffer = NULL; |
149 | commit->buffer = NULL; |
152 | free_commit_list(commit->parents); |
150 | free_commit_list(commit->parents); |
153 | commit->parents = NULL; |
151 | commit->parents = NULL; |
154 | } |
152 | } |
155 | if (pager) { |
153 | if (pager) { |
156 | htmlf("</table><div class='pager'>", |
154 | htmlf("</table><div class='pager'>", |
157 | columns); |
155 | columns); |
158 | if (ofs > 0) { |
156 | if (ofs > 0) { |
159 | cgit_log_link("[prev]", NULL, NULL, ctx.qry.head, |
157 | cgit_log_link("[prev]", NULL, NULL, ctx.qry.head, |
160 | ctx.qry.sha1, ctx.qry.path, |
158 | ctx.qry.sha1, ctx.qry.path, |
161 | ofs - cnt, ctx.qry.grep, |
159 | ofs - cnt, ctx.qry.grep, |
162 | ctx.qry.search, ctx.qry.showmsg); |
160 | ctx.qry.search, ctx.qry.showmsg); |
163 | html(" "); |
161 | html(" "); |
164 | } |
162 | } |
165 | if ((commit = get_revision(&rev)) != NULL) { |
163 | if ((commit = get_revision(&rev)) != NULL) { |
166 | cgit_log_link("[next]", NULL, NULL, ctx.qry.head, |
164 | cgit_log_link("[next]", NULL, NULL, ctx.qry.head, |
167 | ctx.qry.sha1, ctx.qry.path, |
165 | ctx.qry.sha1, ctx.qry.path, |
168 | ofs + cnt, ctx.qry.grep, |
166 | ofs + cnt, ctx.qry.grep, |
169 | ctx.qry.search, ctx.qry.showmsg); |
167 | ctx.qry.search, ctx.qry.showmsg); |
170 | } |
168 | } |
171 | html("</div>"); |
169 | html("</div>"); |
172 | } else if ((commit = get_revision(&rev)) != NULL) { |
170 | } else if ((commit = get_revision(&rev)) != NULL) { |
173 | html("<tr class='nohover'><td colspan='3'>"); |
171 | html("<tr class='nohover'><td colspan='3'>"); |
174 | cgit_log_link("[...]", NULL, NULL, ctx.qry.head, NULL, NULL, 0, |
172 | cgit_log_link("[...]", NULL, NULL, ctx.qry.head, NULL, NULL, 0, |
175 | NULL, NULL, ctx.qry.showmsg); |
173 | NULL, NULL, ctx.qry.showmsg); |
176 | html("</td></tr>\n"); |
174 | html("</td></tr>\n"); |
177 | } |
175 | } |
178 | } |
176 | } |
|