-rw-r--r-- | cgit.css | 34 | ||||
-rw-r--r-- | ui-repolist.c | 24 |
2 files changed, 43 insertions, 15 deletions
@@ -230,131 +230,161 @@ div.commit-subject { | |||
230 | margin: 1.5em 0em 0.5em 0em; | 230 | margin: 1.5em 0em 0.5em 0em; |
231 | padding: 0em; | 231 | padding: 0em; |
232 | } | 232 | } |
233 | 233 | ||
234 | div.commit-msg { | 234 | div.commit-msg { |
235 | white-space: pre; | 235 | white-space: pre; |
236 | font-family: monospace; | 236 | font-family: monospace; |
237 | } | 237 | } |
238 | 238 | ||
239 | div.diffstat-header { | 239 | div.diffstat-header { |
240 | font-weight: bold; | 240 | font-weight: bold; |
241 | padding-top: 1.5em; | 241 | padding-top: 1.5em; |
242 | } | 242 | } |
243 | 243 | ||
244 | table.diffstat { | 244 | table.diffstat { |
245 | border-collapse: collapse; | 245 | border-collapse: collapse; |
246 | width: 100%; | 246 | width: 100%; |
247 | border: solid 1px #aaa; | 247 | border: solid 1px #aaa; |
248 | background-color: #eee; | 248 | background-color: #eee; |
249 | } | 249 | } |
250 | 250 | ||
251 | table.diffstat tr:hover { | 251 | table.diffstat tr:hover { |
252 | background-color: #ccc; | 252 | background-color: #ccc; |
253 | } | 253 | } |
254 | 254 | ||
255 | table.diffstat th { | 255 | table.diffstat th { |
256 | font-weight: normal; | 256 | font-weight: normal; |
257 | text-align: left; | 257 | text-align: left; |
258 | text-decoration: underline; | 258 | text-decoration: underline; |
259 | padding: 0.1em 1em 0.1em 0.1em; | 259 | padding: 0.1em 1em 0.1em 0.1em; |
260 | font-size: 100%; | 260 | font-size: 100%; |
261 | } | 261 | } |
262 | 262 | ||
263 | table.diffstat td { | 263 | table.diffstat td { |
264 | padding: 0.2em 0.2em 0.1em 0.1em; | 264 | padding: 0.2em 0.2em 0.1em 0.1em; |
265 | font-size: 100%; | 265 | font-size: 100%; |
266 | border: none; | 266 | border: none; |
267 | } | 267 | } |
268 | 268 | ||
269 | table.diffstat td.mode { | 269 | table.diffstat td.mode { |
270 | white-space: nowrap; | 270 | white-space: nowrap; |
271 | } | 271 | } |
272 | 272 | ||
273 | table.diffstat td span.modechange { | 273 | table.diffstat td span.modechange { |
274 | padding-left: 1em; | 274 | padding-left: 1em; |
275 | color: red; | 275 | color: red; |
276 | } | 276 | } |
277 | 277 | ||
278 | table.diffstat td.add a { | 278 | table.diffstat td.add a { |
279 | color: green; | 279 | color: green; |
280 | } | 280 | } |
281 | 281 | ||
282 | table.diffstat td.del a { | 282 | table.diffstat td.del a { |
283 | color: red; | 283 | color: red; |
284 | } | 284 | } |
285 | 285 | ||
286 | table.diffstat td.upd a { | 286 | table.diffstat td.upd a { |
287 | color: blue; | 287 | color: blue; |
288 | } | 288 | } |
289 | 289 | ||
290 | table.diffstat td.graph { | 290 | table.diffstat td.graph { |
291 | width: 75%; | 291 | width: 75%; |
292 | vertical-align: center; | 292 | vertical-align: center; |
293 | } | 293 | } |
294 | 294 | ||
295 | table.diffstat td.graph table { | 295 | table.diffstat td.graph table { |
296 | border: none; | 296 | border: none; |
297 | } | 297 | } |
298 | 298 | ||
299 | table.diffstat td.graph td { | 299 | table.diffstat td.graph td { |
300 | padding: 0px; | 300 | padding: 0px; |
301 | border: 0px; | 301 | border: 0px; |
302 | height: 7pt; | 302 | height: 7pt; |
303 | } | 303 | } |
304 | 304 | ||
305 | table.diffstat td.graph td.add { | 305 | table.diffstat td.graph td.add { |
306 | background-color: #5c5; | 306 | background-color: #5c5; |
307 | } | 307 | } |
308 | 308 | ||
309 | table.diffstat td.graph td.rem { | 309 | table.diffstat td.graph td.rem { |
310 | background-color: #c55; | 310 | background-color: #c55; |
311 | } | 311 | } |
312 | 312 | ||
313 | table.diffstat td.graph td.none { | 313 | table.diffstat td.graph td.none { |
314 | background-color: none; | 314 | background-color: none; |
315 | } | 315 | } |
316 | 316 | ||
317 | div.diffstat-summary { | 317 | div.diffstat-summary { |
318 | color: #888; | 318 | color: #888; |
319 | padding-top: 0.5em; | 319 | padding-top: 0.5em; |
320 | } | 320 | } |
321 | 321 | ||
322 | table.diff td { | 322 | table.diff td { |
323 | font-family: monospace; | 323 | font-family: monospace; |
324 | white-space: pre; | 324 | white-space: pre; |
325 | } | 325 | } |
326 | 326 | ||
327 | table.diff td div.head { | 327 | table.diff td div.head { |
328 | font-weight: bold; | 328 | font-weight: bold; |
329 | padding-top: 1em; | 329 | padding-top: 1em; |
330 | } | 330 | } |
331 | 331 | ||
332 | table.diff td div.hunk { | 332 | table.diff td div.hunk { |
333 | color: #009; | 333 | color: #009; |
334 | } | 334 | } |
335 | 335 | ||
336 | table.diff td div.add { | 336 | table.diff td div.add { |
337 | color: green; | 337 | color: green; |
338 | } | 338 | } |
339 | 339 | ||
340 | table.diff td div.del { | 340 | table.diff td div.del { |
341 | color: red; | 341 | color: red; |
342 | } | 342 | } |
343 | 343 | ||
344 | .sha1 { | 344 | .sha1 { |
345 | font-family: courier; | 345 | font-family: courier; |
346 | font-size: 90%; | 346 | font-size: 90%; |
347 | } | 347 | } |
348 | 348 | ||
349 | .left { | 349 | .left { |
350 | text-align: left; | 350 | text-align: left; |
351 | } | 351 | } |
352 | 352 | ||
353 | .right { | 353 | .right { |
354 | text-align: right; | 354 | text-align: right; |
355 | } | 355 | } |
356 | 356 | ||
357 | table.list td.repogroup { | 357 | table.list td.repogroup { |
358 | padding-top: 1em; | 358 | font-style: italic; |
359 | border-bottom: solid 1px #777; | 359 | color: #888; |
360 | } | ||
361 | |||
362 | a.button { | ||
363 | font-size: 80%; | ||
364 | color: #333; | ||
365 | background-color: #ccc; | ||
366 | border: solid 1px #999; | ||
367 | padding: 0em 0.5em; | ||
368 | margin: 0.1em 0.25em; | ||
369 | } | ||
370 | |||
371 | a.button:hover { | ||
372 | text-decoration: none; | ||
373 | background-color: #eee; | ||
374 | } | ||
375 | |||
376 | a.primary { | ||
377 | font-size: 100%; | ||
378 | } | ||
379 | |||
380 | a.secondary { | ||
381 | font-size: 90%; | ||
382 | } | ||
383 | |||
384 | td.toplevel-repo { | ||
385 | |||
386 | } | ||
387 | |||
388 | table.list td.sublevel-repo { | ||
389 | padding-left: 1.5em; | ||
360 | } | 390 | } |
diff --git a/ui-repolist.c b/ui-repolist.c index 33e3e7f..f5e087f 100644 --- a/ui-repolist.c +++ b/ui-repolist.c | |||
@@ -1,68 +1,66 @@ | |||
1 | /* ui-repolist.c: functions for generating the repolist page | 1 | /* ui-repolist.c: functions for generating the repolist page |
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 | 10 | ||
11 | void cgit_print_repolist(struct cacheitem *item) | 11 | void cgit_print_repolist(struct cacheitem *item) |
12 | { | 12 | { |
13 | struct repoinfo *repo; | 13 | struct repoinfo *repo; |
14 | int i; | 14 | int i; |
15 | char *last_group = NULL; | 15 | char *last_group = NULL; |
16 | 16 | ||
17 | cgit_print_docstart(cgit_root_title, item); | 17 | cgit_print_docstart(cgit_root_title, item); |
18 | cgit_print_pageheader(cgit_root_title, 0); | 18 | cgit_print_pageheader(cgit_root_title, 0); |
19 | 19 | ||
20 | html("<table class='list nowrap'>"); | 20 | html("<table class='list nowrap'>"); |
21 | if (cgit_index_header) { | 21 | if (cgit_index_header) { |
22 | html("<tr class='nohover'><td colspan='4' class='include-block'>"); | 22 | html("<tr class='nohover'><td colspan='4' class='include-block'>"); |
23 | html_include(cgit_index_header); | 23 | html_include(cgit_index_header); |
24 | html("</td></tr>"); | 24 | html("</td></tr>"); |
25 | } | 25 | } |
26 | html("<tr class='nohover'>" | 26 | html("<tr class='nohover'>" |
27 | "<th class='left'>Name</th>" | 27 | "<th class='left'>Name</th>" |
28 | "<th class='left'>Description</th>" | 28 | "<th class='left'>Description</th>" |
29 | "<th class='left'>Owner</th>" | 29 | "<th class='left'>Owner</th>" |
30 | "<th class='left'>Links</th></tr>\n"); | 30 | "<th>Links</th></tr>\n"); |
31 | 31 | ||
32 | for (i=0; i<cgit_repolist.count; i++) { | 32 | for (i=0; i<cgit_repolist.count; i++) { |
33 | repo = &cgit_repolist.repos[i]; | 33 | repo = &cgit_repolist.repos[i]; |
34 | if ((last_group == NULL && repo->group != NULL) || | 34 | if ((last_group == NULL && repo->group != NULL) || |
35 | (last_group != NULL && repo->group == NULL) || | 35 | (last_group != NULL && repo->group == NULL) || |
36 | (last_group != NULL && repo->group!= NULL && | 36 | (last_group != NULL && repo->group!= NULL && |
37 | strcmp(repo->group, last_group))) { | 37 | strcmp(repo->group, last_group))) { |
38 | html("<tr class='nohover'><td colspan='4' class='repogroup'>"); | 38 | html("<tr class='nohover'><td colspan='4' class='repogroup'>"); |
39 | html_txt(repo->group); | 39 | html_txt(repo->group); |
40 | html("</td></tr>"); | 40 | html("</td></tr>"); |
41 | last_group = repo->group; | 41 | last_group = repo->group; |
42 | } | 42 | } |
43 | html("<tr><td>"); | 43 | htmlf("<tr><td class='%s'>", |
44 | html_link_open(cgit_repourl(repo->url), NULL, NULL); | 44 | repo->group ? "sublevel-repo" : "toplevel-repo"); |
45 | html_link_open(cgit_repourl(repo->url), repo->desc, NULL); | ||
45 | html_txt(repo->name); | 46 | html_txt(repo->name); |
46 | html_link_close(); | 47 | html_link_close(); |
47 | html("</td><td>"); | 48 | html("</td><td>"); |
48 | html_ntxt(cgit_max_repodesc_len, repo->desc); | 49 | html_ntxt(cgit_max_repodesc_len, repo->desc); |
49 | html("</td><td>"); | 50 | html("</td><td>"); |
50 | html_txt(repo->owner); | 51 | html_txt(repo->owner); |
51 | html("</td><td>"); | 52 | html("</td><td>"); |
52 | html_link_open(cgit_pageurl(repo->name, "commit", NULL), | 53 | html_link_open(cgit_repourl(repo->url), |
53 | "Commit: display last commit", NULL); | 54 | "Summary", "button"); |
54 | html("C</a> "); | 55 | html("S</a>"); |
55 | html_link_open(cgit_pageurl(repo->name, "diff", NULL), | ||
56 | "Diff: see changes introduced by last commit", NULL); | ||
57 | html("D</a> "); | ||
58 | html_link_open(cgit_pageurl(repo->name, "log", NULL), | 56 | html_link_open(cgit_pageurl(repo->name, "log", NULL), |
59 | "Log: show history of the main branch", NULL); | 57 | "Log", "button"); |
60 | html("L</a> "); | 58 | html("L</a>"); |
61 | html_link_open(cgit_pageurl(repo->name, "tree", NULL), | 59 | html_link_open(cgit_pageurl(repo->name, "tree", NULL), |
62 | "Tree: browse the files in the main branch", NULL); | 60 | "Files", "button"); |
63 | html("T</a>"); | 61 | html("F</a>"); |
64 | html("</td></tr>\n"); | 62 | html("</td></tr>\n"); |
65 | } | 63 | } |
66 | html("</table>"); | 64 | html("</table>"); |
67 | cgit_print_docend(); | 65 | cgit_print_docend(); |
68 | } | 66 | } |