Add anchors to posts and replies.
[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="avatar">
4                 <img src="/WoT/GetIdenticon?identity=<% post.sone.id|html>&amp;width=48&height=48" width="48" height="48" alt="Avatar Image" />
5         </div>
6         <div class="inner-part">
7                 <div>
8                         <div class="author profile-link"><a href="viewSone.html?sone=<% post.sone.id|html>"><% post.sone.niceName|html></a></div>
9                         <div class="text"><% post.text|html></div>
10                 </div>
11                 <div class="status-line">
12                         <div class="time"><a href="viewPost.html?post=<% post.id|html>"><% post.time|date format="MMM d, yyyy, HH:mm:ss"></a></div>
13                         <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>
14                         <%ifnull ! currentSone>
15                                 <form class="like<%if post.liked> hidden<%/if>" action="like.html" method="post">
16                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
17                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
18                                         <input type="hidden" name="type" value="post" />
19                                         <input type="hidden" name="post" value="<% post.id|html>" />
20                                         <button type="submit" value="1"><%= View.Post.LikeLink|l10n|html></button>
21                                 </form>
22                                 <form class="unlike<%if ! post.liked> hidden<%/if>" action="unlike.html" method="post">
23                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
24                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
25                                         <input type="hidden" name="type" value="post" />
26                                         <input type="hidden" name="post" value="<% post.id|html>" />
27                                         <button type="submit" value="1"><%= View.Post.UnlikeLink|l10n|html></button>
28                                 </form>
29                         <%/if>
30                         <%if post.sone.current>
31                                 <form class="delete" action="deletePost.html" method="post">
32                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
33                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
34                                         <input type="hidden" name="post" value="<% post.id|html>" />
35                                         <button type="submit"><%= View.Post.DeleteLink|l10n|html></button>
36                                 </form>
37                         <%/if>
38                 </div>
39                 <div class="replies">
40                         <%foreach post.replies reply>
41                                 <a name="reply-<% reply.id|html>"></a>
42                                 <div id="<% reply.id|html>" class="reply<%if reply.new> new<%/if>">
43                                         <div class="avatar">
44                                                 <img src="/WoT/GetIdenticon?identity=<% reply.sone.id|html>&amp;width=36&height=36" width="36" height="36" alt="Avatar Image" />
45                                         </div>
46                                         <div class="inner-part">
47                                                 <div>
48                                                         <div class="author profile-link"><a href="viewSone.html?sone=<% reply.sone.id|html>"><% reply.sone.niceName|html></a></div>
49                                                         <div class="text"><% reply.text|html></div>
50                                                 </div>
51                                                 <div class="status-line">
52                                                         <div class="time"><% reply.time|date format="MMM d, yyyy, HH:mm:ss"></div>
53                                                         <div class="likes<%if reply.likes.size|match value=0> hidden<%/if>"><span title="<% reply.likes.soneNames|html>">⬆<span class="like-count"><% reply.likes.size></span></span></div>
54                                                         <%ifnull ! currentSone>
55                                                                 <form class="like<%if reply.liked> hidden<%/if>" action="like.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="type" value="reply" />
59                                                                         <input type="hidden" name="reply" value="<% reply.id|html>" />
60                                                                         <button type="submit" value="1"><%= View.Post.LikeLink|l10n|html></button>
61                                                                 </form>
62                                                                 <form class="unlike<%if ! reply.liked> hidden<%/if>" action="unlike.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="type" value="reply" />
66                                                                         <input type="hidden" name="reply" value="<% reply.id|html>" />
67                                                                         <button type="submit" value="1"><%= View.Post.UnlikeLink|l10n|html></button>
68                                                                 </form>
69                                                         <%/if>
70                                                         <%if reply.sone.current>
71                                                                 <form class="delete" action="deleteReply.html" method="post">
72                                                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
73                                                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
74                                                                         <input type="hidden" name="reply" value="<% reply.id|html>" />
75                                                                         <button type="submit"><%= View.Post.Reply.DeleteLink|l10n|html></button>
76                                                                 </form>
77                                                         <%/if>
78                                                 </div>
79                                         </div>
80                                 </div>
81                         <%/foreach>
82                         <%ifnull ! currentSone>
83                                 <div class="create-reply">
84                                         <form method="post" action="createReply.html">
85                                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
86                                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
87                                                 <input type="hidden" name="post" value="<% post.id|html>" />
88                                                 <input type="text" class="reply-input" name="text" value="" />
89                                                 <button type="submit"><%= View.Post.SendReply|l10n|html></button>
90                                         </form>
91                                 </div>
92                         <%/if>
93                 </div>
94         </div>
95 </div>