From 6b7326056a7e63e85faf2aef5d03eeceeb082af7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 21 Sep 2011 22:04:06 +0200 Subject: [PATCH] Hide all forms initially, show on click. --- src/main/resources/static/css/sone.css | 4 + src/main/resources/templates/imageBrowser.html | 137 +++++++++++++++++-------- 2 files changed, 101 insertions(+), 40 deletions(-) diff --git a/src/main/resources/static/css/sone.css b/src/main/resources/static/css/sone.css index 7324899..e345261 100644 --- a/src/main/resources/static/css/sone.css +++ b/src/main/resources/static/css/sone.css @@ -97,6 +97,10 @@ textarea { border: none; } +#sone .small-link { + font-size: 85%; +} + #sone .parsed { white-space: pre-wrap; } diff --git a/src/main/resources/templates/imageBrowser.html b/src/main/resources/templates/imageBrowser.html index e9b3c06..6adb3dd 100644 --- a/src/main/resources/templates/imageBrowser.html +++ b/src/main/resources/templates/imageBrowser.html @@ -50,6 +50,20 @@ }); }); $("#edit-album label").hide(); + + /* hide all those forms. */ + hideBlock = function(blockElement, clickElement) { + $(blockElement).hide(); + $(clickElement).removeClass("hidden").click(function() { + $(blockElement).slideDown(); + $(this).slideUp(); + return false; + }); + }; + + hideBlock(".edit-album", ".show-edit-album"); + hideBlock(".create-album", ".show-create-album"); + hideBlock(".upload-image", ".show-upload-image"); }); <%/if> @@ -70,22 +84,25 @@

<% album.description|html>

<%if album.sone.local> -

<%= Page.ImageBrowser.Album.Edit.Title|l10n|html>

+

+
+

<%= Page.ImageBrowser.Album.Edit.Title|l10n|html>

-
- - + + + -
- - -
-
- - -
- -
+
+ + +
+
+ + +
+ + +
<%/if> <%foreach album.albums album> @@ -109,7 +126,10 @@ <%/foreach> <%if album.sone.local> - <%include include/createAlbum.html> +

+
+ <%include include/createAlbum.html> +
<%/if> <%foreach album.images image> @@ -125,7 +145,10 @@ <%/foreach> <%if album.sone.local> - <%include include/uploadImage.html> +

+
+ <%include include/uploadImage.html> +
<%if album.empty>
@@ -171,6 +194,19 @@ }); }); $("#edit-image label").hide(); + + /* hide all those forms. */ + hideBlock = function(blockElement, clickElement) { + $(blockElement).hide(); + $(clickElement).removeClass("hidden").click(function() { + $(blockElement).slideDown(); + $(this).slideUp(); + return false; + }); + }; + + hideBlock(".edit-image", ".show-edit-image"); + hideBlock(".delete-image", ".show-delete-image"); }); <%/if> @@ -187,31 +223,37 @@ <%if image.sone.local> -

<%= Page.ImageBrowser.Image.Edit.Title|l10n|html>

- - - - - -
- - -
-
- - -
-
- -
-
+

+
+

<%= Page.ImageBrowser.Image.Edit.Title|l10n|html>

+ +
+ + + +
+ + +
+
+ + +
+
+ +
+
+
-

<%= Page.ImageBrowser.Image.Delete.Title|l10n|html>

+

+
+

<%= Page.ImageBrowser.Image.Delete.Title|l10n|html>

-
- - -
+
+ + +
+
<%/if> @@ -233,6 +275,18 @@ }); }); $("#create-album label").hide(); + + /* hide all those forms. */ + hideBlock = function(blockElement, clickElement) { + $(blockElement).hide(); + $(clickElement).removeClass("hidden").click(function() { + $(blockElement).slideDown(); + $(this).slideUp(); + return false; + }); + }; + + hideBlock(".create-album", ".show-create-album"); }); <%/if> @@ -265,7 +319,10 @@ <%/foreach> <%if sone.local> - <%include include/createAlbum.html> +

+
+ <%include include/createAlbum.html> +
<%/if> <%/if> -- 2.7.4