aboutsummaryrefslogtreecommitdiffstats
path: root/ui-repolist.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-repolist.c')
-rw-r--r--ui-repolist.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/ui-repolist.c b/ui-repolist.c
index d56654d..3ef2e99 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -217,6 +217,7 @@ void cgit_print_repolist()
217{ 217{
218 int i, columns = 4, hits = 0, header = 0; 218 int i, columns = 4, hits = 0, header = 0;
219 char *last_section = NULL; 219 char *last_section = NULL;
220 char *section;
220 int sorted = 0; 221 int sorted = 0;
221 222
222 if (ctx.cfg.enable_index_links) 223 if (ctx.cfg.enable_index_links)
@@ -247,19 +248,22 @@ void cgit_print_repolist()
247 continue; 248 continue;
248 if (!header++) 249 if (!header++)
249 print_header(columns); 250 print_header(columns);
251 section = ctx.repo->section;
252 if (section && !strcmp(section, ""))
253 section = NULL;
250 if (!sorted && 254 if (!sorted &&
251 ((last_section == NULL && ctx.repo->section != NULL) || 255 ((last_section == NULL && section != NULL) ||
252 (last_section != NULL && ctx.repo->section == NULL) || 256 (last_section != NULL && section == NULL) ||
253 (last_section != NULL && ctx.repo->section != NULL && 257 (last_section != NULL && section != NULL &&
254 strcmp(ctx.repo->section, last_section)))) { 258 strcmp(section, last_section)))) {
255 htmlf("<tr class='nohover'><td colspan='%d' class='reposection'>", 259 htmlf("<tr class='nohover'><td colspan='%d' class='reposection'>",
256 columns); 260 columns);
257 html_txt(ctx.repo->section); 261 html_txt(section);
258 html("</td></tr>"); 262 html("</td></tr>");
259 last_section = ctx.repo->section; 263 last_section = section;
260 } 264 }
261 htmlf("<tr><td class='%s'>", 265 htmlf("<tr><td class='%s'>",
262 !sorted && ctx.repo->section ? "sublevel-repo" : "toplevel-repo"); 266 !sorted && section ? "sublevel-repo" : "toplevel-repo");
263 cgit_summary_link(ctx.repo->name, ctx.repo->name, NULL, NULL); 267 cgit_summary_link(ctx.repo->name, ctx.repo->name, NULL, NULL);
264 html("</td><td>"); 268 html("</td><td>");
265 html_link_open(cgit_repourl(ctx.repo->url), NULL, NULL); 269 html_link_open(cgit_repourl(ctx.repo->url), NULL, NULL);