From ab2ab95f09994560f62fd631f07d3b6e3577aa6e Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Thu, 8 Feb 2007 13:53:13 +0100 Subject: Add support for snapshots Make a link from the commit viewer to a snapshot of the corresponding tree. Currently only zip-format is supported. Signed-off-by: Lars Hjemli --- ui-shared.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ui-shared.c') diff --git a/ui-shared.c b/ui-shared.c index 3322561..172499c 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -144,3 +144,14 @@ void cgit_print_pageheader(char *title, int show_search) html(""); html(""); } + +void cgit_print_snapshot_start(const char *mimetype, const char *filename, + struct cacheitem *item) +{ + htmlf("Content-Type: %s\n", mimetype); + htmlf("Content-Disposition: inline; filename=\"%s\"\n", filename); + htmlf("Last-Modified: %s\n", http_date(item->st.st_mtime)); + htmlf("Expires: %s\n", http_date(item->st.st_mtime + + ttl_seconds(item->ttl))); + html("\n"); +} -- cgit v1.2.3-59-g8ed1b