1 /* ui-repolist.c: functions for generating the repolist page
3 * Copyright (C) 2006 Lars Hjemli
5 * Licensed under GNU General Public License v2
6 * (see COPYING for full license text)
11 void cgit_print_repolist(struct cacheitem *item)
13 struct repoinfo *repo;
15 char *last_group = NULL;
17 cgit_print_docstart(cgit_root_title, item);
18 cgit_print_pageheader(cgit_root_title, 0);
20 html("<table class='list nowrap'>");
21 if (cgit_index_header) {
22 html("<tr class='nohover'><td colspan='4' class='include-block'>");
23 html_include(cgit_index_header);
26 html("<tr class='nohover'>"
27 "<th class='left'>Name</th>"
28 "<th class='left'>Description</th>"
29 "<th class='left'>Owner</th>"
30 "<th>Links</th></tr>\n");
32 for (i=0; i<cgit_repolist.count; 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);
41 last_group = repo->group;
43 htmlf("<tr><td class='%s'>",
44 repo->group ? "sublevel-repo" : "toplevel-repo");
45 html_link_open(cgit_repourl(repo->url), repo->desc, NULL);
49 html_ntxt(cgit_max_repodesc_len, repo->desc);
51 html_txt(repo->owner);
53 html_link_open(cgit_repourl(repo->url),
56 html_link_open(cgit_pageurl(repo->name, "log", NULL),
59 html_link_open(cgit_pageurl(repo->name, "tree", NULL),