|
diff --git a/ui-refs.c b/ui-refs.c index 32e0429..c35e694 100644 --- a/ ui-refs.c+++ b/ ui-refs.c |
|
@@ -57,9 +57,10 @@ static int print_branch(struct refinfo *ref) |
57 | |
57 | |
58 | if (!info) |
58 | if (!info) |
59 | return 1; |
59 | return 1; |
60 | html("<tr><td>"); |
60 | html("<tr><td>"); |
61 | cgit_log_link(name, NULL, NULL, name, NULL, NULL, 0, NULL, NULL); |
61 | cgit_log_link(name, NULL, NULL, name, NULL, NULL, 0, NULL, NULL, |
| |
62 | ctx.qry.showmsg); |
62 | html("</td><td>"); |
63 | html("</td><td>"); |
63 | |
64 | |
64 | if (ref->object->type == OBJ_COMMIT) { |
65 | if (ref->object->type == OBJ_COMMIT) { |
65 | cgit_commit_link(info->subject, NULL, NULL, name, NULL); |
66 | cgit_commit_link(info->subject, NULL, NULL, name, NULL); |
@@ -77,14 +78,39 @@ static int print_branch(struct refinfo *ref) |
77 | |
78 | |
78 | static void print_tag_header() |
79 | static void print_tag_header() |
79 | { |
80 | { |
80 | html("<tr class='nohover'><th class='left'>Tag</th>" |
81 | html("<tr class='nohover'><th class='left'>Tag</th>" |
81 | "<th class='left'>Reference</th>" |
82 | "<th class='left'>Download</th>" |
82 | "<th class='left'>Author</th>" |
83 | "<th class='left'>Author</th>" |
83 | "<th class='left' colspan='2'>Age</th></tr>\n"); |
84 | "<th class='left' colspan='2'>Age</th></tr>\n"); |
84 | header = 1; |
85 | header = 1; |
85 | } |
86 | } |
86 | |
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 | } |
87 | static int print_tag(struct refinfo *ref) |
113 | static int print_tag(struct refinfo *ref) |
88 | { |
114 | { |
89 | struct tag *tag; |
115 | struct tag *tag; |
90 | struct taginfo *info; |
116 | struct taginfo *info; |
@@ -97,8 +123,11 @@ static int print_tag(struct refinfo *ref) |
97 | return 1; |
123 | return 1; |
98 | html("<tr><td>"); |
124 | html("<tr><td>"); |
99 | cgit_tag_link(name, NULL, NULL, ctx.qry.head, name); |
125 | cgit_tag_link(name, NULL, NULL, ctx.qry.head, name); |
100 | 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 |
101 | cgit_object_link(tag->tagged); |
130 | cgit_object_link(tag->tagged); |
102 | html("</td><td>"); |
131 | html("</td><td>"); |
103 | if (info->tagger) |
132 | if (info->tagger) |
104 | html(info->tagger); |
133 | html(info->tagger); |
@@ -111,8 +140,11 @@ static int print_tag(struct refinfo *ref) |
111 | print_tag_header(); |
140 | print_tag_header(); |
112 | html("<tr><td>"); |
141 | html("<tr><td>"); |
113 | html_txt(name); |
142 | html_txt(name); |
114 | html("</td><td>"); |
143 | html("</td><td>"); |
| |
144 | if (ctx.repo->snapshots && (ref->object->type == OBJ_COMMIT)) |
| |
145 | print_tag_downloads(ctx.repo, name); |
| |
146 | else |
115 | cgit_object_link(ref->object); |
147 | cgit_object_link(ref->object); |
116 | html("</td></tr>\n"); |
148 | html("</td></tr>\n"); |
117 | } |
149 | } |
118 | return 0; |
150 | return 0; |
|