+
+ <%if album.sone.local>
+ <script language="javascript">
+
+ $(function() {
+ getTranslation("WebInterface.DefaultText.UploadImage.Title", function(text) {
+ $("#upload-image :input[name='title']").each(function() {
+ registerInputTextareaSwap(this, text, "title", false, true);
+ });
+ });
+ getTranslation("WebInterface.DefaultText.UploadImage.Description", function(text) {
+ $("#upload-image :input[name='description']").each(function() {
+ registerInputTextareaSwap(this, text, "description", true, false);
+ });
+ });
+ $("#upload-image label").hide();
+ getTranslation("WebInterface.DefaultText.CreateAlbum.Name", function(text) {
+ $("#create-album input[name='name']").each(function() {
+ registerInputTextareaSwap(this, text, "name", false, true);
+ });
+ });
+ getTranslation("WebInterface.DefaultText.CreateAlbum.Description", function(text) {
+ $("#create-album input[name='description']").each(function() {
+ registerInputTextareaSwap(this, text, "description", true, true);
+ });
+ });
+ $("#create-album label").hide();
+ getTranslation("WebInterface.DefaultText.EditAlbum.Title", function(text) {
+ $("#edit-album input[name='title']").each(function() {
+ registerInputTextareaSwap(this, text, "title", false, true);
+ });
+ });
+ getTranslation("WebInterface.DefaultText.EditAlbum.Description", function(text) {
+ $("#edit-album :input[name='description']").each(function() {
+ registerInputTextareaSwap(this, text, "description", true, false);
+ });
+ });
+ $("#edit-album label").hide();
+
+ hideAndShowBlock("div.edit-album", ".show-edit-album", ".hide-edit-album");
+ hideAndShowBlock("div.create-album", ".show-create-album", ".hide-create-album");
+ hideAndShowBlock("div.upload-image", ".show-upload-image", ".hide-upload-image");
+ hideAndShowBlock("div.delete-album", ".show-delete-album", ".hide-delete-album");
+
+ prepareAlbums();
+ prepareImages();
+ });
+ </script>
+ <%/if>
+
+ <h1 class="backlink"><%= Page.ImageBrowser.Album.Title|l10n|replace needle='{album}' replacementKey=album.title|html></h1>
+
+ <div class="backlinks">
+ <%foreach album.backlinks backlink backlinks>
+ <div class="backlink">
+ <a href="<% backlink.target|html>"><% backlink.name|html></a>
+ </div>
+ <%if ! backlinks.last>
+ <div class="separator">></div>
+ <%/if>
+ <%/foreach>
+ </div>
+
+ <p id="description"><% album.description|html></p>
+
+ <%if album.sone.local>
+ <div class="show-edit-album hidden toggle-link"><a class="small-link">» <%= Page.ImageBrowser.Album.Edit.Title|l10n|html></a></div>
+ <div class="hide-edit-album hidden toggle-link"><a class="small-link">« <%= Page.ImageBrowser.Album.Edit.Title|l10n|html></a></div>
+ <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>" />
+
+ <%if ! album.images.empty>
+ <div>
+ <label for="album-image"><%= Page.ImageBrowser.Album.Label.AlbumImage|l10n|html></label>
+ <select name="album-image">
+ <option disabled="disabled"><%= Page.ImageBrowser.Album.AlbumImage.Choose|l10n|html></option>
+ <%foreach album.images image>
+ <option value="<% image.id|html>"<%if album.albumImage.id|match key=image.id> selected="selected"<%/if>><% image.title|html></option>
+ <%/foreach>
+ </select>
+ </div>
+ <%/if>
+ <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>
+
+ <%include include/browseAlbums.html albums=album.albums>
+
+ <%if album.sone.local>
+ <div class="show-create-album hidden toggle-link"><a class="small-link">» <%= View.CreateAlbum.Title|l10n|html></a></div>
+ <div class="hide-create-album hidden toggle-link"><a class="small-link">« <%= View.CreateAlbum.Title|l10n|html></a></div>
+ <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 id="image-<% image.id|html>" class="image">
+ <div class="image-id hidden"><% image.id|html></div>
+ <div class="image-container">
+ <a href="imageBrowser.html?image=<%image.id|html>"><% image|image-link max-width=250 max-height=250 mode=enlarge title==image.title></a>
+ </div>
+ <div class="show-data">
+ <div class="image-title"><% image.title|html></div>
+ <div class="image-description"><% image.description|html></div>
+ </div>
+ <%if album.sone.local>
+ <form class="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 class="edit-data hidden">
+ <div>
+ <input type="text" name="title" value="<%image.title|html>" />
+ </div>
+ <div>
+ <textarea name="description"><%image.description|html></textarea>
+ </div>
+ <div>
+ <button <%first>class="hidden" <%/first>type="submit" name="moveLeft" value="true"><%= Page.ImageBrowser.Image.Button.MoveLeft|l10n|html></button>
+ <button type="submit" name="submit"><%= Page.ImageBrowser.Image.Button.Save|l10n|html></button>
+ <button <%last>class="hidden" <%/last>type="submit" name="moveRight" value="true"><%= Page.ImageBrowser.Image.Button.MoveRight|l10n|html></button>
+ </div>
+ </div>
+ </form>
+ <%/if>
+ </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>
+ <div class="show-upload-image hidden toggle-link"><a class="small-link">» <%= View.UploadImage.Title|l10n|html></a></div>
+ <div class="hide-upload-image hidden toggle-link"><a class="small-link">« <%= View.UploadImage.Title|l10n|html></a></div>
+ <div class="upload-image">
+ <%include include/uploadImage.html>
+ </div>
+
+ <%if album.empty>
+ <div class="show-delete-album hidden toggle-link"><a class="small-link">» <%= Page.ImageBrowser.Album.Delete.Title|l10n|html></a></div>
+ <div class="hide-delete-album hidden toggle-link"><a class="small-link">« <%= Page.ImageBrowser.Album.Delete.Title|l10n|html></a></div>
+ <div class="delete-album">
+ <form id="delete-album" action="deleteAlbum.html" method="get">
+ <input type="hidden" name="album" value="<%album.id|html>" />
+ <button type="submit"><%= Page.ImageBrowser.Album.Button.Delete|l10n|html></button>
+ </form>
+ </div>
+ <%/if>
+
+ <%/if>
+
+ <%/if>
+
+ <%elseif imageRequested>
+
+ <h1 class="backlink"><%image.title|html></h1>
+
+ <div class="backlinks">
+ <%foreach image.album.backlinks backlink backlinks>
+ <div class="backlink">
+ <a href="<% backlink.target|html>"><% backlink.name|html></a>
+ </div>
+ <%if ! backlinks.last>
+ <div class="separator">></div>
+ <%/if>
+ <%/foreach>
+ </div>
+
+ <%ifnull image>
+
+ <%else>
+
+ <%if image.sone.local>
+ <script language="javascript">
+ $(function() {
+ getTranslation("WebInterface.DefaultText.EditImage.Title", function(text) {
+ $("#edit-image input[name='title']").each(function() {
+ registerInputTextareaSwap(this, text, "title", false, true);
+ });
+ });
+ getTranslation("WebInterface.DefaultText.EditImage.Description", function(text) {
+ $("#edit-image :input[name='description']").each(function() {
+ registerInputTextareaSwap(this, text, "description", true, false);
+ });
+ });
+ $("#edit-image label").hide();
+
+ hideAndShowBlock(".edit-image", ".show-edit-image", ".hide-edit-image");
+ hideAndShowBlock(".delete-image", ".show-delete-image", ".hide-delete-image");
+ });
+ </script>
+ <%/if>
+
+ <div class="single-image">
+ <%ifnull !image.key>
+ <a href="/<%image.key|html>"><% image|image-link max-width=640 max-height=480></a>
+ <%else>
+ <a href="imageBrowser.html?image=<%image.id|html>"><% image|image-link max-width=640 max-height=480></a>
+ <%/if>
+ </div>
+
+ <p class="parsed"><%image.description|parse sone=image.sone></p>
+
+ <%if image.sone.local>
+
+ <div class="show-edit-image hidden toggle-link"><a class="small-link">» <%= Page.ImageBrowser.Image.Edit.Title|l10n|html></a></div>
+ <div class="hide-edit-image hidden toggle-link"><a class="small-link">« <%= Page.ImageBrowser.Image.Edit.Title|l10n|html></a></div>
+ <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>
+
+ <div class="show-delete-image hidden toggle-link"><a class="small-link">» <%= Page.ImageBrowser.Image.Delete.Title|l10n|html></a></div>
+ <div class="hide-delete-image hidden toggle-link"><a class="small-link">« <%= Page.ImageBrowser.Image.Delete.Title|l10n|html></a></div>
+ <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>
+ </div>
+
+ <%/if>
+
+ <%/if>
+
+ <%elseif soneRequested>
+
+ <%if sone.local>
+ <script language="javascript">
+ $(function() {
+ getTranslation("WebInterface.DefaultText.CreateAlbum.Name", function(text) {
+ $("#create-album input[name='name']").each(function() {
+ registerInputTextareaSwap(this, text, "name", false, true);
+ });
+ });
+ getTranslation("WebInterface.DefaultText.CreateAlbum.Description", function(text) {
+ $("#create-album input[name='description']").each(function() {
+ registerInputTextareaSwap(this, text, "description", true, true);
+ });
+ });
+ $("#create-album label").hide();
+
+ hideAndShowBlock(".create-album", ".show-create-album", ".hide-create-album");
+
+ prepareAlbums();
+ });
+ </script>
+ <%/if>
+
+ <%ifnull sone>
+
+ <p><%= Page.ImageBrowser.Sone.Error.NotFound.Text|l10n|html></p>
+
+ <%else>
+
+ <h1><%= Page.ImageBrowser.Sone.Title|l10n|replace needle='{sone}' replacementKey=sone.niceName|html></h1>
+
+ <%include include/browseAlbums.html albums=sone.albums>
+
+ <%if sone.local>
+ <div class="show-create-album hidden toggle-link"><a class="small-link">» <%= View.CreateAlbum.Title|l10n|html></a></div>
+ <div class="hide-create-album hidden toggle-link"><a class="small-link">« <%= View.CreateAlbum.Title|l10n|html></a></div>
+ <div class="create-album">
+ <%include include/createAlbum.html>
+ </div>
+ <%/if>
+