Show custom avatar where applicable.
[Sone.git] / src / main / resources / templates / include / viewReply.html
index 2fbca43..3d9c33e 100644 (file)
@@ -1,17 +1,36 @@
-<a name="reply-<% reply.id|html>"></a>
-<div id="<% reply.id|html>" class="reply<%if reply.new> new<%/if>">
+<div id="reply-<% reply.id|html>" class="reply<%if !reply.sone.local><%if reply.new> new<%/if><%/if>">
+       <a name="reply-<% reply.id|html>"></a>
        <div class="reply-time hidden"><% reply.time|html></div>
        <div class="reply-author hidden"><% reply.sone.id|html></div>
-       <div class="avatar">
-               <img src="/WoT/GetIdenticon?identity=<% reply.sone.id|html>&amp;width=36&height=36" width="36" height="36" alt="Avatar Image" />
+       <div class="reply-author-local hidden"><% reply.sone.local></div>
+       <%include include/soneMenu.html class=="sone-reply-menu" sone=reply.sone>
+       <div class="avatar reply-avatar">
+               <%ifnull !reply.sone.avatar>
+                       <% reply.sone.avatar|image-link max-width=36 max-height=36 mode=enlarge title="Avatar Image">
+               <%else>
+                       <img src="/WebOfTrust/GetIdenticon?identity=<% reply.sone.id|html>&amp;width=36&height=36" width="36" height="36" alt="Avatar Image" />
+               <%/if>
        </div>
        <div class="inner-part">
                <div>
                        <div class="author profile-link"><a href="viewSone.html?sone=<% reply.sone.id|html>"><% reply.sone.niceName|html></a></div>
-                       <div class="text"><% reply.text></div>
+                       <% reply.text|html|store key=originalText text=true>
+                       <% reply.text|parse sone=reply.sone|store key=parsedText text=true>
+                       <% reply.text|parse sone=reply.sone length=core.preferences.charactersPerPost cut-off-length=core.preferences.postCutOffLength|store key=shortText text=true>
+                       <div class="reply-text raw-text<%if !raw> hidden<%/if>"><% originalText></div>
+                       <div class="reply-text text<%if raw> hidden<%/if><%if !shortText|match key=parsedText> hidden<%/if>"><% parsedText></div>
+                       <div class="reply-text short-text<%if raw> hidden<%/if><%if shortText|match key=parsedText> hidden<%/if>"><% shortText></div>
+                       <%if !shortText|match key=parsedText><%if !raw><a class="expand-reply-text" href="viewPost.html?post=<% reply.post.id|html>&amp;raw=true"><%= View.Post.ShowMore|l10n|html></a><%/if><%/if>
+                       <%if !shortText|match key=parsedText><%if !raw><a class="shrink-reply-text hidden"><%= View.Post.ShowLess|l10n|html></a><%/if><%/if>
                </div>
                <div class="reply-status-line status-line">
                        <div class="time"><% reply.time|date format="MMM d, yyyy, HH:mm:ss"></div>
+                       <span class='separator'>·</span>
+                       <div class="permalink permalink-author"><a href="sone://<%reply.sone.id|html>">[<%= View.Post.PermalinkAuthor|l10n|html>]</a></div>
+                       <%if ! originalText|match key=parsedText>
+                               <span class='separator'>·</span>
+                               <div class="show-reply-source"><a href="viewPost.html?post=<% post.id|html>&amp;raw=<%if raw>false<%else>true<%/if>"><%= View.Post.ShowSource|l10n|html></a></div>
+                       <%/if>
                        <div class="likes<%if reply.likes.size|match value=0> hidden<%/if>">
                                <span class='separator'>·</span>
                                <span title="<% reply.likes.soneNames|html>">↑<span class="like-count"><% reply.likes.size></span></span>
@@ -40,7 +59,7 @@
                                                <input type="hidden" name="sone" value="<% reply.sone.id|html>" />
                                                <button type="submit" title="<%= View.Trust.Tooltip.Trust|l10n|html>">✓</button>
                                        </form>
-                                       <form class="distrust reply-distrust" action="distrust.html" method="post">
+                                       <form class="distrust reply-distrust<%if reply.sone.trust.assigned> hidden<%/if>" action="distrust.html" method="post">
                                                <input type="hidden" name="formPassword" value="<% formPassword|html>" />
                                                <input type="hidden" name="returnPage" value="<% request.uri|html>" />
                                                <input type="hidden" name="sone" value="<% reply.sone.id|html>" />
@@ -54,7 +73,7 @@
                                        </form>
                                <%/if>
                        <%/if>
-                       <%if reply.sone.current>
+                       <%if reply.sone.local>
                                <span class='separator'>·</span>
                                <form class="delete delete-reply" action="deleteReply.html" method="post">
                                        <input type="hidden" name="formPassword" value="<% formPassword|html>" />