Include images of an album below a post with an album link
[Sone.git] / src / main / resources / templates / include / viewPost.html
index 7120d06..1b8d1ad 100644 (file)
@@ -7,9 +7,9 @@
        <div class="avatar post-avatar" >
                <%if post.loaded>
                        <%ifnull !post.sone.profile.avatar>
-                               <%post.sone.profile.avatar|image-link max-width==48 max-height==48 mode==enlarge title=="Avatar Image">
+                               <%post.sone.profile.avatar|build-id sone=post.sone|image-link max-width==48 max-height==48 mode==enlarge title=="Avatar Image">
                        <%else>
-                               <img src="/WebOfTrust/GetIdenticon?identity=<% post.sone.id|html>&amp;width=48&amp;height=48" width="48" height="48" alt="Avatar Image" />
+                               <img src="/WebOfTrust/GetIdenticon?identity=<% post.sone.id|html>&amp;width=96&amp;height=96" width="48" height="48" alt="Avatar Image" />
                        <%/if>
                <%else>
                        <img src="images/sone-avatar.png" width="48" height="48" alt="Avatar Image" />
        <div class="inner-part">
                <div<%if !post.loaded> class="hidden"<%/if>>
                        <div class="author profile-link"><a href="viewSone.html?sone=<% post.sone.id|html>"><% post.sone.niceName|html></a></div>
-                       <%ifnull !post.recipient>
+                       <%if post.recipientId.present>
                                <span class="recipient-to">→</span>
-                               <%ifnull post.recipient.identity>
-                                       <div class="recipient profile-link"><a href="viewSone.html?sone=<% post.recipient.id|html>"><%= View.Post.UnknownAuthor|l10n|html></a></div>
+                               <%if !post.recipient.present>
+                                       <div class="recipient profile-link"><a href="viewSone.html?sone=<% post.recipientId.get|html>"><%= View.Post.UnknownAuthor|l10n|html></a></div>
                                <%else>
-                                       <div class="recipient profile-link"><a href="viewSone.html?sone=<% post.recipient.id|html>"><% post.recipient.niceName|html></a></div>
+                                       <div class="recipient profile-link"><a href="viewSone.html?sone=<% post.recipientId.get|html>"><% post.recipient.get.niceName|html></a></div>
                                <%/if>
                        <%/if>
                        <% post.text|html|store key==originalText text==true>
-                       <% post.text|parse sone=post.sone|store key==parsedText text==true>
-                       <% post.text|parse sone=post.sone length=core.preferences.charactersPerPost cut-off-length=core.preferences.postCutOffLength|store key==shortText text==true>
+                       <% post.text|parse sone=post.sone|store key==parts>
+                       <% parts|render|store key==parsedText text==true>
+                       <% parts|render length=core.preferences.charactersPerPost cut-off-length=core.preferences.postCutOffLength|store key==shortText text==true>
                        <div class="post-text raw-text<%if !raw> hidden<%/if>"><% originalText></div>
                        <div class="post-text text<%if raw> hidden<%/if><%if !shortText|match key=parsedText> hidden<%/if>"><% parsedText></div>
                        <div class="post-text short-text<%if raw> hidden<%/if><%if shortText|match key=parsedText> hidden<%/if>"><% shortText></div>
                        <%if !shortText|match value=parsedText><%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>
                        <%if !shortText|match value=parsedText><%if !raw><a class="shrink-post-text hidden"><%= View.Post.ShowLess|l10n|html></a><%/if><%/if>
                </div>
+               <%foreach parts part>
+                       <%if part.class.simpleName|match value==AlbumPart>
+                               <div class="linked-album">
+                                       <div class="album-header">
+                                               <div class="album-title"><% part.album.title|html></div>
+                                               <div class="album-author"><%= View.Post.LinkedAlbum.SizeAndAuthor|l10n 0=part.album.sone.niceName 1=part.album.images.size|html></div>
+                                       </div>
+                                       <%foreach part.album.images image>
+                                               <div class="linked-image">
+                                                       <div class="image-left">
+                                                               <div class="image">
+                                                                       <a href="imageBrowser.html?image=<%image.id|html>"><% image|image-link max-width==160 max-height==90 mode==enlarge title=image.title></a>
+                                                               </div>
+                                                       </div>
+                                                       <div class="about-image">
+                                                               <div class="title"><% image.title|html></div>
+                                                               <div class="description"><% image.description|parse sone=post.sone|render></div>
+                                                       </div>
+                                               </div>
+                                       <%/foreach>
+                               </div>
+                       <%/if>
+               <%/foreach>
                <div class="post-status-line status-line<%if !post.loaded> hidden<%/if>">
                        <div class="bookmarks">
                                <form class="unbookmark<%if !post.bookmarked> hidden<%/if>" action="unbookmark.html" method="post">