author | Lars Hjemli <hjemli@gmail.com> | 2007-05-08 22:48:09 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-05-08 22:48:09 (UTC) |
commit | ca8eb8fc8f71ee0a40015c323619f776840b6503 (patch) (side-by-side diff) | |
tree | f74a114ba19c215bffe8362bf8e63495155ebef4 /ui-view.c | |
parent | 7250a154678477a1e8260efbc9810ec389754ef9 (diff) | |
download | cgit-ca8eb8fc8f71ee0a40015c323619f776840b6503.zip cgit-ca8eb8fc8f71ee0a40015c323619f776840b6503.tar.gz cgit-ca8eb8fc8f71ee0a40015c323619f776840b6503.tar.bz2 |
Add support for downloading single blobs
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | ui-view.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -35,14 +35,21 @@ void cgit_print_view(const char *hex, char *path) buf[size] = '\0'; html("<table class='list'>\n"); html("<tr class='nohover'><th class='left'>"); if (path) htmlf("%s (", path); htmlf("%s %s, %li bytes", typename(type), hex, size); if (path) html(")"); + + html(" <a href='"); + html_attr(cgit_pageurl(cgit_query_repo, "blob", + fmt("id=%s&path=%s", + hex, + path))); + html("'>download</a>"); html("</th></tr>\n"); html("<tr><td class='blob'>\n"); html_txt(buf); html("\n</td></tr>\n"); html("</table>\n"); } |