about summary refs log tree commit diff
path: root/ui-view.c
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2007-05-09 00:48:09 +0200
committerLars Hjemli <hjemli@gmail.com>2007-05-09 00:48:09 +0200
commitca8eb8fc8f71ee0a40015c323619f776840b6503 (patch)
treef74a114ba19c215bffe8362bf8e63495155ebef4 /ui-view.c
parentui-view: show pathname if specified in querystring (diff)
downloadcgit-pink-ca8eb8fc8f71ee0a40015c323619f776840b6503.tar.gz
cgit-pink-ca8eb8fc8f71ee0a40015c323619f776840b6503.zip
Add support for downloading single blobs
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to '')
-rw-r--r--ui-view.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ui-view.c b/ui-view.c
index 7d022fd..dbe4b29 100644
--- a/ui-view.c
+++ b/ui-view.c
@@ -40,6 +40,13 @@ void cgit_print_view(const char *hex, char *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);