|
diff --git a/ui-refs.c b/ui-refs.c index 7eb16d5..d61ee7c 100644 --- a/ ui-refs.c+++ b/ ui-refs.c |
|
@@ -81,3 +81,3 @@ static void print_tag_header() |
81 | html("<tr class='nohover'><th class='left'>Tag</th>" |
81 | html("<tr class='nohover'><th class='left'>Tag</th>" |
82 | "<th class='left'>Reference</th>" |
82 | "<th class='left'>Download</th>" |
83 | "<th class='left'>Author</th>" |
83 | "<th class='left'>Author</th>" |
@@ -87,2 +87,27 @@ static void print_tag_header() |
87 | |
87 | |
| |
88 | static void print_tag_downloads(const struct cgit_repo *repo, const char *ref) |
| |
89 | { |
| |
90 | const struct cgit_snapshot_format* f; |
| |
91 | char *filename; |
| |
92 | const char *basename; |
| |
93 | |
| |
94 | if (!ref || strlen(ref) < 2) |
| |
95 | return; |
| |
96 | |
| |
97 | basename = cgit_repobasename(repo->url); |
| |
98 | if (prefixcmp(ref, basename) != 0) { |
| |
99 | if ((ref[0] == 'v' || ref[0] == 'V') && isdigit(ref[1])) |
| |
100 | ref++; |
| |
101 | if (isdigit(ref[0])) |
| |
102 | ref = xstrdup(fmt("%s-%s", basename, ref)); |
| |
103 | } |
| |
104 | |
| |
105 | for (f = cgit_snapshot_formats; f->suffix; f++) { |
| |
106 | if (!(repo->snapshots & f->bit)) |
| |
107 | continue; |
| |
108 | filename = fmt("%s%s", ref, f->suffix); |
| |
109 | cgit_snapshot_link(filename, NULL, NULL, NULL, NULL, filename); |
| |
110 | html(" "); |
| |
111 | } |
| |
112 | } |
88 | static int print_tag(struct refinfo *ref) |
113 | static int print_tag(struct refinfo *ref) |
@@ -101,2 +126,5 @@ static int print_tag(struct refinfo *ref) |
101 | html("</td><td>"); |
126 | html("</td><td>"); |
| |
127 | if (ctx.repo->snapshots && (tag->tagged->type == OBJ_COMMIT)) |
| |
128 | print_tag_downloads(ctx.repo, name); |
| |
129 | else |
102 | cgit_object_link(tag->tagged); |
130 | cgit_object_link(tag->tagged); |
@@ -115,2 +143,5 @@ static int print_tag(struct refinfo *ref) |
115 | html("</td><td>"); |
143 | html("</td><td>"); |
| |
144 | if (ctx.repo->snapshots && (tag->tagged->type == OBJ_COMMIT)) |
| |
145 | print_tag_downloads(ctx.repo, name); |
| |
146 | else |
116 | cgit_object_link(ref->object); |
147 | cgit_object_link(ref->object); |
|