]>
git.cameronkatri.com Git - cgit.git/blob - ui-repolist.c
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
)
19 cgit_print_docstart(cgit_root_title
, item
);
20 cgit_print_pageheader(cgit_root_title
);
22 if (!(d
= opendir("."))) {
23 cgit_print_error(fmt("Unable to scan repository directory: %s",
29 html("<h2>Repositories</h2>\n");
30 html("<table class='list'>");
31 html("<tr><th>Name</th><th>Description</th><th>Owner</th></tr>\n");
32 while ((de
= readdir(d
)) != NULL
) {
33 if (de
->d_name
[0] == '.')
35 if (stat(de
->d_name
, &st
) < 0)
37 if (!S_ISDIR(st
.st_mode
))
40 cgit_repo_name
= cgit_repo_desc
= cgit_repo_owner
= NULL
;
41 name
= fmt("%s/info/cgit", de
->d_name
);
42 if (cgit_read_config(name
, cgit_repo_config_cb
))
46 html_link_open(cgit_repourl(de
->d_name
), NULL
, NULL
);
47 html_txt(cgit_repo_name
);
50 html_txt(cgit_repo_desc
);
52 html_txt(cgit_repo_owner
);