Diff options
Diffstat (limited to '')
| -rw-r--r-- | source/ui-tag.c | 32 |
1 file changed, 9 insertions, 23 deletions
diff --git a/source/ui-tag.c b/source/ui-tag.c index f9ce6b3..d60a58e 100644 --- a/source/ui-tag.c +++ b/source/ui-tag.c @@ -10,10 +10,8 @@ #define USE_THE_REPOSITORY_VARIABLE #include "cgit.h" -#include "filter.h" #include "html.h" #include "parsing.h" -#include "shared.h" #include "ui-shared.h" #include "ui-tag.h" @@ -28,25 +26,15 @@ static void print_name_row(const char *revname, const struct object_id *oid) static void print_date_row(struct taginfo *info) { - html("<tr><th scope='row'>tag date</th><td><time datetime='"); - html_attr(show_date(info->tagger_date, info->tagger_tz, cgit_date_mode(DATE_ISO8601_STRICT))); - html("'>"); - html_txt(show_date(info->tagger_date, info->tagger_tz, cgit_date_mode(DATE_ISO8601))); - html("</time></td></tr>\n"); + html("<tr><th scope='row'>tag date</th><td>"); + cgit_print_date(info->tagger_date, info->tagger_tz); + html("</td></tr>\n"); } static void print_tagger_row(struct taginfo *info) { html("<tr><th scope='row'>tagged by</th><td>"); - // A tag can carry a tagger with no address, and a filter must not be - // handed a NULL argument. - cgit_open_filter(ctx.repo->email_filter, info->tagger_email ? info->tagger_email : "", "tag"); - html_txt(info->tagger); - if (info->tagger_email && ctx.cfg.enable_plain_email) { - html(" "); - html_txt(info->tagger_email); - } - cgit_close_filter(ctx.repo->email_filter); + cgit_print_person(info->tagger, info->tagger_email, "tag", 1); html("</td></tr>\n"); } @@ -98,20 +86,18 @@ static void print_message(char *msg) } } -static void print_annotated_tag(const char *revname, const struct object_id *oid) +static void print_annotated_tag(const char *revname, struct tag *tag) { - struct tag *tag; - struct taginfo *info; + struct taginfo *info = cgit_parse_tag(tag); - tag = lookup_tag(the_repository, oid); - if (!tag || parse_tag(the_repository, tag) || !(info = cgit_parse_tag(tag))) { + if (!info) { cgit_print_error_page(500, "Internal Server Error", "Bad tag object: %s", revname); return; } cgit_print_layout_start(); html("<table class='commit-info'>\n"); - print_name_row(revname, oid); + print_name_row(revname, &tag->object.oid); if (info->tagger_date > 0) print_date_row(info); if (info->tagger) @@ -167,7 +153,7 @@ void cgit_print_tag(char *revname) } cgit_prefix_title(revname); if (obj->type == OBJ_TAG) - print_annotated_tag(revname, &oid); + print_annotated_tag(revname, (struct tag *)obj); else print_lightweight_tag(revname, obj); |
