X-Git-Url: https://git.cameronkatri.com/cgit.git/blobdiff_plain/db6303b58883c4417f5bcc0c1ee34fed6553dca3..8f40be229cf8ac7ecbf5e03e11098bad8e82e7e5:/ui-tag.c diff --git a/ui-tag.c b/ui-tag.c index a9c8670..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,16 +64,16 @@ void cgit_print_tag(char *revname) return; } html("\n"); - htmlf("\n", sha1_to_hex(sha1)); if (info->tagger_date > 0) { - html("\n"); } if (info->tagger) { - html("\n"); } - html("\n"); + if (ctx.repo->snapshots) + print_download_links(revname); html("
Tag name"); + htmlf("
tag name"); html_txt(revname); htmlf(" (%s)
Tag date"); + html("
tag date"); cgit_print_date(info->tagger_date, FMT_LONGDATE, ctx.cfg.local_time); html("
Tagged by"); + html("
tagged by"); html_txt(info->tagger); if (info->tagger_email && !ctx.cfg.noplainemail) { html(" "); @@ -70,19 +81,23 @@ void cgit_print_tag(char *revname) } html("
Tagged object"); + html("
tagged object"); cgit_object_link(tag->tagged); html("
\n"); print_tag_content(info->msg); } else { html("\n"); - htmlf("\n"); - html("\n"); + if (ctx.repo->snapshots) + print_download_links(revname); html("
Tag name"); + htmlf("
tag name"); html_txt(revname); html("
Tagged object"); + html("
Tagged object"); cgit_object_link(obj); html("
\n"); } return;