Include images of an album below a post with an album link
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 25 Jul 2015 11:59:50 +0000 (13:59 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 25 Jul 2015 11:59:50 +0000 (13:59 +0200)
src/main/resources/i18n/sone.en.properties
src/main/resources/static/css/sone.css
src/main/resources/templates/include/viewPost.html

index ccc8657..f8f3211 100644 (file)
@@ -370,6 +370,7 @@ View.Post.ShowSource=Toggle Parser
 View.Post.NotDownloaded=This post has not yet been downloaded, or it has been deleted.
 View.Post.ShowMore=show more
 View.Post.ShowLess=show less
+View.Post.LinkedAlbum.SizeAndAuthor={1,number} by {0}
 
 View.UpdateStatus.Text.ChooseSenderIdentity=Choose the sender identity
 
index 1767090..b7ae3b7 100644 (file)
@@ -353,6 +353,49 @@ textarea {
        cursor: pointer;
 }
 
+#sone .post .linked-album {
+       display: table;
+       border-collapse: collapse;
+}
+
+#sone .post .linked-album .album-header {
+       display: table-caption;
+       margin-bottom: 1ex;
+}
+
+#sone .post .linked-album .album-header .album-title {
+       font-size: 150%;
+       font-weight: bold;
+}
+
+#sone .post .linked-image {
+       display: table-row;
+}
+
+#sone .post .linked-image .image-left {
+       display: table-cell;
+       padding-bottom: 1ex;
+}
+
+#sone .post .linked-image .image {
+       width: 160px;
+       height: 90px;
+       overflow: hidden;
+       border: solid 1px black;
+       display: inline-block;
+       padding: 0px;
+}
+
+#sone .post .linked-image .about-image {
+       display: table-cell;
+       padding-left: 1ex;
+}
+
+#sone .post .linked-image .about-image .title {
+       font-weight: bold;
+       margin-bottom: 0.5ex;
+}
+
 #sone .post .status-line {
        margin-top: 0.5ex;
        font-size: 85%;
index f899e36..1b8d1ad 100644 (file)
                        <%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">