From 4976669a17eb72bb7451edcf367c0956a40a8c2f Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 27 Jul 2015 06:21:07 +0200 Subject: [PATCH] Extract display of an album into its own template --- src/main/resources/static/css/sone.css | 23 +++++++++++ .../resources/templates/include/browseAlbums.html | 43 +-------------------- .../resources/templates/include/viewAlbum.html | 45 ++++++++++++++++++++++ 3 files changed, 69 insertions(+), 42 deletions(-) create mode 100644 src/main/resources/templates/include/viewAlbum.html diff --git a/src/main/resources/static/css/sone.css b/src/main/resources/static/css/sone.css index 8b588b8..557ea46 100644 --- a/src/main/resources/static/css/sone.css +++ b/src/main/resources/static/css/sone.css @@ -738,6 +738,9 @@ textarea { height: 250px; overflow: hidden; padding: -1px; +} + +#sone .image-container { border: solid 1px #000; } @@ -761,6 +764,26 @@ textarea { width: 95%; } +#sone .album-container .image-container { + position: absolute; +} + +#sone .album-container .link-to-album { + display: none; +} + +#sone .album-container:hover .link-to-album { + display: block; + float: right; + z-index: 1; + padding: 0.5ex; + background-color: #eee; + position: relative; + top: 250px; + right: 0.5ex; + margin-top: -2em; +} + #sone .image .album-sone { font-size: 80%; } diff --git a/src/main/resources/templates/include/browseAlbums.html b/src/main/resources/templates/include/browseAlbums.html index 7c8c490..74bf714 100644 --- a/src/main/resources/templates/include/browseAlbums.html +++ b/src/main/resources/templates/include/browseAlbums.html @@ -1,48 +1,7 @@ <%foreach albums album> <%first>

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

<%/first> <%if loop.count|mod divisor==3>
<%/if> -
- - -
-
<% album.title|html> (<%= View.Sone.Stats.Images|l10n 0=album.images.size>)
-
<% album.description|parse sone=album.sone|render>
-
- <%if album.sone.local> -
- - - - -
- - -
- - -
- <%/if> -
+ <%include include/viewAlbum.html> <%= false|store key==endRow> <%if loop.count|mod divisor==3 offset==1><%= true|store key==endRow><%/if> <%last><%= true|store key==endRow><%/last> diff --git a/src/main/resources/templates/include/viewAlbum.html b/src/main/resources/templates/include/viewAlbum.html new file mode 100644 index 0000000..0821909 --- /dev/null +++ b/src/main/resources/templates/include/viewAlbum.html @@ -0,0 +1,45 @@ +
+ + +
+
<% album.title|html> (<%= View.Sone.Stats.Images|l10n 0=album.images.size>)
+
<% album.description|parse sone=album.sone|render>
+
+ <%if album.sone.local> +
+ + + + +
+ + +
+ + +
+ <%/if> +
-- 2.7.4