Add star for bookmarks in post view.
[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="/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="bookmarks">
23                                 <form class="bookmarked<%if !post.bookmarked> hidden<%/if>" action="bookmark.html" method="post">
24                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
25                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
26                                         <input type="hidden" name="post" value="<% post.id|html>" />
27                                         <button type="submit" title="<%= View.Post.Bookmarks.PostIsBookmarked|l10n|html>">★</button>
28                                 </form>
29                                 <form class="not-bookmarked<%if post.bookmarked> hidden<%/if>" action="unbookmark.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="post" value="<% post.id|html>" />
33                                         <button type="submit" title="<%= View.Post.Bookmarks.PostIsNotBookmarked|l10n|html>">☆</button>
34                                 </form>
35                         </div>
36                         <span class='separator'>·</span>
37                         <div class="time"><a href="viewPost.html?post=<% post.id|html>"><% post.time|date format="MMM d, yyyy, HH:mm:ss"></a></div>
38                         <div class="likes<%if post.likes.size|match value=0> hidden<%/if>">
39                                 <span class='separator'>·</span>
40                                 <span title="<% post.likes.soneNames|html>">↑<span class="like-count"><% post.likes.size></span></span>
41                         </div>
42                         <%ifnull ! currentSone>
43                                 <span class='separator'>·</span>
44                                 <form class="like like-post<%if post.liked> hidden<%/if>" action="like.html" method="post">
45                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
46                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
47                                         <input type="hidden" name="type" value="post" />
48                                         <input type="hidden" name="post" value="<% post.id|html>" />
49                                         <button type="submit" value="1"><%= View.Post.LikeLink|l10n|html></button>
50                                 </form>
51                                 <form class="unlike unlike-post<%if ! post.liked> hidden<%/if>" action="unlike.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="type" value="post" />
55                                         <input type="hidden" name="post" value="<% post.id|html>" />
56                                         <button type="submit" value="1"><%= View.Post.UnlikeLink|l10n|html></button>
57                                 </form>
58                                 <%if !post.sone.current>
59                                         <span class='separator'>·</span>
60                                         <form class="trust post-trust<%if post.sone.trust.assigned> hidden<%/if>" action="trust.html" method="post">
61                                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
62                                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
63                                                 <input type="hidden" name="sone" value="<% post.sone.id|html>" />
64                                                 <button type="submit" title="<%= View.Trust.Tooltip.Trust|l10n|html>">✓</button>
65                                         </form>
66                                         <form class="distrust post-distrust<%if post.sone.trust.assigned> hidden<%/if>" action="distrust.html" method="post">
67                                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
68                                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
69                                                 <input type="hidden" name="sone" value="<% post.sone.id|html>" />
70                                                 <button type="submit" title="<%= View.Trust.Tooltip.Distrust|l10n|html>">✗</button>
71                                         </form>
72                                         <form class="untrust post-untrust<%if !post.sone.trust.assigned> hidden<%/if>" action="untrust.html" method="post">
73                                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
74                                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
75                                                 <input type="hidden" name="sone" value="<% post.sone.id|html>" />
76                                                 <button type="submit" title="<%= View.Trust.Tooltip.Untrust|l10n|html>">↶</button>
77                                         </form>
78                                 <%/if>
79                         <%/if>
80                         <%if post.sone.local>
81                                 <span class='separator'>·</span>
82                                 <form class="delete delete-post" action="deletePost.html" method="post">
83                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
84                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
85                                         <input type="hidden" name="post" value="<% post.id|html>" />
86                                         <button type="submit"><%= View.Post.DeleteLink|l10n|html></button>
87                                 </form>
88                         <%/if>
89                 </div>
90                 <div class="replies">
91                         <%foreach post.replies reply>
92                                 <%include include/viewReply.html>
93                         <%/foreach>
94                         <%ifnull ! currentSone>
95                                 <div class="create-reply">
96                                         <form method="post" action="createReply.html">
97                                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
98                                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
99                                                 <input type="hidden" name="post" value="<% post.id|html>" />
100                                                 <div class="sender">
101                                                         <select name="sender" title="<%= View.UpdateStatus.Text.ChooseSenderIdentity|l10n|html>">
102                                                                 <%foreach localSones localSone|sort>
103                                                                         <option value="<% localSone.id|html>"<%if localSone.current> selected="selected"<%/if>><% localSone.niceName|html></option>
104                                                                 <%/foreach>
105                                                         </select>
106                                                 </div>
107                                                 <div class="select-sender"><button type="button" title="<%= View.UpdateStatus.Text.ChooseSenderIdentity|l10n|html>">+</button></div>
108                                                 <input type="text" class="reply-input" name="text" value="" />
109                                                 <button type="submit"><%= View.Post.SendReply|l10n|html></button>
110                                         </form>
111                                 </div>
112                         <%/if>
113                 </div>
114         </div>
115 </div>