74e3450c7a18f8b525e1cdef202bfa7592b3bc76
[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|parse sone=post.sone></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                         <div class="likes<%if post.likes.size|match value=0> hidden<%/if>">
24                                 <span class='separator'>·</span>
25                                 <span title="<% post.likes.soneNames|html>">↑<span class="like-count"><% post.likes.size></span></span>
26                         </div>
27                         <%ifnull ! currentSone>
28                                 <span class='separator'>·</span>
29                                 <form class="like like-post<%if post.liked> hidden<%/if>" action="like.html" method="post">
30                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
31                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
32                                         <input type="hidden" name="type" value="post" />
33                                         <input type="hidden" name="post" value="<% post.id|html>" />
34                                         <button type="submit" value="1"><%= View.Post.LikeLink|l10n|html></button>
35                                 </form>
36                                 <form class="unlike unlike-post<%if ! post.liked> hidden<%/if>" action="unlike.html" method="post">
37                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
38                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
39                                         <input type="hidden" name="type" value="post" />
40                                         <input type="hidden" name="post" value="<% post.id|html>" />
41                                         <button type="submit" value="1"><%= View.Post.UnlikeLink|l10n|html></button>
42                                 </form>
43                                 <%if !post.sone.current>
44                                         <span class='separator'>·</span>
45                                         <form class="trust post-trust<%if post.sone.trust.assigned> hidden<%/if>" action="trust.html" method="post">
46                                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
47                                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
48                                                 <input type="hidden" name="sone" value="<% post.sone.id|html>" />
49                                                 <button type="submit" title="<%= View.Trust.Tooltip.Trust|l10n|html>">✓</button>
50                                         </form>
51                                         <form class="distrust post-distrust<%if post.sone.trust.assigned> hidden<%/if>" action="distrust.html" method="post">
52                                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
53                                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
54                                                 <input type="hidden" name="sone" value="<% post.sone.id|html>" />
55                                                 <button type="submit" title="<%= View.Trust.Tooltip.Distrust|l10n|html>">✗</button>
56                                         </form>
57                                         <form class="untrust post-untrust<%if !post.sone.trust.assigned> hidden<%/if>" action="untrust.html" method="post">
58                                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
59                                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
60                                                 <input type="hidden" name="sone" value="<% post.sone.id|html>" />
61                                                 <button type="submit" title="<%= View.Trust.Tooltip.Untrust|l10n|html>">↶</button>
62                                         </form>
63                                 <%/if>
64                         <%/if>
65                         <%if post.sone.local>
66                                 <span class='separator'>·</span>
67                                 <form class="delete delete-post" action="deletePost.html" method="post">
68                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
69                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
70                                         <input type="hidden" name="post" value="<% post.id|html>" />
71                                         <button type="submit"><%= View.Post.DeleteLink|l10n|html></button>
72                                 </form>
73                         <%/if>
74                 </div>
75                 <div class="replies">
76                         <%foreach post.replies reply>
77                                 <%include include/viewReply.html>
78                         <%/foreach>
79                         <%ifnull ! currentSone>
80                                 <div class="create-reply">
81                                         <form method="post" action="createReply.html">
82                                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
83                                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
84                                                 <input type="hidden" name="post" value="<% post.id|html>" />
85                                                 <div class="sender">
86                                                         <select name="sender" title="<%= View.UpdateStatus.Text.ChooseSenderIdentity|l10n|html>">
87                                                                 <%foreach localSones localSone>
88                                                                         <option value="<% localSone.id|html>"<%if localSone.current> selected="selected"<%/if>><% localSone.niceName|html></option>
89                                                                 <%/foreach>
90                                                         </select>
91                                                 </div>
92                                                 <div class="select-sender"><button type="button" title="<%= View.UpdateStatus.Text.ChooseSenderIdentity|l10n|html>">+</button></div>
93                                                 <input type="text" class="reply-input" name="text" value="" />
94                                                 <button type="submit"><%= View.Post.SendReply|l10n|html></button>
95                                         </form>
96                                 </div>
97                         <%/if>
98                 </div>
99         </div>
100 </div>