676fa6add4f14553b5a6b62a695803a43a50b8c6
[Sone.git] / src / main / resources / templates / include / viewPost.html
1 <div id="<% post.id|html>" class="post<%if loop.last> last<%/if><%if post.new> new<%/if>">
2         <a name="post-<% post.id|html>"></a>
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="/WebOfTrust/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="post-text raw-text<%if !raw> hidden<%/if>"><% post.text|html></div>
20                         <div class="post-text text<%if raw> hidden<%/if>"><% post.text|parse sone=post.sone></div>
21                 </div>
22                 <div class="post-status-line status-line">
23                         <div class="bookmarks">
24                                 <form class="unbookmark<%if !post.bookmarked> hidden<%/if>" action="unbookmark.html" method="post">
25                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
26                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
27                                         <input type="hidden" name="post" value="<% post.id|html>" />
28                                         <button type="submit" title="<%= View.Post.Bookmarks.PostIsBookmarked|l10n|html>">★</button>
29                                 </form>
30                                 <form class="bookmark<%if post.bookmarked> hidden<%/if>" action="bookmark.html" method="post">
31                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
32                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
33                                         <input type="hidden" name="post" value="<% post.id|html>" />
34                                         <button type="submit" title="<%= View.Post.Bookmarks.PostIsNotBookmarked|l10n|html>">☆</button>
35                                 </form>
36                         </div>
37                         <span class='separator'>·</span>
38                         <div class="time"><a href="viewPost.html?post=<% post.id|html>"><% post.time|date format="MMM d, yyyy, HH:mm:ss"></a></div>
39                         <span class='separator'>·</span>
40                         <div class="show-source"><a href="viewPost.html?post=<% post.id|html>&amp;raw=<%if raw>false<%else>true<%/if>"><%= View.Post.ShowSource|l10n|html></a></div>
41                         <div class="likes<%if post.likes.size|match value=0> hidden<%/if>">
42                                 <span class='separator'>·</span>
43                                 <span title="<% post.likes.soneNames|html>">↑<span class="like-count"><% post.likes.size></span></span>
44                         </div>
45                         <%ifnull ! currentSone>
46                                 <span class='separator'>·</span>
47                                 <form class="like like-post<%if post.liked> hidden<%/if>" action="like.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="post" />
51                                         <input type="hidden" name="post" value="<% post.id|html>" />
52                                         <button type="submit" value="1"><%= View.Post.LikeLink|l10n|html></button>
53                                 </form>
54                                 <form class="unlike unlike-post<%if ! post.liked> hidden<%/if>" action="unlike.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="type" value="post" />
58                                         <input type="hidden" name="post" value="<% post.id|html>" />
59                                         <button type="submit" value="1"><%= View.Post.UnlikeLink|l10n|html></button>
60                                 </form>
61                                 <%if !post.sone.current>
62                                         <span class='separator'>·</span>
63                                         <form class="trust post-trust<%if post.sone.trust.assigned> hidden<%/if>" action="trust.html" method="post">
64                                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
65                                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
66                                                 <input type="hidden" name="sone" value="<% post.sone.id|html>" />
67                                                 <button type="submit" title="<%= View.Trust.Tooltip.Trust|l10n|html>">✓</button>
68                                         </form>
69                                         <form class="distrust post-distrust<%if post.sone.trust.assigned> hidden<%/if>" action="distrust.html" method="post">
70                                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
71                                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
72                                                 <input type="hidden" name="sone" value="<% post.sone.id|html>" />
73                                                 <button type="submit" title="<%= View.Trust.Tooltip.Distrust|l10n|html>">✗</button>
74                                         </form>
75                                         <form class="untrust post-untrust<%if !post.sone.trust.assigned> hidden<%/if>" action="untrust.html" method="post">
76                                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
77                                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
78                                                 <input type="hidden" name="sone" value="<% post.sone.id|html>" />
79                                                 <button type="submit" title="<%= View.Trust.Tooltip.Untrust|l10n|html>">↶</button>
80                                         </form>
81                                 <%/if>
82                         <%/if>
83                         <%if post.sone.local>
84                                 <span class='separator'>·</span>
85                                 <form class="delete delete-post" action="deletePost.html" method="post">
86                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
87                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
88                                         <input type="hidden" name="post" value="<% post.id|html>" />
89                                         <button type="submit"><%= View.Post.DeleteLink|l10n|html></button>
90                                 </form>
91                         <%/if>
92                 </div>
93                 <div class="replies">
94                         <%foreach post.replies reply>
95                                 <%include include/viewReply.html>
96                         <%/foreach>
97                         <%ifnull ! currentSone>
98                                 <div class="create-reply">
99                                         <form method="post" action="createReply.html">
100                                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
101                                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
102                                                 <input type="hidden" name="post" value="<% post.id|html>" />
103                                                 <div class="sender">
104                                                         <select name="sender" title="<%= View.UpdateStatus.Text.ChooseSenderIdentity|l10n|html>">
105                                                                 <%foreach localSones localSone|sort>
106                                                                         <option value="<% localSone.id|html>"<%if localSone.current> selected="selected"<%/if>><% localSone.niceName|html></option>
107                                                                 <%/foreach>
108                                                         </select>
109                                                 </div>
110                                                 <div class="select-sender"><button type="button" title="<%= View.UpdateStatus.Text.ChooseSenderIdentity|l10n|html>">+</button></div>
111                                                 <input type="text" class="reply-input" name="text" value="" />
112                                                 <button type="submit"><%= View.Post.SendReply|l10n|html></button>
113                                         </form>
114                                 </div>
115                         <%/if>
116                 </div>
117         </div>
118 </div>