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