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, 0);
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 nowrap'>");
32 "<th class='left'>Name</th>"
33 "<th class='left'>Description</th>"
34 "<th class='left'>Owner</th></tr>\n");
35 while ((de = readdir(d)) != NULL) {
36 if (de->d_name[0] == '.')
38 if (stat(de->d_name, &st) < 0)
40 if (!S_ISDIR(st.st_mode))
43 cgit_repo_name = cgit_repo_desc = cgit_repo_owner = NULL;
44 name = fmt("%s/info/cgit", de->d_name);
45 if (cgit_read_config(name, cgit_repo_config_cb))
49 html_link_open(cgit_repourl(de->d_name), NULL, NULL);
50 html_txt(cgit_repo_name);
53 html_txt(cgit_repo_desc);
55 html_txt(cgit_repo_owner);