mirror of
https://git.zx2c4.com/cgit
synced 2025-08-02 17:15:13 +02:00
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 <hjemli@gmail.com>
This commit is contained in:
parent
14d360df60
commit
ab2ab95f09
8 changed files with 153 additions and 8 deletions
11
ui-shared.c
11
ui-shared.c
|
@ -144,3 +144,14 @@ void cgit_print_pageheader(char *title, int show_search)
|
|||
html("</a>");
|
||||
html("</td></tr><tr><td id='content'>");
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue