X-Git-Url: https://git.cameronkatri.com/cgit.git/blobdiff_plain/31665579c2779669c0cc56b8eb63f162b7e165df..7fdff2460440c09d13fc76af3b75e85434e6f563:/ui-tag.c
diff --git a/ui-tag.c b/ui-tag.c
index 0e056e0..39e4cb8 100644
--- a/ui-tag.c
+++ b/ui-tag.c
@@ -30,6 +30,14 @@ static void print_tag_content(char *buf)
}
}
+void print_download_links(char *revname)
+{
+ html("
download | ");
+ cgit_print_snapshot_links(ctx.qry.repo, ctx.qry.head,
+ revname, ctx.repo->snapshots);
+ html(" |
");
+}
+
void cgit_print_tag(char *revname)
{
unsigned char sha1[20];
@@ -37,7 +45,10 @@ void cgit_print_tag(char *revname)
struct tag *tag;
struct taginfo *info;
- if (get_sha1(revname, sha1)) {
+ if (!revname)
+ revname = ctx.qry.head;
+
+ if (get_sha1(fmt("refs/tags/%s", revname), sha1)) {
cgit_print_error(fmt("Bad tag reference: %s", revname));
return;
}
@@ -53,36 +64,40 @@ void cgit_print_tag(char *revname)
return;
}
html("\n");
- htmlf("Tag name | ");
+ htmlf(" |
tag name | ");
html_txt(revname);
htmlf(" (%s) |
\n", sha1_to_hex(sha1));
if (info->tagger_date > 0) {
- html("Tag date | ");
+ html(" |
tag date | ");
cgit_print_date(info->tagger_date, FMT_LONGDATE, ctx.cfg.local_time);
html(" |
\n");
}
if (info->tagger) {
- html("Tagged by | ");
+ html(" |
tagged by | ");
html_txt(info->tagger);
- if (info->tagger_email) {
+ if (info->tagger_email && !ctx.cfg.noplainemail) {
html(" ");
html_txt(info->tagger_email);
}
html(" |
\n");
}
- html("Tagged object | ");
+ html(" |
tagged object | ");
cgit_object_link(tag->tagged);
html(" |
\n");
+ if (ctx.repo->snapshots)
+ print_download_links(revname);
html("
\n");
print_tag_content(info->msg);
} else {
html("\n");
- htmlf("Tag name | ");
+ htmlf(" |
tag name | ");
html_txt(revname);
html(" |
\n");
- html("Tagged object | ");
+ html(" |
Tagged object | ");
cgit_object_link(obj);
html(" |
\n");
+ if (ctx.repo->snapshots)
+ print_download_links(revname);
html("
\n");
}
return;