🔀 Merge “release/v81” into “master”
[Sone.git] / src / main / resources / templates / include / viewPost.html
1 <div id="post-<% post.id|html>" class="post<%if loop.last> last<%/if><%if !post.sone.local><%if post.new> new<%/if><%/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         <%include include/soneMenu.html class=="sone-post-menu" sone=post.sone>
7         <div class="avatar post-avatar" >
8                 <%if post.loaded>
9                         <%ifnull !post.sone.profile.avatar>
10                                 <%post.sone.profile.avatar|image-link max-width==48 max-height==48 mode==enlarge title=="Avatar Image">
11                         <%else>
12                                 <img src="/WebOfTrust/GetIdenticon?identity=<% post.sone.id|html>&amp;width=96&amp;height=96" width="48" height="48" alt="Avatar Image" />
13                         <%/if>
14                 <%else>
15                         <img src="images/sone-avatar.png" width="48" height="48" alt="Avatar Image" />
16                 <%/if>
17         </div>
18         <div class="inner-part">
19                 <div<%if !post.loaded> class="hidden"<%/if>>
20                         <div class="author profile-link"><a href="viewSone.html?sone=<% post.sone.id|html>"><% post.sone.niceName|html></a></div>
21                         <%if post.recipientId.present>
22                                 <span class="recipient-to">→</span>
23                                 <%if !post.recipient.present>
24                                         <div class="recipient profile-link"><a href="viewSone.html?sone=<% post.recipientId.get|html>"><%= View.Post.UnknownAuthor|l10n|html></a></div>
25                                 <%else>
26                                         <div class="recipient profile-link"><a href="viewSone.html?sone=<% post.recipientId.get|html>"><% post.recipient.get.niceName|html></a></div>
27                                 <%/if>
28                         <%/if>
29                         <% post.text|html|store key==originalText text==true>
30                         <% post.text|parse sone=post.sone|store key==parsedText>
31                         <% parsedText|render|store key==renderedText text==true>
32                         <% parsedText|shorten length=preferences.charactersPerPost cut-off-length=preferences.postCutOffLength|render|store key==shortText text==true>
33                         <div class="post-text raw-text<%if !raw> hidden<%/if>"><% originalText></div>
34                         <div class="post-text text<%if raw> hidden<%/if><%if !shortText|match key=renderedText> hidden<%/if>"><% renderedText></div>
35                         <div class="post-text short-text<%if raw> hidden<%/if><%if shortText|match key=renderedText> hidden<%/if>"><% shortText></div>
36                         <%if !shortText|match value=renderedText><%if !raw><a class="expand-post-text" href="viewPost.html?post=<% post.id|html>&amp;raw=true"><%= View.Post.ShowMore|l10n|html></a><%/if><%/if>
37                         <%if !shortText|match value=renderedText><%if !raw><a class="shrink-post-text hidden"><%= View.Post.ShowLess|l10n|html></a><%/if><%/if>
38                         <% parsedText|linked-elements sone=post.sone|store key==linkedElements>
39                         <% foreach linkedElements linkedElement>
40                                 <%if !linkedElement.failed>
41                                         <% first>
42                                                 <div class="linked-elements">
43                                         <%/first>
44                                         <% linkedElement|render-linked-element>
45                                         <% last>
46                                                 </div>
47                                         <%/last>
48                                 <%/if>
49                         <%/foreach>
50                 </div>
51                 <div class="post-status-line status-line<%if !post.loaded> hidden<%/if>">
52                         <div class="bookmarks">
53                                 <form class="unbookmark<%if !post.bookmarked> hidden<%/if>" action="unbookmark.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="post" value="<% post.id|html>" />
57                                         <button type="submit" title="<%= View.Post.Bookmarks.PostIsBookmarked|l10n|html>">★</button>
58                                 </form>
59                                 <form class="bookmark<%if post.bookmarked> hidden<%/if>" action="bookmark.html" method="post">
60                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
61                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
62                                         <input type="hidden" name="post" value="<% post.id|html>" />
63                                         <button type="submit" title="<%= View.Post.Bookmarks.PostIsNotBookmarked|l10n|html>">☆</button>
64                                 </form>
65                         </div>
66                         <span class='separator'>·</span>
67                         <div class="time"><a href="viewPost.html?post=<% post.id|html>"><% post.time|date format=="MMM d, yyyy, HH:mm:ss"></a></div>
68                         <span class='separator'>·</span>
69                         <div class="permalink permalink-post"><a href="post://<%post.id|html>">[<%= View.Post.Permalink|l10n|html>]</a></div>
70                         <span class='separator'>·</span>
71                         <div class="permalink permalink-author"><a href="sone://<%post.sone.id|html>">[<%= View.Post.PermalinkAuthor|l10n|html>]</a></div>
72                         <%if ! originalText|match value=renderedText>
73                                 <span class='separator'>·</span>
74                                 <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>
75                         <%/if>
76                         <div class="likes<%if post.likes.size|match value==0> hidden<%/if>">
77                                 <span class='separator'>·</span>
78                                 <span title="<% post.likes.soneNames|html>">↑<span class="like-count"><% post.likes.size></span></span>
79                         </div>
80                         <%ifnull ! currentSone>
81                                 <span class='separator'>·</span>
82                                 <form class="like like-post<%if post.liked> hidden<%/if>" action="like.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="type" value="post" />
86                                         <input type="hidden" name="post" value="<% post.id|html>" />
87                                         <button type="submit" value="1"><%= View.Post.LikeLink|l10n|html></button>
88                                 </form>
89                                 <form class="unlike unlike-post<%if ! post.liked> hidden<%/if>" action="unlike.html" method="post">
90                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
91                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
92                                         <input type="hidden" name="type" value="post" />
93                                         <input type="hidden" name="post" value="<% post.id|html>" />
94                                         <button type="submit" value="1"><%= View.Post.UnlikeLink|l10n|html></button>
95                                 </form>
96                         <%/if>
97                         <span class='separator'>·</span>
98                         <a class="wot-link" href="/WebOfTrust/ShowIdentity?id=<% post.sone.id|html>"><%= View.Post.WebOfTrustLink|l10n|html></a>
99                         <%if post.sone.local>
100                                 <span class='separator'>·</span>
101                                 <form class="delete delete-post" action="deletePost.html" method="post">
102                                         <input type="hidden" name="formPassword" value="<% formPassword|html>" />
103                                         <input type="hidden" name="returnPage" value="<% request.uri|html>" />
104                                         <input type="hidden" name="post" value="<% post.id|html>" />
105                                         <button type="submit"><%= View.Post.DeleteLink|l10n|html></button>
106                                 </form>
107                         <%/if>
108                 </div>
109                 <div<%if post.loaded> class="hidden"<%/if>>
110                         <%= View.Post.NotDownloaded|l10n|html>
111                 </div>
112                 <div class="replies">
113                         <%foreach post.replies reply>
114                                 <%include include/viewReply.html>
115                         <%/foreach>
116                         <%ifnull ! currentSone>
117                                 <div class="create-reply">
118                                         <form method="post" action="createReply.html">
119                                                 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
120                                                 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
121                                                 <input type="hidden" name="post" value="<% post.id|html>" />
122                                                 <div class="sender">
123                                                         <select name="sender" title="<%= View.UpdateStatus.Text.ChooseSenderIdentity|l10n|html>">
124                                                                 <%foreach localSones localSone|sort>
125                                                                         <option value="<% localSone.id|html>"<%if localSone|match value=post.replySone> selected="selected"<%/if>><% localSone.niceName|html></option>
126                                                                 <%/foreach>
127                                                         </select>
128                                                 </div>
129                                                 <div class="select-sender"><button type="button" title="<%= View.UpdateStatus.Text.ChooseSenderIdentity|l10n|html>">+</button></div>
130                                                 <textarea class="rip-out reply-input" name="text"></textarea>
131                                                 <button type="submit"><%= View.Post.SendReply|l10n|html></button>
132                                         </form>
133                                 </div>
134                         <%/if>
135                 </div>
136         </div>
137 </div>