Show moving buttons for images, too
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 1 Aug 2015 20:52:03 +0000 (22:52 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 1 Aug 2015 20:52:17 +0000 (22:52 +0200)
src/main/resources/templates/imageBrowser.html
src/main/resources/templates/include/viewImage.html

index c49cead..c705a2c 100644 (file)
@@ -61,7 +61,7 @@
                 * Prepare all images for inline editing.
                 */
                function prepareImages() {
-                       $(".image").each(function() {
+                       $(".image-in-album").each(function() {
                                imageId = $(this).closest(".image-in-album").find(".image-id").text();
                                (function(element, imageId) {
                                        $("button[name='moveLeft'], button[name='moveRight']", element).click(function() {
                                                });
                                                $("#edit-album label").hide();
 
-                                               /* hide non-js image move buttons. */
-                                               $(".move-buttons").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");
                                                <div id="image-<% image.id|html>" class="image-in-album">
                                                        <div class="image-id hidden"><% image.id|html></div>
                                                        <%include include/viewImage.html>
-                                                       <%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="move-buttons">
-                                                                       <button <%if loop.first>class="hidden" <%/if>type="submit" name="moveLeft" value="true"><%= Page.ImageBrowser.Image.Button.MoveLeft|l10n|html></button>
-                                                                       <button <%if loop.last>class="hidden" <%/if>type="submit" name="moveRight" value="true"><%= Page.ImageBrowser.Image.Button.MoveRight|l10n|html></button>
-                                                               </div>
-
-                                                               <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 <%if loop.first>class="hidden" <%/if>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 <%if loop.last>class="hidden" <%/if>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.odd><%= true|store key==endRow><%/if>
index cdf5da1..83a83d9 100644 (file)
@@ -7,6 +7,17 @@
        <div class="information">
                <div class="link"><a href="image://<% image.id|html>">[<%= View.Image.Permalink|l10n|html>]</a></div>
                <div class="title"><a href="imageBrowser.html?image=<% image.id|html>"><% image.title|html></a></div>
+               <%if image.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="move-buttons">
+                                       <button <%if loop.first>class="hidden" <%/if>type="submit" name="moveLeft" value="true"><%= Page.ImageBrowser.Image.Button.MoveLeft|l10n|html></button>
+                                       <button <%if loop.last>class="hidden" <%/if>type="submit" name="moveRight" value="true"><%= Page.ImageBrowser.Image.Button.MoveRight|l10n|html></button>
+                               </div>
+                       </form>
+               <%/if>
                <div class="description"><% image.description|parse sone=image.sone|render></div>
        </div>
 </div>