});
});
$("#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");
});
</script>
<%/if>
- <h1><%= Page.ImageBrowser.Album.Title|l10n|replace needle='{album}' replacementKey=album.title|html></h1>
+ <h1 class="backlink"><%= Page.ImageBrowser.Album.Title|l10n|replace needle='{album}' replacementKey=album.title|html></h1>
<div class="backlinks">
<%foreach album.backlinks backlink backlinks>
<%/foreach>
</div>
+ <p id="description"><% album.description|html></p>
+
+ <%if album.sone.local>
+ <p><a class="show-edit-album hidden small-link">» <%= Page.ImageBrowser.Album.Edit.Title|l10n|html></a></p>
+ <div class="edit-album">
+ <h2><%= Page.ImageBrowser.Album.Edit.Title|l10n|html></h2>
+
+ <form id="edit-album" action="editAlbum.html" method="post">
+ <input type="hidden" name="formPassword" value="<%formPassword|html>" />
+ <input type="hidden" name="album" value="<%album.id|html>" />
+
+ <div>
+ <label for="title"><%= Page.ImageBrowser.Album.Label.Title|l10n|html></label>
+ <input type="text" name="title" value="<%album.title|html>" />
+ </div>
+ <div>
+ <label for="description"><%= Page.ImageBrowser.Album.Label.Description|l10n|html></label>
+ <textarea name="description"><%album.description|html></textarea>
+ </div>
+ <button type="submit"><%= Page.ImageBrowser.Album.Button.Save|l10n|html></button>
+ </form>
+ </div>
+ <%/if>
+
<%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>">
- <%ifnull album.image>
+ <a href="imageBrowser.html?album=<% album.id|html>" title="<% album.title|html>">
+ <%ifnull album.albumImage>
<img src="images/unknown-image-0.png" width="200" height="150" alt="<% album.title|html>" title="<% album.title|html>" />
<%else><!-- TODO -->
- <img src="images/unknown-image-0.png" width="200" height="150" alt="<% album.title|html>" title="<% album.title|html>" />
+ <% album.albumImage|image-link max-width=200 max-height=150 title==album.title>
<%/if>
+ <br/>
+ <% 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 album.sone.local>
+ <p><a class="show-create-album hidden small-link">» <%= View.CreateAlbum.Title|l10n|html></a></p>
+ <div class="create-album">
+ <%include include/createAlbum.html>
+ </div>
+ <%/if>
+
<%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>
- <div id="description">
- <% album.description|html>
- </div>
-
<%if album.sone.local>
- <%include include/uploadImage.html>
- <%include include/createAlbum.html>
-
- <h2><%= Page.ImageBrowser.Album.Edit.Title|l10n|html></h2>
-
- <form id="edit-album" action="editAlbum.html" method="post">
- <input type="hidden" name="formPassword" value="<%formPassword|html>" />
- <input type="hidden" name="album" value="<%album.id|html>" />
-
- <div>
- <label for="title"><%= Page.ImageBrowser.Album.Label.Title|l10n|html></label>
- <input type="text" name="title" value="<%album.title|html>" />
- </div>
- <div>
- <label for="description"><%= Page.ImageBrowser.Album.Label.Description|l10n|html></label>
- <textarea name="description"><%album.description|html></textarea>
- </div>
- <button type="submit"><%= Page.ImageBrowser.Album.Button.Save|l10n|html></button>
- </form>
+ <p><a class="show-upload-image hidden small-link">» <%= View.UploadImage.Title|l10n|html></a></p>
+ <div class="upload-image">
+ <%include include/uploadImage.html>
+ </div>
<%if album.empty>
<form id="delete-album" action="deleteAlbum.html" method="get">
<%elseif imageRequested>
- <h1><%image.title|html></h1>
+ <h1 class="backlink"><%image.title|html></h1>
<div class="backlinks">
<%foreach image.album.backlinks backlink backlinks>
});
});
$("#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");
});
</script>
<%/if>
<%if image.sone.local>
- <h2><%= Page.ImageBrowser.Image.Edit.Title|l10n|html></h2>
-
- <form id="edit-image" action="editImage.html" method="post">
- <input type="hidden" name="formPassword" value="<%formPassword|html>" />
- <input type="hidden" name="image" value="<%image.id|html>" />
-
- <div>
- <label for="title"><%= Page.ImageBrowser.Image.Title.Label|l10n|html></label>
- <input type="text" name="title" value="<%image.title|html>" />
- </div>
- <div>
- <label for="description"><%= Page.ImageBrowser.Image.Description.Label|l10n|html></label>
- <textarea name="description"><%image.description|html></textarea>
- </div>
- <div>
- <button type="submit"><%= Page.ImageBrowser.Image.Button.Save|l10n|html></button>
- </div>
- </form>
+ <p><a class="show-edit-image hidden small-link">» <%= Page.ImageBrowser.Image.Edit.Title|l10n|html></a></p>
+ <div class="edit-image">
+ <h2><%= Page.ImageBrowser.Image.Edit.Title|l10n|html></h2>
+
+ <form id="edit-image" action="editImage.html" method="post">
+ <input type="hidden" name="formPassword" value="<%formPassword|html>" />
+ <input type="hidden" name="returnPage" value="<%request.uri|html>" />
+ <input type="hidden" name="image" value="<%image.id|html>" />
+
+ <div>
+ <label for="title"><%= Page.ImageBrowser.Image.Title.Label|l10n|html></label>
+ <input type="text" name="title" value="<%image.title|html>" />
+ </div>
+ <div>
+ <label for="description"><%= Page.ImageBrowser.Image.Description.Label|l10n|html></label>
+ <textarea name="description"><%image.description|html></textarea>
+ </div>
+ <div>
+ <button type="submit"><%= Page.ImageBrowser.Image.Button.Save|l10n|html></button>
+ </div>
+ </form>
+ </div>
- <h2><%= Page.ImageBrowser.Image.Delete.Title|l10n|html></h2>
+ <p><a class="show-delete-image hidden small-link">» <%= Page.ImageBrowser.Image.Delete.Title|l10n|html></a></p>
+ <div class="delete-image">
+ <h2><%= Page.ImageBrowser.Image.Delete.Title|l10n|html></h2>
- <form id="delete-image" action="deleteImage.html" method="get">
- <input type="hidden" name="image" value="<%image.id|html>" />
- <button type="submit"><%= Page.ImageBrowser.Image.Button.Delete|l10n|html></button>
- </form>
+ <form id="delete-image" action="deleteImage.html" method="get">
+ <input type="hidden" name="image" value="<%image.id|html>" />
+ <button type="submit"><%= Page.ImageBrowser.Image.Button.Delete|l10n|html></button>
+ </form>
+ </div>
<%/if>
});
});
$("#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");
});
</script>
<%/if>
<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>">
- <%ifnull album.image>
+ <a href="imageBrowser.html?album=<% album.id|html>" title="<% album.title|html>">
+ <%ifnull album.albumImage>
<img src="images/unknown-image-0.png" width="200" height="150" alt="<% album.title|html>" title="<% album.title|html>" />
<%else><!-- TODO -->
- <img src="images/unknown-image-0.png" width="200" height="150" alt="<% album.title|html>" title="<% album.title|html>" />
+ <% album.albumImage|image-link max-width=200 max-height=150 title==album.title>
<%/if>
+ <br/>
+ <% 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>
- <%include include/createAlbum.html>
+ <p><a class="show-create-album hidden small-link">» <%= View.CreateAlbum.Title|l10n|html></a></p>
+ <div class="create-album">
+ <%include include/createAlbum.html>
+ </div>
<%/if>
<%/if>