Merge branch 'release-0.4'
[Sone.git] / src / main / resources / templates / include / viewPost.html
1 <a name="post-<% post.id|html>"></a>
2 <div id="<% post.id|html>" class="post<%if loop.last> last<%/if><%if post.new> new<%/if>">
3         <div class="post-time hidden"><% post.time|html></div>
4         <div class="post-author hidden"><% post.sone.id|html></div>
5         <div class="avatar">
6                 <img src="/WoT/GetIdenticon?identity=<% post.sone.id|html>&amp;width=48&height=48" width="48" height="48" alt="Avatar Image" />
7         </div>
8         <div class="inner-part">
9                 <div>
10                         <div class="author profile-link"><a href="viewSone.html?sone=<% post.sone.id|html>"><% post.sone.niceName|html></a></div>
11                         <%ifnull !post.recipient>
12                                 <span class="recipient-to">→</span>
13                                 <%ifnull post.recipient.identity>
14                                         <div class="recipient profile-link"><a href="viewSone.html?sone=<% post.recipient.id|html>"><%= View.Post.UnknownAuthor|l10n|html></a></div>
15                                 <%else>
16                                         <div class="recipient profile-link"><a href="viewSone.html?sone=<% post.recipient.id|html>"><% post.recipient.niceName|html></a></div>
17                                 <%/if>
18                         <%/if>
19                         <div class="text"><% post.text></div>
20                 </div>
21                 <div class="post-status-line status-line">
22                         <div class="time"><a href="viewPost.html?post=<% post.id|html>"><% post.time|date format="MMM d, yyyy, HH:mm:ss"></a></div>
23                         <span class='separator'>·</span>
24                         <div class="likes<%if post.likes.size|match value=0> hidden<%/if>"><span title="<% post.likes.soneNames|html>">↑<span class="like-count"><% post.likes.size></span></span></div>
25                         <%ifnull ! currentSone>
26                                 <form class="like like-post<%if post.liked> hidden<%/if>" action="like.html" method="post">
27                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
28                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
29                                         <input type="hidden" name="type" value="post" />
30                                         <input type="hidden" name="post" value="<% post.id|html>" />
31                                         <button type="submit" value="1"><%= View.Post.LikeLink|l10n|html></button>
32                                 </form>
33                                 <form class="unlike unlike-post<%if ! post.liked> hidden<%/if>" action="unlike.html" method="post">
34                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
35                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
36                                         <input type="hidden" name="type" value="post" />
37                                         <input type="hidden" name="post" value="<% post.id|html>" />
38                                         <button type="submit" value="1"><%= View.Post.UnlikeLink|l10n|html></button>
39                                 </form>
40                         <%/if>
41                         <%if !post.sone.current>
42                                 <span class='separator'>·</span>
43                                 <form class="trust post-trust<%if post.sone.trust.assigned> hidden<%/if>" action="trust.html" method="post">
44                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
45                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
46                                         <input type="hidden" name="sone" value="<% post.sone.id|html>" />
47                                         <button type="submit" title="<%= View.Trust.Tooltip.Trust|l10n|html>">✓</button>
48                                 </form>
49                                 <form class="distrust post-distrust" action="distrust.html" method="post">
50                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
51                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
52                                         <input type="hidden" name="sone" value="<% post.sone.id|html>" />
53                                         <button type="submit" title="<%= View.Trust.Tooltip.Distrust|l10n|html>">✗</button>
54                                 </form>
55                                 <form class="untrust post-untrust<%if !post.sone.trust.assigned> hidden<%/if>" action="untrust.html" method="post">
56                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
57                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
58                                         <input type="hidden" name="sone" value="<% post.sone.id|html>" />
59                                         <button type="submit" title="<%= View.Trust.Tooltip.Untrust|l10n|html>">↶</button>
60                                 </form>
61                         <%/if>
62                         <%if post.sone.current>
63                                 <span class='separator'>·</span>
64                                 <form class="delete delete-post" action="deletePost.html" method="post">
65                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
66                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
67                                         <input type="hidden" name="post" value="<% post.id|html>" />
68                                         <button type="submit"><%= View.Post.DeleteLink|l10n|html></button>
69                                 </form>
70                         <%/if>
71                 </div>
72                 <div class="replies">
73                         <%foreach post.replies reply>
74                                 <%include include/viewReply.html>
75                         <%/foreach>
76                         <%ifnull ! currentSone>
77                                 <div class="create-reply">
78                                         <form method="post" action="createReply.html">
79                                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
80                                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
81                                                 <input type="hidden" name="post" value="<% post.id|html>" />
82                                                 <input type="text" class="reply-input" name="text" value="" />
83                                                 <button type="submit"><%= View.Post.SendReply|l10n|html></button>
84                                         </form>
85                                 </div>
86                         <%/if>
87                 </div>
88         </div>
89 </div>