author | Martin Szulecki <opensuse@sukimashita.com> | 2009-08-07 12:05:17 (UTC) |
---|---|---|
committer | Martin Szulecki <opensuse@sukimashita.com> | 2009-08-08 12:23:28 (UTC) |
commit | 2f56e390f04fe6975b75e512c1436ef173e4aafe (patch) (unidiff) | |
tree | 4e187a5cf039a39a1908623b97e0676c6e7cb756 /ui-tag.c | |
parent | 286a905842dc0bec6d21a614ec4a97c5f19d5bc4 (diff) | |
download | cgit-2f56e390f04fe6975b75e512c1436ef173e4aafe.zip cgit-2f56e390f04fe6975b75e512c1436ef173e4aafe.tar.gz cgit-2f56e390f04fe6975b75e512c1436ef173e4aafe.tar.bz2 |
Introduce noplainemail option to hide email adresses from spambots
Signed-off-by: Martin Szulecki <opensuse@sukimashita.com>
-rw-r--r-- | ui-tag.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -19,71 +19,71 @@ static void print_tag_content(char *buf) | |||
19 | 19 | ||
20 | html("<div class='commit-subject'>"); | 20 | html("<div class='commit-subject'>"); |
21 | p = strchr(buf, '\n'); | 21 | p = strchr(buf, '\n'); |
22 | if (p) | 22 | if (p) |
23 | *p = '\0'; | 23 | *p = '\0'; |
24 | html_txt(buf); | 24 | html_txt(buf); |
25 | html("</div>"); | 25 | html("</div>"); |
26 | if (p) { | 26 | if (p) { |
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 cgit_print_tag(char *revname) | 33 | void cgit_print_tag(char *revname) |
34 | { | 34 | { |
35 | unsigned char sha1[20]; | 35 | unsigned char sha1[20]; |
36 | struct object *obj; | 36 | struct object *obj; |
37 | struct tag *tag; | 37 | struct tag *tag; |
38 | struct taginfo *info; | 38 | struct taginfo *info; |
39 | 39 | ||
40 | if (get_sha1(revname, sha1)) { | 40 | if (get_sha1(revname, sha1)) { |
41 | cgit_print_error(fmt("Bad tag reference: %s", revname)); | 41 | cgit_print_error(fmt("Bad tag reference: %s", revname)); |
42 | return; | 42 | return; |
43 | } | 43 | } |
44 | obj = parse_object(sha1); | 44 | obj = parse_object(sha1); |
45 | if (!obj) { | 45 | if (!obj) { |
46 | cgit_print_error(fmt("Bad object id: %s", sha1_to_hex(sha1))); | 46 | cgit_print_error(fmt("Bad object id: %s", sha1_to_hex(sha1))); |
47 | return; | 47 | return; |
48 | } | 48 | } |
49 | if (obj->type == OBJ_TAG) { | 49 | if (obj->type == OBJ_TAG) { |
50 | tag = lookup_tag(sha1); | 50 | tag = lookup_tag(sha1); |
51 | if (!tag || parse_tag(tag) || !(info = cgit_parse_tag(tag))) { | 51 | if (!tag || parse_tag(tag) || !(info = cgit_parse_tag(tag))) { |
52 | cgit_print_error(fmt("Bad tag object: %s", revname)); | 52 | cgit_print_error(fmt("Bad tag object: %s", revname)); |
53 | return; | 53 | return; |
54 | } | 54 | } |
55 | html("<table class='commit-info'>\n"); | 55 | html("<table class='commit-info'>\n"); |
56 | htmlf("<tr><td>Tag name</td><td>"); | 56 | htmlf("<tr><td>Tag name</td><td>"); |
57 | html_txt(revname); | 57 | html_txt(revname); |
58 | htmlf(" (%s)</td></tr>\n", sha1_to_hex(sha1)); | 58 | htmlf(" (%s)</td></tr>\n", sha1_to_hex(sha1)); |
59 | if (info->tagger_date > 0) { | 59 | if (info->tagger_date > 0) { |
60 | html("<tr><td>Tag date</td><td>"); | 60 | html("<tr><td>Tag date</td><td>"); |
61 | cgit_print_date(info->tagger_date, FMT_LONGDATE, ctx.cfg.local_time); | 61 | cgit_print_date(info->tagger_date, FMT_LONGDATE, ctx.cfg.local_time); |
62 | html("</td></tr>\n"); | 62 | html("</td></tr>\n"); |
63 | } | 63 | } |
64 | if (info->tagger) { | 64 | if (info->tagger) { |
65 | html("<tr><td>Tagged by</td><td>"); | 65 | html("<tr><td>Tagged by</td><td>"); |
66 | html_txt(info->tagger); | 66 | html_txt(info->tagger); |
67 | if (info->tagger_email) { | 67 | if (info->tagger_email && !ctx.cfg.noplainemail) { |
68 | html(" "); | 68 | html(" "); |
69 | html_txt(info->tagger_email); | 69 | html_txt(info->tagger_email); |
70 | } | 70 | } |
71 | html("</td></tr>\n"); | 71 | html("</td></tr>\n"); |
72 | } | 72 | } |
73 | html("<tr><td>Tagged object</td><td>"); | 73 | html("<tr><td>Tagged object</td><td>"); |
74 | cgit_object_link(tag->tagged); | 74 | cgit_object_link(tag->tagged); |
75 | html("</td></tr>\n"); | 75 | html("</td></tr>\n"); |
76 | html("</table>\n"); | 76 | html("</table>\n"); |
77 | print_tag_content(info->msg); | 77 | print_tag_content(info->msg); |
78 | } else { | 78 | } else { |
79 | html("<table class='commit-info'>\n"); | 79 | html("<table class='commit-info'>\n"); |
80 | htmlf("<tr><td>Tag name</td><td>"); | 80 | htmlf("<tr><td>Tag name</td><td>"); |
81 | html_txt(revname); | 81 | html_txt(revname); |
82 | html("</td></tr>\n"); | 82 | html("</td></tr>\n"); |
83 | html("<tr><td>Tagged object</td><td>"); | 83 | html("<tr><td>Tagged object</td><td>"); |
84 | cgit_object_link(obj); | 84 | cgit_object_link(obj); |
85 | html("</td></tr>\n"); | 85 | html("</td></tr>\n"); |
86 | html("</table>\n"); | 86 | html("</table>\n"); |
87 | } | 87 | } |
88 | return; | 88 | return; |
89 | } | 89 | } |