author | Alexey Nezhdanov <snakeru@gmail.com> | 2009-09-27 19:00:29 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2009-10-06 17:26:06 (UTC) |
commit | 8cdccac758d976a8a92cc39b1581832a889e2058 (patch) (unidiff) | |
tree | 49dddea4e0a025a834f62218668f257212908b85 | |
parent | 121898e73d6e28656c2d451effc6d9907ebdc5ba (diff) | |
download | cgit-8cdccac758d976a8a92cc39b1581832a889e2058.zip cgit-8cdccac758d976a8a92cc39b1581832a889e2058.tar.gz cgit-8cdccac758d976a8a92cc39b1581832a889e2058.tar.bz2 |
ui-tag: add snapshot links
Signed-off-by: Alexey Nezhdanov <snakeru@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | ui-tag.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -27,12 +27,20 @@ static void print_tag_content(char *buf) | |||
27 | html("<div class='commit-msg'>"); | 27 | html("<div class='commit-msg'>"); |
28 | html_txt(++p); | 28 | html_txt(++p); |
29 | html("</div>"); | 29 | html("</div>"); |
30 | } | 30 | } |
31 | } | 31 | } |
32 | 32 | ||
33 | void print_download_links(char *revname) | ||
34 | { | ||
35 | html("<tr><th>download</th><td class='sha1'>"); | ||
36 | cgit_print_snapshot_links(ctx.qry.repo, ctx.qry.head, | ||
37 | revname, ctx.repo->snapshots); | ||
38 | html("</td></tr>"); | ||
39 | } | ||
40 | |||
33 | void cgit_print_tag(char *revname) | 41 | void cgit_print_tag(char *revname) |
34 | { | 42 | { |
35 | unsigned char sha1[20]; | 43 | unsigned char sha1[20]; |
36 | struct object *obj; | 44 | struct object *obj; |
37 | struct tag *tag; | 45 | struct tag *tag; |
38 | struct taginfo *info; | 46 | struct taginfo *info; |
@@ -73,20 +81,24 @@ void cgit_print_tag(char *revname) | |||
73 | } | 81 | } |
74 | html("</td></tr>\n"); | 82 | html("</td></tr>\n"); |
75 | } | 83 | } |
76 | html("<tr><td>Tagged object</td><td>"); | 84 | html("<tr><td>Tagged object</td><td>"); |
77 | cgit_object_link(tag->tagged); | 85 | cgit_object_link(tag->tagged); |
78 | html("</td></tr>\n"); | 86 | html("</td></tr>\n"); |
87 | if (ctx.repo->snapshots) | ||
88 | print_download_links(revname); | ||
79 | html("</table>\n"); | 89 | html("</table>\n"); |
80 | print_tag_content(info->msg); | 90 | print_tag_content(info->msg); |
81 | } else { | 91 | } else { |
82 | html("<table class='commit-info'>\n"); | 92 | html("<table class='commit-info'>\n"); |
83 | htmlf("<tr><td>Tag name</td><td>"); | 93 | htmlf("<tr><td>Tag name</td><td>"); |
84 | html_txt(revname); | 94 | html_txt(revname); |
85 | html("</td></tr>\n"); | 95 | html("</td></tr>\n"); |
86 | html("<tr><td>Tagged object</td><td>"); | 96 | html("<tr><td>Tagged object</td><td>"); |
87 | cgit_object_link(obj); | 97 | cgit_object_link(obj); |
88 | html("</td></tr>\n"); | 98 | html("</td></tr>\n"); |
99 | if (ctx.repo->snapshots) | ||
100 | print_download_links(revname); | ||
89 | html("</table>\n"); | 101 | html("</table>\n"); |
90 | } | 102 | } |
91 | return; | 103 | return; |
92 | } | 104 | } |