summaryrefslogtreecommitdiffabout
path: root/ui-repolist.c
Unidiff
Diffstat (limited to 'ui-repolist.c') (more/less context) (show whitespace changes)
-rw-r--r--ui-repolist.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/ui-repolist.c b/ui-repolist.c
index 7c7aa9b..4dea3b3 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -190,74 +190,74 @@ int sort_repolist(char *field)
190 struct sortcolumn *column; 190 struct sortcolumn *column;
191 191
192 for (column = &sortcolumn[0]; column->name; column++) { 192 for (column = &sortcolumn[0]; column->name; column++) {
193 if (strcmp(field, column->name)) 193 if (strcmp(field, column->name))
194 continue; 194 continue;
195 qsort(cgit_repolist.repos, cgit_repolist.count, 195 qsort(cgit_repolist.repos, cgit_repolist.count,
196 sizeof(struct cgit_repo), column->fn); 196 sizeof(struct cgit_repo), column->fn);
197 return 1; 197 return 1;
198 } 198 }
199 return 0; 199 return 0;
200} 200}
201 201
202 202
203void cgit_print_repolist() 203void cgit_print_repolist()
204{ 204{
205 int i, columns = 4, hits = 0, header = 0; 205 int i, columns = 4, hits = 0, header = 0;
206 char *last_group = NULL; 206 char *last_section = NULL;
207 int sorted = 0; 207 int sorted = 0;
208 208
209 if (ctx.cfg.enable_index_links) 209 if (ctx.cfg.enable_index_links)
210 columns++; 210 columns++;
211 211
212 ctx.page.title = ctx.cfg.root_title; 212 ctx.page.title = ctx.cfg.root_title;
213 cgit_print_http_headers(&ctx); 213 cgit_print_http_headers(&ctx);
214 cgit_print_docstart(&ctx); 214 cgit_print_docstart(&ctx);
215 cgit_print_pageheader(&ctx); 215 cgit_print_pageheader(&ctx);
216 216
217 if (ctx.cfg.index_header) 217 if (ctx.cfg.index_header)
218 html_include(ctx.cfg.index_header); 218 html_include(ctx.cfg.index_header);
219 219
220 if(ctx.qry.sort) 220 if(ctx.qry.sort)
221 sorted = sort_repolist(ctx.qry.sort); 221 sorted = sort_repolist(ctx.qry.sort);
222 222
223 html("<table summary='repository list' class='list nowrap'>"); 223 html("<table summary='repository list' class='list nowrap'>");
224 for (i=0; i<cgit_repolist.count; i++) { 224 for (i=0; i<cgit_repolist.count; i++) {
225 ctx.repo = &cgit_repolist.repos[i]; 225 ctx.repo = &cgit_repolist.repos[i];
226 if (!(is_match(ctx.repo) && is_in_url(ctx.repo))) 226 if (!(is_match(ctx.repo) && is_in_url(ctx.repo)))
227 continue; 227 continue;
228 hits++; 228 hits++;
229 if (hits <= ctx.qry.ofs) 229 if (hits <= ctx.qry.ofs)
230 continue; 230 continue;
231 if (hits > ctx.qry.ofs + ctx.cfg.max_repo_count) 231 if (hits > ctx.qry.ofs + ctx.cfg.max_repo_count)
232 continue; 232 continue;
233 if (!header++) 233 if (!header++)
234 print_header(columns); 234 print_header(columns);
235 if (!sorted && 235 if (!sorted &&
236 ((last_group == NULL && ctx.repo->group != NULL) || 236 ((last_section == NULL && ctx.repo->section != NULL) ||
237 (last_group != NULL && ctx.repo->group == NULL) || 237 (last_section != NULL && ctx.repo->section == NULL) ||
238 (last_group != NULL && ctx.repo->group != NULL && 238 (last_section != NULL && ctx.repo->section != NULL &&
239 strcmp(ctx.repo->group, last_group)))) { 239 strcmp(ctx.repo->section, last_section)))) {
240 htmlf("<tr class='nohover'><td colspan='%d' class='repogroup'>", 240 htmlf("<tr class='nohover'><td colspan='%d' class='reposection'>",
241 columns); 241 columns);
242 html_txt(ctx.repo->group); 242 html_txt(ctx.repo->section);
243 html("</td></tr>"); 243 html("</td></tr>");
244 last_group = ctx.repo->group; 244 last_section = ctx.repo->section;
245 } 245 }
246 htmlf("<tr><td class='%s'>", 246 htmlf("<tr><td class='%s'>",
247 !sorted && ctx.repo->group ? "sublevel-repo" : "toplevel-repo"); 247 !sorted && ctx.repo->section ? "sublevel-repo" : "toplevel-repo");
248 cgit_summary_link(ctx.repo->name, ctx.repo->name, NULL, NULL); 248 cgit_summary_link(ctx.repo->name, ctx.repo->name, NULL, NULL);
249 html("</td><td>"); 249 html("</td><td>");
250 html_link_open(cgit_repourl(ctx.repo->url), NULL, NULL); 250 html_link_open(cgit_repourl(ctx.repo->url), NULL, NULL);
251 html_ntxt(ctx.cfg.max_repodesc_len, ctx.repo->desc); 251 html_ntxt(ctx.cfg.max_repodesc_len, ctx.repo->desc);
252 html_link_close(); 252 html_link_close();
253 html("</td><td>"); 253 html("</td><td>");
254 html_txt(ctx.repo->owner); 254 html_txt(ctx.repo->owner);
255 html("</td><td>"); 255 html("</td><td>");
256 print_modtime(ctx.repo); 256 print_modtime(ctx.repo);
257 html("</td>"); 257 html("</td>");
258 if (ctx.cfg.enable_index_links) { 258 if (ctx.cfg.enable_index_links) {
259 html("<td>"); 259 html("<td>");
260 cgit_summary_link("summary", NULL, "button", NULL); 260 cgit_summary_link("summary", NULL, "button", NULL);
261 cgit_log_link("log", NULL, "button", NULL, NULL, NULL, 261 cgit_log_link("log", NULL, "button", NULL, NULL, NULL,
262 0, NULL, NULL, ctx.qry.showmsg); 262 0, NULL, NULL, ctx.qry.showmsg);
263 cgit_tree_link("tree", NULL, "button", NULL, NULL, NULL); 263 cgit_tree_link("tree", NULL, "button", NULL, NULL, NULL);