summaryrefslogtreecommitdiffabout
path: root/ui-shared.c
Unidiff
Diffstat (limited to 'ui-shared.c') (more/less context) (ignore whitespace changes)
-rw-r--r--ui-shared.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ui-shared.c b/ui-shared.c
index cb8a8df..1a6c127 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -55,16 +55,28 @@ char *cgit_pageurl(const char *reponame, const char *pagename,
55 if (cgit_virtual_root) { 55 if (cgit_virtual_root) {
56 return fmt("%s/%s/%s/?%s", cgit_virtual_root, reponame, 56 return fmt("%s/%s/%s/?%s", cgit_virtual_root, reponame,
57 pagename, query); 57 pagename, query);
58 } else { 58 } else {
59 return fmt("?r=%s&p=%s&%s", reponame, pagename, query); 59 return fmt("?r=%s&p=%s&%s", reponame, pagename, query);
60 } 60 }
61} 61}
62 62
63
64void cgit_print_date(unsigned long secs)
65{
66 char buf[32];
67 struct tm *time;
68
69 time = gmtime(&secs);
70 strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", time);
71 html_txt(buf);
72
73}
74
63void cgit_print_docstart(char *title, struct cacheitem *item) 75void cgit_print_docstart(char *title, struct cacheitem *item)
64{ 76{
65 html("Content-Type: text/html; charset=utf-8\n"); 77 html("Content-Type: text/html; charset=utf-8\n");
66 htmlf("Last-Modified: %s\n", http_date(item->st.st_mtime)); 78 htmlf("Last-Modified: %s\n", http_date(item->st.st_mtime));
67 htmlf("Expires: %s\n", http_date(item->st.st_mtime + 79 htmlf("Expires: %s\n", http_date(item->st.st_mtime +
68 ttl_seconds(item->ttl))); 80 ttl_seconds(item->ttl)));
69 html("\n"); 81 html("\n");
70 html(cgit_doctype); 82 html(cgit_doctype);