Show custom avatar where applicable.
[Sone.git] / src / main / resources / templates / include / viewReply.html
1 <div id="reply-<% reply.id|html>" class="reply<%if !reply.sone.local><%if reply.new> new<%/if><%/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="reply-author-local hidden"><% reply.sone.local></div>
6         <%include include/soneMenu.html class=="sone-reply-menu" sone=reply.sone>
7         <div class="avatar reply-avatar">
8                 <%ifnull !reply.sone.avatar>
9                         <% reply.sone.avatar|image-link max-width=36 max-height=36 mode=enlarge title="Avatar Image">
10                 <%else>
11                         <img src="/WebOfTrust/GetIdenticon?identity=<% reply.sone.id|html>&amp;width=36&height=36" width="36" height="36" alt="Avatar Image" />
12                 <%/if>
13         </div>
14         <div class="inner-part">
15                 <div>
16                         <div class="author profile-link"><a href="viewSone.html?sone=<% reply.sone.id|html>"><% reply.sone.niceName|html></a></div>
17                         <% reply.text|html|store key=originalText text=true>
18                         <% reply.text|parse sone=reply.sone|store key=parsedText text=true>
19                         <% reply.text|parse sone=reply.sone length=core.preferences.charactersPerPost cut-off-length=core.preferences.postCutOffLength|store key=shortText text=true>
20                         <div class="reply-text raw-text<%if !raw> hidden<%/if>"><% originalText></div>
21                         <div class="reply-text text<%if raw> hidden<%/if><%if !shortText|match key=parsedText> hidden<%/if>"><% parsedText></div>
22                         <div class="reply-text short-text<%if raw> hidden<%/if><%if shortText|match key=parsedText> hidden<%/if>"><% shortText></div>
23                         <%if !shortText|match key=parsedText><%if !raw><a class="expand-reply-text" href="viewPost.html?post=<% reply.post.id|html>&amp;raw=true"><%= View.Post.ShowMore|l10n|html></a><%/if><%/if>
24                         <%if !shortText|match key=parsedText><%if !raw><a class="shrink-reply-text hidden"><%= View.Post.ShowLess|l10n|html></a><%/if><%/if>
25                 </div>
26                 <div class="reply-status-line status-line">
27                         <div class="time"><% reply.time|date format="MMM d, yyyy, HH:mm:ss"></div>
28                         <span class='separator'>·</span>
29                         <div class="permalink permalink-author"><a href="sone://<%reply.sone.id|html>">[<%= View.Post.PermalinkAuthor|l10n|html>]</a></div>
30                         <%if ! originalText|match key=parsedText>
31                                 <span class='separator'>·</span>
32                                 <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>
33                         <%/if>
34                         <div class="likes<%if reply.likes.size|match value=0> hidden<%/if>">
35                                 <span class='separator'>·</span>
36                                 <span title="<% reply.likes.soneNames|html>">↑<span class="like-count"><% reply.likes.size></span></span>
37                         </div>
38                         <%ifnull ! currentSone>
39                                 <span class='separator'>·</span>
40                                 <form class="like like-reply<%if reply.liked> hidden<%/if>" action="like.html" method="post">
41                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
42                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
43                                         <input type="hidden" name="type" value="reply" />
44                                         <input type="hidden" name="reply" value="<% reply.id|html>" />
45                                         <button type="submit" value="1"><%= View.Post.LikeLink|l10n|html></button>
46                                 </form>
47                                 <form class="unlike unlike-reply<%if ! reply.liked> hidden<%/if>" action="unlike.html" method="post">
48                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
49                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
50                                         <input type="hidden" name="type" value="reply" />
51                                         <input type="hidden" name="reply" value="<% reply.id|html>" />
52                                         <button type="submit" value="1"><%= View.Post.UnlikeLink|l10n|html></button>
53                                 </form>
54                                 <%if !reply.sone.current>
55                                         <span class='separator'>·</span>
56                                         <form class="trust reply-trust<%if reply.sone.trust.assigned> hidden<%/if>" action="trust.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.Trust|l10n|html>">✓</button>
61                                         </form>
62                                         <form class="distrust reply-distrust<%if reply.sone.trust.assigned> hidden<%/if>" action="distrust.html" method="post">
63                                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
64                                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
65                                                 <input type="hidden" name="sone" value="<% reply.sone.id|html>" />
66                                                 <button type="submit" title="<%= View.Trust.Tooltip.Distrust|l10n|html>">✗</button>
67                                         </form>
68                                         <form class="untrust reply-untrust<%if !reply.sone.trust.assigned> hidden<%/if>" action="untrust.html" method="post">
69                                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
70                                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
71                                                 <input type="hidden" name="sone" value="<% reply.sone.id|html>" />
72                                                 <button type="submit" title="<%= View.Trust.Tooltip.Untrust|l10n|html>">↶</button>
73                                         </form>
74                                 <%/if>
75                         <%/if>
76                         <%if reply.sone.local>
77                                 <span class='separator'>·</span>
78                                 <form class="delete delete-reply" action="deleteReply.html" method="post">
79                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
80                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
81                                         <input type="hidden" name="reply" value="<% reply.id|html>" />
82                                         <button type="submit"><%= View.Post.Reply.DeleteLink|l10n|html></button>
83                                 </form>
84                         <%/if>
85                 </div>
86         </div>
87 </div>