X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/a5e15537268410e268c7b26aa69d03b347c326c8..f80b73fa20d5c884114b971a20e1b4bb847e054e:/ui-tag.c?ds=inline diff --git a/ui-tag.c b/ui-tag.c index adbdb90..3fa63b3 100644 --- a/ui-tag.c +++ b/ui-tag.c @@ -44,40 +44,46 @@ void cgit_print_tag(char *revname) struct strbuf fullref = STRBUF_INIT; unsigned char sha1[20]; struct object *obj; - struct tag *tag; - struct taginfo *info; if (!revname) revname = ctx.qry.head; strbuf_addf(&fullref, "refs/tags/%s", revname); if (get_sha1(fullref.buf, sha1)) { - cgit_print_error("Bad tag reference: %s", revname); + cgit_print_error_page(404, "Not found", + "Bad tag reference: %s", revname); goto cleanup; } obj = parse_object(sha1); if (!obj) { - cgit_print_error("Bad object id: %s", sha1_to_hex(sha1)); + cgit_print_error_page(500, "Internal server error", + "Bad object id: %s", sha1_to_hex(sha1)); goto cleanup; } if (obj->type == OBJ_TAG) { + struct tag *tag; + struct taginfo *info; + tag = lookup_tag(sha1); if (!tag || parse_tag(tag) || !(info = cgit_parse_tag(tag))) { - cgit_print_error("Bad tag object: %s", revname); + cgit_print_error_page(500, "Internal server error", + "Bad tag object: %s", revname); goto cleanup; } + cgit_print_layout_start(); html("\n"); htmlf("\n", sha1_to_hex(sha1)); if (info->tagger_date > 0) { html("\n"); } if (info->tagger) { html("
tag name"); html_txt(revname); htmlf(" (%s)
tag date"); - cgit_print_date(info->tagger_date, FMT_LONGDATE, ctx.cfg.local_time); + html_txt(show_date(info->tagger_date, info->tagger_tz, + cgit_date_mode(DATE_ISO8601))); html("
tagged by"); - cgit_open_filter(ctx.repo->email_filter, info->tagger_email); + cgit_open_filter(ctx.repo->email_filter, info->tagger_email, "tag"); html_txt(info->tagger); if (info->tagger_email && !ctx.cfg.noplainemail) { html(" "); @@ -93,7 +99,10 @@ void cgit_print_tag(char *revname) print_download_links(revname); html("
\n"); print_tag_content(info->msg); + cgit_print_layout_end(); + cgit_free_taginfo(info); } else { + cgit_print_layout_start(); html("\n"); htmlf("
tag name"); html_txt(revname); @@ -104,6 +113,7 @@ void cgit_print_tag(char *revname) if (ctx.repo->snapshots) print_download_links(revname); html("
\n"); + cgit_print_layout_end(); } cleanup: