aboutsummaryrefslogtreecommitdiffstats
path: root/ui-repolist.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-repolist.c')
-rw-r--r--ui-repolist.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/ui-repolist.c b/ui-repolist.c
index dead1bf..2a910bd 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -110,12 +110,13 @@ void print_sort_header(const char *title, const char *sort)
110 htmlf("'>%s</a></th>", title); 110 htmlf("'>%s</a></th>", title);
111} 111}
112 112
113void print_header(int columns) 113void print_header()
114{ 114{
115 html("<tr class='nohover'>"); 115 html("<tr class='nohover'>");
116 print_sort_header("Name", "name"); 116 print_sort_header("Name", "name");
117 print_sort_header("Description", "desc"); 117 print_sort_header("Description", "desc");
118 print_sort_header("Owner", "owner"); 118 if (ctx.cfg.enable_index_owner)
119 print_sort_header("Owner", "owner");
119 print_sort_header("Idle", "idle"); 120 print_sort_header("Idle", "idle");
120 if (ctx.cfg.enable_index_links) 121 if (ctx.cfg.enable_index_links)
121 html("<th class='left'>Links</th>"); 122 html("<th class='left'>Links</th>");
@@ -239,13 +240,15 @@ int sort_repolist(char *field)
239 240
240void cgit_print_repolist() 241void cgit_print_repolist()
241{ 242{
242 int i, columns = 4, hits = 0, header = 0; 243 int i, columns = 3, hits = 0, header = 0;
243 char *last_section = NULL; 244 char *last_section = NULL;
244 char *section; 245 char *section;
245 int sorted = 0; 246 int sorted = 0;
246 247
247 if (ctx.cfg.enable_index_links) 248 if (ctx.cfg.enable_index_links)
248 columns++; 249 ++columns;
250 if (ctx.cfg.enable_index_owner)
251 ++columns;
249 252
250 ctx.page.title = ctx.cfg.root_title; 253 ctx.page.title = ctx.cfg.root_title;
251 cgit_print_http_headers(&ctx); 254 cgit_print_http_headers(&ctx);
@@ -271,7 +274,7 @@ void cgit_print_repolist()
271 if (hits > ctx.qry.ofs + ctx.cfg.max_repo_count) 274 if (hits > ctx.qry.ofs + ctx.cfg.max_repo_count)
272 continue; 275 continue;
273 if (!header++) 276 if (!header++)
274 print_header(columns); 277 print_header();
275 section = ctx.repo->section; 278 section = ctx.repo->section;
276 if (section && !strcmp(section, "")) 279 if (section && !strcmp(section, ""))
277 section = NULL; 280 section = NULL;
@@ -294,8 +297,10 @@ void cgit_print_repolist()
294 html_ntxt(ctx.cfg.max_repodesc_len, ctx.repo->desc); 297 html_ntxt(ctx.cfg.max_repodesc_len, ctx.repo->desc);
295 html_link_close(); 298 html_link_close();
296 html("</td><td>"); 299 html("</td><td>");
297 html_txt(ctx.repo->owner); 300 if (ctx.cfg.enable_index_owner) {
298 html("</td><td>"); 301 html_txt(ctx.repo->owner);
302 html("</td><td>");
303 }
299 print_modtime(ctx.repo); 304 print_modtime(ctx.repo);
300 html("</td>"); 305 html("</td>");
301 if (ctx.cfg.enable_index_links) { 306 if (ctx.cfg.enable_index_links) {