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