b451f2b71b1c0114cb860b5bc61676545ba2a98f
[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="post-author-local hidden"><% post.sone.local></div>
6         <div class="avatar">
7                 <%if post.loaded>
8                         <img src="/WebOfTrust/GetIdenticon?identity=<% post.sone.id|html>&amp;width=48&height=48" width="48" height="48" alt="Avatar Image" />
9                 <%else>
10                         <img src="images/sone-avatar.png" width="48" height="48" alt="Avatar Image" />
11                 <%/if>
12         </div>
13         <div class="inner-part">
14                 <div<%if !post.loaded> class="hidden"<%/if>>
15                         <div class="author profile-link"><a href="viewSone.html?sone=<% post.sone.id|html>"><% post.sone.niceName|html></a></div>
16                         <%ifnull !post.recipient>
17                                 <span class="recipient-to">→</span>
18                                 <%ifnull post.recipient.identity>
19                                         <div class="recipient profile-link"><a href="viewSone.html?sone=<% post.recipient.id|html>"><%= View.Post.UnknownAuthor|l10n|html></a></div>
20                                 <%else>
21                                         <div class="recipient profile-link"><a href="viewSone.html?sone=<% post.recipient.id|html>"><% post.recipient.niceName|html></a></div>
22                                 <%/if>
23                         <%/if>
24                         <% post.text|html|store key=originalText text=true>
25                         <% post.text|parse sone=post.sone|store key=parsedText text=true>
26                         <div class="post-text raw-text<%if !raw> hidden<%/if>"><% originalText></div>
27                         <div class="post-text text<%if raw> hidden<%/if>"><% parsedText></div>
28                 </div>
29                 <div class="post-status-line status-line<%if !post.loaded> hidden<%/if>">
30                         <div class="bookmarks">
31                                 <form class="unbookmark<%if !post.bookmarked> hidden<%/if>" action="unbookmark.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" title="<%= View.Post.Bookmarks.PostIsBookmarked|l10n|html>">★</button>
36                                 </form>
37                                 <form class="bookmark<%if post.bookmarked> hidden<%/if>" action="bookmark.html" method="post">
38                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
39                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
40                                         <input type="hidden" name="post" value="<% post.id|html>" />
41                                         <button type="submit" title="<%= View.Post.Bookmarks.PostIsNotBookmarked|l10n|html>">☆</button>
42                                 </form>
43                         </div>
44                         <span class='separator'>·</span>
45                         <div class="time"><a href="viewPost.html?post=<% post.id|html>"><% post.time|date format="MMM d, yyyy, HH:mm:ss"></a></div>
46                         <span class='separator'>·</span>
47                         <div class="permalink permalink-post"><a href="post://<%post.id|html>">[<%= View.Post.Permalink|l10n|html>]</a></div>
48                         <span class='separator'>·</span>
49                         <div class="permalink permalink-author"><a href="sone://<%post.sone.id|html>">[<%= View.Post.PermalinkAuthor|l10n|html>]</a></div>
50                         <%if ! originalText|match key=parsedText>
51                                 <span class='separator'>·</span>
52                                 <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>
53                         <%/if>
54                         <div class="likes<%if post.likes.size|match value=0> hidden<%/if>">
55                                 <span class='separator'>·</span>
56                                 <span title="<% post.likes.soneNames|html>">↑<span class="like-count"><% post.likes.size></span></span>
57                         </div>
58                         <%ifnull ! currentSone>
59                                 <span class='separator'>·</span>
60                                 <form class="like like-post<%if post.liked> hidden<%/if>" action="like.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="post" />
64                                         <input type="hidden" name="post" value="<% post.id|html>" />
65                                         <button type="submit" value="1"><%= View.Post.LikeLink|l10n|html></button>
66                                 </form>
67                                 <form class="unlike unlike-post<%if ! post.liked> hidden<%/if>" action="unlike.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="type" value="post" />
71                                         <input type="hidden" name="post" value="<% post.id|html>" />
72                                         <button type="submit" value="1"><%= View.Post.UnlikeLink|l10n|html></button>
73                                 </form>
74                                 <%if !post.sone.current>
75                                         <span class='separator'>·</span>
76                                         <form class="trust post-trust<%if post.sone.trust.assigned> hidden<%/if>" action="trust.html" method="post">
77                                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
78                                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
79                                                 <input type="hidden" name="sone" value="<% post.sone.id|html>" />
80                                                 <button type="submit" title="<%= View.Trust.Tooltip.Trust|l10n|html>">✓</button>
81                                         </form>
82                                         <form class="distrust post-distrust<%if post.sone.trust.assigned> hidden<%/if>" action="distrust.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="sone" value="<% post.sone.id|html>" />
86                                                 <button type="submit" title="<%= View.Trust.Tooltip.Distrust|l10n|html>">✗</button>
87                                         </form>
88                                         <form class="untrust post-untrust<%if !post.sone.trust.assigned> hidden<%/if>" action="untrust.html" method="post">
89                                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
90                                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
91                                                 <input type="hidden" name="sone" value="<% post.sone.id|html>" />
92                                                 <button type="submit" title="<%= View.Trust.Tooltip.Untrust|l10n|html>">↶</button>
93                                         </form>
94                                 <%/if>
95                         <%/if>
96                         <%if post.sone.local>
97                                 <span class='separator'>·</span>
98                                 <form class="delete delete-post" action="deletePost.html" method="post">
99                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
100                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
101                                         <input type="hidden" name="post" value="<% post.id|html>" />
102                                         <button type="submit"><%= View.Post.DeleteLink|l10n|html></button>
103                                 </form>
104                         <%/if>
105                 </div>
106                 <div<%if post.loaded> class="hidden"<%/if>>
107                         <%= View.Post.NotDownloaded|l10n|html>
108                 </div>
109                 <div class="replies">
110                         <%foreach post.replies reply>
111                                 <%include include/viewReply.html>
112                         <%/foreach>
113                         <%ifnull ! currentSone>
114                                 <div class="create-reply">
115                                         <form method="post" action="createReply.html">
116                                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
117                                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
118                                                 <input type="hidden" name="post" value="<% post.id|html>" />
119                                                 <div class="sender">
120                                                         <select name="sender" title="<%= View.UpdateStatus.Text.ChooseSenderIdentity|l10n|html>">
121                                                                 <%foreach localSones localSone|sort>
122                                                                         <option value="<% localSone.id|html>"<%if localSone.current> selected="selected"<%/if>><% localSone.niceName|html></option>
123                                                                 <%/foreach>
124                                                         </select>
125                                                 </div>
126                                                 <div class="select-sender"><button type="button" title="<%= View.UpdateStatus.Text.ChooseSenderIdentity|l10n|html>">+</button></div>
127                                                 <input type="text" class="reply-input" name="text" value="" />
128                                                 <button type="submit"><%= View.Post.SendReply|l10n|html></button>
129                                         </form>
130                                 </div>
131                         <%/if>
132                 </div>
133         </div>
134 </div>