Show albums and images in columns of three.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 21 Sep 2011 18:50:00 +0000 (20:50 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 21 Sep 2011 18:50:00 +0000 (20:50 +0200)
src/main/resources/static/css/sone.css
src/main/resources/templates/imageBrowser.html

index 058029c..7324899 100644 (file)
@@ -643,6 +643,10 @@ textarea {
 #sone .album {
 }
 
+#sone .image-row {
+       display: table-row;
+}
+
 #sone .image {
        width: 200px;
        height: 150px;
index 8c7c429..a8f1e98 100644 (file)
@@ -71,6 +71,7 @@
 
                        <%foreach album.albums album>
                                <%first><h2><%= Page.ImageBrowser.Header.Albums|l10n|html></h2><%/first>
+                               <%if loop.count|mod divisor=3><div class="image-row"><%/if>
                                <div class="album image">
                                        <a href="imageBrowser.html?album=<% album.id|html>" title="<% album.title|html>">
                                                <%ifnull album.albumImage>
                                                <% album.title|html>
                                        </a>
                                </div>
+                               <%= false|store key=endRow>
+                               <%if loop.count|mod divisor=3 offset=1><%= true|store key=endRow><%/if>
+                               <%last><%= true|store key=endRow><%/last>
+                               <%if endRow></div><%/if>
                        <%/foreach>
 
                        <%foreach album.images image>
                                <%first><h2><%= Page.ImageBrowser.Header.Images|l10n|html></h2><%/first>
+                               <%if loop.count|mod divisor=3><div class="image-row"><%/if>
                                <div class="image">
                                        <a href="imageBrowser.html?image=<%image.id|html>"><% image|image-link max-width=200 max-height=150></a>
                                </div>
+                               <%= false|store key=endRow>
+                               <%if loop.count|mod divisor=3 offset=1><%= true|store key=endRow><%/if>
+                               <%last><%= true|store key=endRow><%/last>
+                               <%if endRow></div><%/if>
                        <%/foreach>
 
-
                        <%if album.sone.local>
                                <%include include/uploadImage.html>
                                <%include include/createAlbum.html>
                        <h1><%= Page.ImageBrowser.Sone.Title|l10n|replace needle='{sone}' replacementKey=sone.niceName|html></h1>
 
                        <%foreach sone.albums album>
+                               <%if loop.count|mod divisor=3><div class="image-row"><%/if>
                                <div class="album image">
                                        <a href="imageBrowser.html?album=<% album.id|html>" title="<% album.title|html>">
                                                <%ifnull album.albumImage>
                                                <% album.title|html>
                                        </a>
                                </div>
+                               <%= false|store key=endRow>
+                               <%if loop.count|mod divisor=3 offset=1><%= true|store key=endRow><%/if>
+                               <%last><%= true|store key=endRow><%/last>
+                               <%if endRow></div><%/if>
                        <%/foreach>
 
                        <%if sone.local>