author | Lars Hjemli <hjemli@gmail.com> | 2007-05-20 20:13:17 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-05-20 20:13:17 (UTC) |
commit | 271ac5a7e6b5b67f54fdd16e8542aa282f1c7140 (patch) (unidiff) | |
tree | d93a0bce06fca8db57ed1a98aa5e2e45199af845 /ui-repolist.c | |
parent | dc3ac3f76077c5d612d42e8beb4878e43acfc58a (diff) | |
parent | 7b39144a541ab5be8bcd2748a5be89389bee7192 (diff) | |
download | cgit-271ac5a7e6b5b67f54fdd16e8542aa282f1c7140.zip cgit-271ac5a7e6b5b67f54fdd16e8542aa282f1c7140.tar.gz cgit-271ac5a7e6b5b67f54fdd16e8542aa282f1c7140.tar.bz2 |
Merge branch 'repogroups'
* repogroups:
Adjust apperance of repogroup headers
Don't highlight repogroup headings
Teach cgit how to group repositories by category
-rw-r--r-- | ui-repolist.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ui-repolist.c b/ui-repolist.c index 8e367a2..33e3e7f 100644 --- a/ui-repolist.c +++ b/ui-repolist.c | |||
@@ -1,58 +1,68 @@ | |||
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 | 16 | ||
16 | cgit_print_docstart(cgit_root_title, item); | 17 | cgit_print_docstart(cgit_root_title, item); |
17 | cgit_print_pageheader(cgit_root_title, 0); | 18 | cgit_print_pageheader(cgit_root_title, 0); |
18 | 19 | ||
19 | html("<table class='list nowrap'>"); | 20 | html("<table class='list nowrap'>"); |
20 | if (cgit_index_header) { | 21 | if (cgit_index_header) { |
21 | html("<tr class='nohover'><td colspan='4' class='include-block'>"); | 22 | html("<tr class='nohover'><td colspan='4' class='include-block'>"); |
22 | html_include(cgit_index_header); | 23 | html_include(cgit_index_header); |
23 | html("</td></tr>"); | 24 | html("</td></tr>"); |
24 | } | 25 | } |
25 | html("<tr class='nohover'>" | 26 | html("<tr class='nohover'>" |
26 | "<th class='left'>Name</th>" | 27 | "<th class='left'>Name</th>" |
27 | "<th class='left'>Description</th>" | 28 | "<th class='left'>Description</th>" |
28 | "<th class='left'>Owner</th>" | 29 | "<th class='left'>Owner</th>" |
29 | "<th class='left'>Links</th></tr>\n"); | 30 | "<th class='left'>Links</th></tr>\n"); |
30 | 31 | ||
31 | for (i=0; i<cgit_repolist.count; i++) { | 32 | for (i=0; i<cgit_repolist.count; i++) { |
32 | repo = &cgit_repolist.repos[i]; | 33 | repo = &cgit_repolist.repos[i]; |
34 | if ((last_group == NULL && repo->group != NULL) || | ||
35 | (last_group != NULL && repo->group == NULL) || | ||
36 | (last_group != NULL && repo->group!= NULL && | ||
37 | strcmp(repo->group, last_group))) { | ||
38 | html("<tr class='nohover'><td colspan='4' class='repogroup'>"); | ||
39 | html_txt(repo->group); | ||
40 | html("</td></tr>"); | ||
41 | last_group = repo->group; | ||
42 | } | ||
33 | html("<tr><td>"); | 43 | html("<tr><td>"); |
34 | html_link_open(cgit_repourl(repo->url), NULL, NULL); | 44 | html_link_open(cgit_repourl(repo->url), NULL, NULL); |
35 | html_txt(repo->name); | 45 | html_txt(repo->name); |
36 | html_link_close(); | 46 | html_link_close(); |
37 | html("</td><td>"); | 47 | html("</td><td>"); |
38 | html_ntxt(cgit_max_repodesc_len, repo->desc); | 48 | html_ntxt(cgit_max_repodesc_len, repo->desc); |
39 | html("</td><td>"); | 49 | html("</td><td>"); |
40 | html_txt(repo->owner); | 50 | html_txt(repo->owner); |
41 | html("</td><td>"); | 51 | html("</td><td>"); |
42 | html_link_open(cgit_pageurl(repo->name, "commit", NULL), | 52 | html_link_open(cgit_pageurl(repo->name, "commit", NULL), |
43 | "Commit: display last commit", NULL); | 53 | "Commit: display last commit", NULL); |
44 | html("C</a> "); | 54 | html("C</a> "); |
45 | html_link_open(cgit_pageurl(repo->name, "diff", NULL), | 55 | html_link_open(cgit_pageurl(repo->name, "diff", NULL), |
46 | "Diff: see changes introduced by last commit", NULL); | 56 | "Diff: see changes introduced by last commit", NULL); |
47 | html("D</a> "); | 57 | html("D</a> "); |
48 | html_link_open(cgit_pageurl(repo->name, "log", NULL), | 58 | html_link_open(cgit_pageurl(repo->name, "log", NULL), |
49 | "Log: show history of the main branch", NULL); | 59 | "Log: show history of the main branch", NULL); |
50 | html("L</a> "); | 60 | html("L</a> "); |
51 | html_link_open(cgit_pageurl(repo->name, "tree", NULL), | 61 | html_link_open(cgit_pageurl(repo->name, "tree", NULL), |
52 | "Tree: browse the files in the main branch", NULL); | 62 | "Tree: browse the files in the main branch", NULL); |
53 | html("T</a>"); | 63 | html("T</a>"); |
54 | html("</td></tr>\n"); | 64 | html("</td></tr>\n"); |
55 | } | 65 | } |
56 | html("</table>"); | 66 | html("</table>"); |
57 | cgit_print_docend(); | 67 | cgit_print_docend(); |
58 | } | 68 | } |