diff options
context:
space:
mode:
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Name the tagged object under its full id
Diffstat (limited to 'source/ui-tag.c')
-rw-r--r--source/ui-tag.c53
1 file changed, 27 insertions, 26 deletions
diff --git a/source/ui-tag.c b/source/ui-tag.c
index 02fbfc7..56862bb 100644
--- a/source/ui-tag.c
+++ b/source/ui-tag.c
@@ -17,34 +17,27 @@
#include "ui-shared.h"
#include "ui-tag.h"
-// The rows share the commit page's three column layout, so a single value
-// spans the name and date columns of the tagger row.
-static void print_tag_row(const char *revname, const struct object_id *oid)
+static void print_name_row(const char *revname, const struct object_id *oid)
{
- html("<tr><th>tag</th><td colspan='2'>");
+ html("<tr><th>tag name</th><td>");
html_txt(revname);
if (oid)
htmlf(" (<span class='oid'>%s</span>)", oid_to_hex(oid));
html("</td></tr>\n");
}
-static void print_object_row(struct object *obj)
-{
- html("<tr><th>object</th><td colspan='2' class='oid'>");
- cgit_object_link(obj);
- html("</td></tr>\n");
-}
-
-static void print_download_row(const char *revname)
+static void print_date_row(struct taginfo *info)
{
- html("<tr><th>download</th><td colspan='2' class='oid'>");
- cgit_print_snapshot_links(ctx.repo, revname, "<br>");
- html("</td></tr>\n");
+ html("<tr><th>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");
}
static void print_tagger_row(struct taginfo *info)
{
- html("<tr><th>tagger</th><td>");
+ html("<tr><th>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");
@@ -54,14 +47,20 @@ static void print_tagger_row(struct taginfo *info)
html_txt(info->tagger_email);
}
cgit_close_filter(ctx.repo->email_filter);
- html("</td><td class='right'>");
- if (info->tagger_date > 0) {
- html("<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>");
- }
+ html("</td></tr>\n");
+}
+
+static void print_object_row(struct object *obj)
+{
+ html("<tr><th>tagged object</th><td class='oid'>");
+ cgit_object_link(obj, 1);
+ html("</td></tr>\n");
+}
+
+static void print_download_row(const char *revname)
+{
+ html("<tr><th>download</th><td class='oid'>");
+ cgit_print_snapshot_links(ctx.repo, revname, "<br>");
html("</td></tr>\n");
}
@@ -106,9 +105,11 @@ static void print_annotated_tag(const char *revname, const struct object_id *oid
cgit_print_layout_start();
html("<table class='commit-info'>\n");
+ print_name_row(revname, oid);
+ if (info->tagger_date > 0)
+ print_date_row(info);
if (info->tagger)
print_tagger_row(info);
- print_tag_row(revname, oid);
print_object_row(tag->tagged);
if (ctx.repo->snapshots)
print_download_row(revname);
@@ -122,7 +123,7 @@ static void print_lightweight_tag(const char *revname, struct object *obj)
{
cgit_print_layout_start();
html("<table class='commit-info'>\n");
- print_tag_row(revname, NULL);
+ print_name_row(revname, NULL);
print_object_row(obj);
if (ctx.repo->snapshots)
print_download_row(revname);