Store original and parsed text in contenxt, compare to hide “toggle” link.
[Sone.git] / src / main / resources / templates / include / viewReply.html
1 <div id="<% reply.id|html>" class="reply<%if reply.new> new<%/if>">
2         <a name="reply-<% reply.id|html>"></a>
3         <div class="reply-time hidden"><% reply.time|html></div>
4         <div class="reply-author hidden"><% reply.sone.id|html></div>
5         <div class="avatar">
6                 <img src="/WebOfTrust/GetIdenticon?identity=<% reply.sone.id|html>&amp;width=36&height=36" width="36" height="36" alt="Avatar Image" />
7         </div>
8         <div class="inner-part">
9                 <div>
10                         <div class="author profile-link"><a href="viewSone.html?sone=<% reply.sone.id|html>"><% reply.sone.niceName|html></a></div>
11                         <% reply.text|html|store key=originalText text=true>
12                         <% reply.text|parse sone=reply.sone|store key=parsedText text=true>
13                         <div class="reply-text raw-text<%if !raw> hidden<%/if>"><% originalText></div>
14                         <div class="reply-text text<%if raw> hidden<%/if>"><% parsedText></div>
15                 </div>
16                 <div class="reply-status-line status-line">
17                         <div class="time"><% reply.time|date format="MMM d, yyyy, HH:mm:ss"></div>
18                         <%if ! originalText|match key=parsedText>
19                                 <span class='separator'>·</span>
20                                 <div class="show-reply-source"><a href="viewPost.html?post=<% post.id|html>&amp;raw=<%if raw>false<%else>true<%/if>"><%= View.Post.ShowSource|l10n|html></a></div>
21                         <%/if>
22                         <div class="likes<%if reply.likes.size|match value=0> hidden<%/if>">
23                                 <span class='separator'>·</span>
24                                 <span title="<% reply.likes.soneNames|html>">↑<span class="like-count"><% reply.likes.size></span></span>
25                         </div>
26                         <%ifnull ! currentSone>
27                                 <span class='separator'>·</span>
28                                 <form class="like like-reply<%if reply.liked> hidden<%/if>" action="like.html" method="post">
29                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
30                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
31                                         <input type="hidden" name="type" value="reply" />
32                                         <input type="hidden" name="reply" value="<% reply.id|html>" />
33                                         <button type="submit" value="1"><%= View.Post.LikeLink|l10n|html></button>
34                                 </form>
35                                 <form class="unlike unlike-reply<%if ! reply.liked> hidden<%/if>" action="unlike.html" method="post">
36                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
37                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
38                                         <input type="hidden" name="type" value="reply" />
39                                         <input type="hidden" name="reply" value="<% reply.id|html>" />
40                                         <button type="submit" value="1"><%= View.Post.UnlikeLink|l10n|html></button>
41                                 </form>
42                                 <%if !reply.sone.current>
43                                         <span class='separator'>·</span>
44                                         <form class="trust reply-trust<%if reply.sone.trust.assigned> hidden<%/if>" action="trust.html" method="post">
45                                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
46                                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
47                                                 <input type="hidden" name="sone" value="<% reply.sone.id|html>" />
48                                                 <button type="submit" title="<%= View.Trust.Tooltip.Trust|l10n|html>">✓</button>
49                                         </form>
50                                         <form class="distrust reply-distrust<%if reply.sone.trust.assigned> hidden<%/if>" action="distrust.html" method="post">
51                                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
52                                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
53                                                 <input type="hidden" name="sone" value="<% reply.sone.id|html>" />
54                                                 <button type="submit" title="<%= View.Trust.Tooltip.Distrust|l10n|html>">✗</button>
55                                         </form>
56                                         <form class="untrust reply-untrust<%if !reply.sone.trust.assigned> hidden<%/if>" action="untrust.html" method="post">
57                                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
58                                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
59                                                 <input type="hidden" name="sone" value="<% reply.sone.id|html>" />
60                                                 <button type="submit" title="<%= View.Trust.Tooltip.Untrust|l10n|html>">↶</button>
61                                         </form>
62                                 <%/if>
63                         <%/if>
64                         <%if reply.sone.local>
65                                 <span class='separator'>·</span>
66                                 <form class="delete delete-reply" action="deleteReply.html" method="post">
67                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
68                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
69                                         <input type="hidden" name="reply" value="<% reply.id|html>" />
70                                         <button type="submit"><%= View.Post.Reply.DeleteLink|l10n|html></button>
71                                 </form>
72                         <%/if>
73                 </div>
74         </div>
75 </div>