From: David ‘Bombe’ Roden Date: Wed, 21 Sep 2011 18:50:00 +0000 (+0200) Subject: Show albums and images in columns of three. X-Git-Tag: 0.7^2~2^2~46 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=bd451c9e9aa4618a255f0216222b7c22745c9f7f Show albums and images in columns of three. --- diff --git a/src/main/resources/static/css/sone.css b/src/main/resources/static/css/sone.css index 058029c..7324899 100644 --- a/src/main/resources/static/css/sone.css +++ b/src/main/resources/static/css/sone.css @@ -643,6 +643,10 @@ textarea { #sone .album { } +#sone .image-row { + display: table-row; +} + #sone .image { width: 200px; height: 150px; diff --git a/src/main/resources/templates/imageBrowser.html b/src/main/resources/templates/imageBrowser.html index 8c7c429..a8f1e98 100644 --- a/src/main/resources/templates/imageBrowser.html +++ b/src/main/resources/templates/imageBrowser.html @@ -71,6 +71,7 @@ <%foreach album.albums album> <%first>

<%= Page.ImageBrowser.Header.Albums|l10n|html>

<%/first> + <%if loop.count|mod divisor=3>
<%/if> + <%= 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>
<%/if> <%/foreach> <%foreach album.images image> <%first>

<%= Page.ImageBrowser.Header.Images|l10n|html>

<%/first> + <%if loop.count|mod divisor=3>
<%/if> + <%= 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>
<%/if> <%/foreach> - <%if album.sone.local> <%include include/uploadImage.html> <%include include/createAlbum.html> @@ -232,6 +241,7 @@

<%= Page.ImageBrowser.Sone.Title|l10n|replace needle='{sone}' replacementKey=sone.niceName|html>

<%foreach sone.albums album> + <%if loop.count|mod divisor=3>
<%/if> + <%= 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>
<%/if> <%/foreach> <%if sone.local>