Add WoT identicons as avatars.
[Sone.git] / src / main / resources / templates / include / viewPost.html
1 <div id="<% post.id|html>" class="post<%if loop.last> last<%/if>">
2         <div class="avatar">
3                 <img src="/WoT/GetIdenticon?identity=<% post.sone.id|html>&amp;width=48&height=48" width="48" height="48" alt="Avatar Image" />
4         </div>
5         <div class="inner-part">
6         <div>
7                 <div class="author profile-link"><a href="viewSone.html?sone=<% post.sone.id|html>"><% post.sone.niceName|html></a></div>
8                 <div class="text"><% post.text|html></div>
9         </div>
10         <div class="status-line">
11                 <div class="time"><a href="viewPost.html?post=<% post.id|html>"><% post.time|date format="MMM d, yyyy, HH:mm:ss"></a></div>
12                 <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>
13                 <%ifnull ! currentSone>
14                         <form class="like<%if post.liked> hidden<%/if>" action="like.html" method="post">
15                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
16                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
17                                 <input type="hidden" name="type" value="post" />
18                                 <input type="hidden" name="post" value="<% post.id|html>" />
19                                 <button type="submit" value="1"><%= View.Post.LikeLink|l10n|html></button>
20                         </form>
21                         <form class="unlike<%if ! post.liked> hidden<%/if>" action="unlike.html" method="post">
22                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
23                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
24                                 <input type="hidden" name="type" value="post" />
25                                 <input type="hidden" name="post" value="<% post.id|html>" />
26                                 <button type="submit" value="1"><%= View.Post.UnlikeLink|l10n|html></button>
27                         </form>
28                 <%/if>
29                 <%if post.sone.current>
30                         <form class="delete" action="deletePost.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"><%= View.Post.DeleteLink|l10n|html></button>
35                         </form>
36                 <%/if>
37         </div>
38         <div class="replies">
39                 <%foreach post.replies reply>
40                         <div id="<% reply.id|html>" class="reply">
41                                 <div class="avatar">
42                                         <img src="/WoT/GetIdenticon?identity=<% reply.sone.id|html>&amp;width=36&height=36" width="36" height="36" alt="Avatar Image" />
43                                 </div>
44                                 <div class="inner-part">
45                                 <div>
46                                         <div class="author profile-link"><a href="viewSone.html?sone=<% reply.sone.id|html>"><% reply.sone.niceName|html></a></div>
47                                         <div class="text"><% reply.text|html></div>
48                                 </div>
49                                 <div class="status-line">
50                                         <div class="time"><% reply.time|date format="MMM d, yyyy, HH:mm:ss"></div>
51                                         <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>
52                                         <%ifnull ! currentSone>
53                                                 <form class="like<%if reply.liked> hidden<%/if>" action="like.html" method="post">
54                                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
55                                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
56                                                         <input type="hidden" name="type" value="reply" />
57                                                         <input type="hidden" name="reply" value="<% reply.id|html>" />
58                                                         <button type="submit" value="1"><%= View.Post.LikeLink|l10n|html></button>
59                                                 </form>
60                                                 <form class="unlike<%if ! reply.liked> hidden<%/if>" action="unlike.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="type" value="reply" />
64                                                         <input type="hidden" name="reply" value="<% reply.id|html>" />
65                                                         <button type="submit" value="1"><%= View.Post.UnlikeLink|l10n|html></button>
66                                                 </form>
67                                         <%/if>
68                                         <%if reply.sone.current>
69                                                 <form class="delete" action="deleteReply.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="reply" value="<% reply.id|html>" />
73                                                         <button type="submit"><%= View.Post.Reply.DeleteLink|l10n|html></button>
74                                                 </form>
75                                         <%/if>
76                                 </div>
77                                 </div>
78                         </div>
79                 <%/foreach>
80                 <%ifnull ! currentSone>
81                         <div class="create-reply">
82                                 <form method="post" action="createReply.html">
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                                         <input type="text" class="reply-input" name="text" value="" />
87                                         <button type="submit"><%= View.Post.SendReply|l10n|html></button>
88                                 </form>
89                         </div>
90                 <%/if>
91         </div>
92         </div>
93 </div>