summaryrefslogtreecommitdiffabout
path: root/ui-repolist.c
Unidiff
Diffstat (limited to 'ui-repolist.c') (more/less context) (show whitespace changes)
-rw-r--r--ui-repolist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui-repolist.c b/ui-repolist.c
index e663585..ad9b1bc 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -22,49 +22,49 @@ time_t read_agefile(char *path)
22 fclose(f); 22 fclose(f);
23 if (parse_date(buf, buf2, sizeof(buf2))) 23 if (parse_date(buf, buf2, sizeof(buf2)))
24 return strtoul(buf2, NULL, 10); 24 return strtoul(buf2, NULL, 10);
25 else 25 else
26 return 0; 26 return 0;
27} 27}
28 28
29static void print_modtime(struct cgit_repo *repo) 29static void print_modtime(struct cgit_repo *repo)
30{ 30{
31 char *path; 31 char *path;
32 struct stat s; 32 struct stat s;
33 33
34 path = fmt("%s/%s", repo->path, ctx.cfg.agefile); 34 path = fmt("%s/%s", repo->path, ctx.cfg.agefile);
35 if (stat(path, &s) == 0) { 35 if (stat(path, &s) == 0) {
36 cgit_print_age(read_agefile(path), -1, NULL); 36 cgit_print_age(read_agefile(path), -1, NULL);
37 return; 37 return;
38 } 38 }
39 39
40 path = fmt("%s/refs/heads/%s", repo->path, repo->defbranch); 40 path = fmt("%s/refs/heads/%s", repo->path, repo->defbranch);
41 if (stat(path, &s) != 0) 41 if (stat(path, &s) != 0)
42 return; 42 return;
43 cgit_print_age(s.st_mtime, -1, NULL); 43 cgit_print_age(s.st_mtime, -1, NULL);
44} 44}
45 45
46void cgit_print_repolist(struct cacheitem *item) 46void cgit_print_repolist()
47{ 47{
48 int i, columns = 4; 48 int i, columns = 4;
49 char *last_group = NULL; 49 char *last_group = NULL;
50 50
51 if (ctx.cfg.enable_index_links) 51 if (ctx.cfg.enable_index_links)
52 columns++; 52 columns++;
53 53
54 ctx.page.title = ctx.cfg.root_title; 54 ctx.page.title = ctx.cfg.root_title;
55 cgit_print_http_headers(&ctx); 55 cgit_print_http_headers(&ctx);
56 cgit_print_docstart(&ctx); 56 cgit_print_docstart(&ctx);
57 cgit_print_pageheader(&ctx); 57 cgit_print_pageheader(&ctx);
58 58
59 html("<table summary='repository list' class='list nowrap'>"); 59 html("<table summary='repository list' class='list nowrap'>");
60 if (ctx.cfg.index_header) { 60 if (ctx.cfg.index_header) {
61 htmlf("<tr class='nohover'><td colspan='%d' class='include-block'>", 61 htmlf("<tr class='nohover'><td colspan='%d' class='include-block'>",
62 columns); 62 columns);
63 html_include(ctx.cfg.index_header); 63 html_include(ctx.cfg.index_header);
64 html("</td></tr>"); 64 html("</td></tr>");
65 } 65 }
66 html("<tr class='nohover'>" 66 html("<tr class='nohover'>"
67 "<th class='left'>Name</th>" 67 "<th class='left'>Name</th>"
68 "<th class='left'>Description</th>" 68 "<th class='left'>Description</th>"
69 "<th class='left'>Owner</th>" 69 "<th class='left'>Owner</th>"
70 "<th class='left'>Idle</th>"); 70 "<th class='left'>Idle</th>");