summaryrefslogtreecommitdiffabout
path: root/ui-repolist.c
Unidiff
Diffstat (limited to 'ui-repolist.c') (more/less context) (ignore whitespace changes)
-rw-r--r--ui-repolist.c35
1 files changed, 23 insertions, 12 deletions
diff --git a/ui-repolist.c b/ui-repolist.c
index 2018dab..4c86543 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -46,5 +46,8 @@ void cgit_print_repolist(struct cacheitem *item)
46{ 46{
47 int i; 47 int i, columns = 4;
48 char *last_group = NULL; 48 char *last_group = NULL;
49 49
50 if (cgit_enable_index_links)
51 columns++;
52
50 cgit_print_docstart(cgit_root_title, item); 53 cgit_print_docstart(cgit_root_title, item);
@@ -54,3 +57,4 @@ void cgit_print_repolist(struct cacheitem *item)
54 if (cgit_index_header) { 57 if (cgit_index_header) {
55 html("<tr class='nohover'><td colspan='5' class='include-block'>"); 58 htmlf("<tr class='nohover'><td colspan='%d' class='include-block'>",
59 columns);
56 html_include(cgit_index_header); 60 html_include(cgit_index_header);
@@ -62,4 +66,6 @@ void cgit_print_repolist(struct cacheitem *item)
62 "<th class='left'>Owner</th>" 66 "<th class='left'>Owner</th>"
63 "<th class='left'>Idle</th>" 67 "<th class='left'>Idle</th>");
64 "<th>Links</th></tr>\n"); 68 if (cgit_enable_index_links)
69 html("<th>Links</th>");
70 html("</tr>\n");
65 71
@@ -71,3 +77,4 @@ void cgit_print_repolist(struct cacheitem *item)
71 strcmp(cgit_repo->group, last_group))) { 77 strcmp(cgit_repo->group, last_group))) {
72 html("<tr class='nohover'><td colspan='4' class='repogroup'>"); 78 htmlf("<tr class='nohover'><td colspan='%d' class='repogroup'>",
79 columns);
73 html_txt(cgit_repo->group); 80 html_txt(cgit_repo->group);
@@ -87,9 +94,13 @@ void cgit_print_repolist(struct cacheitem *item)
87 print_modtime(cgit_repo); 94 print_modtime(cgit_repo);
88 html("</td><td>"); 95 html("</td>");
89 html_link_open(cgit_repourl(cgit_repo->url), 96 if (cgit_enable_index_links) {
90 "Summary", "button"); 97 html("<td>");
91 html("S</a>"); 98 html_link_open(cgit_repourl(cgit_repo->url),
92 cgit_log_link("L", "Log", "button", NULL, NULL, NULL); 99 NULL, "button");
93 cgit_tree_link("F", "Files", "button", NULL, NULL, NULL); 100 html("summary</a>");
94 html("</td></tr>\n"); 101 cgit_log_link("log", NULL, "button", NULL, NULL, NULL, 0);
102 cgit_tree_link("tree", NULL, "button", NULL, NULL, NULL);
103 html("</td>");
104 }
105 html("</tr>\n");
95 } 106 }