X-Git-Url: https://git.cameronkatri.com/cgit.git/blobdiff_plain/a30453a5d3f6db4d6e055da2112343e054e7e7d5..c151ce61d87c577ac8a067523a406938c557d650:/ui-tag.c diff --git a/ui-tag.c b/ui-tag.c index 3aea87d..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,27 +64,41 @@ void cgit_print_tag(char *revname) return; } html("\n"); - htmlf("\n", - revname, sha1_to_hex(sha1)); + 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%s (%s)
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) { + if (info->tagger_email && !ctx.cfg.noplainemail) { html(" "); html_txt(info->tagger_email); } 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"); + html_txt(revname); + html("
Tagged object"); + cgit_object_link(obj); + html("
\n"); + } return; }