Rework pretty much all image displaying code
[Sone.git] / src / main / resources / templates / imageBrowser.html
index a237c7f..3a720b6 100644 (file)
                                <%first>
                                        <h2><%= Page.ImageBrowser.Header.Images|l10n|html></h2>
                                        <%include include/pagination.html pageParameter=="page">
+                                       <div class="images">
                                <%/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|parse sone=image.sone|render></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="move-buttons">
-                                                                       <button <%first>class="hidden" <%/first>type="submit" name="moveLeft" value="true"><%= Page.ImageBrowser.Image.Button.MoveLeft|l10n|html></button>
-                                                                       <button <%last>class="hidden" <%/last>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>
+                                       <%if loop.even><div class="image-row"><%/if>
+                                               <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>
-                                                                       <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 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>
-                                                       </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>
+                                                       </form>
+                                                       <%/if>
+                                               </div>
+                                               <%= false|store key==endRow>
+                                               <%if loop.odd><%= true|store key==endRow><%/if>
+                                               <%last><%= true|store key==endRow><%/last>
+                                               <%if endRow>
                                        </div>
                                <%/if>
-                <%last><%include include/pagination.html pageParameter=="page"><%/last>
+                <%last></div><%include include/pagination.html pageParameter=="page"><%/last>
                        <%/foreach>
 
                        <%if album.sone.local>
                        <%first>
                                <h2><%= Page.ImageBrowser.Header.Albums|l10n|html></h2>
                                <%include include/pagination.html pagination=albumPagination pageParameter=="page">
+                               <div class="images">
                        <%/first>
-                       <%if loop.count|mod divisor==3><div class="album-row"><%/if>
+                       <%if loop.even><div class="album-row"><%/if>
                        <div id="album-<% album.id|html>" class="album">
                                <div class="album-id hidden"><% album.id|html></div>
-                               <div class="album-container">
-                                       <a href="imageBrowser.html?album=<% album.id|html>" title="<% album.title|html>">
-                                               <%ifnull album.albumImage>
-                                                       <img src="images/unknown-image-0.png" width="333" height="250" alt="<% album.title|html> (<%album.sone.niceName|html>)" title="<% album.title|html> (<%album.sone.niceName|html>)" style="position: relative; top: 0px; left: -41px;" />
-                                               <%else><!-- TODO -->
-                                                       <% album.albumImage|image-link max-width==250 max-height==250 mode==enlarge title=album.title>
-                                               <%/if>
-                                       </a>
-                               </div>
-                               <div class="show-data">
-                                       <div class="album-sone"><a href="imageBrowser.html?sone=<%album.sone.id|html>"><%album.sone.niceName|html></a></div>
-                                       <div class="album-title"><% album.title|html> (<%= View.Sone.Stats.Images|l10n 0=album.images.size>)</div>
-                                       <div class="album-description"><% album.description|parse sone=album.sone|render></div>
-                               </div>
+                               <%include include/viewAlbum.html>
                        </div>
                        <%= false|store key==endRow>
-                       <%if loop.count|mod divisor==3 offset==1><%= true|store key==endRow><%/if>
+                       <%if loop.odd><%= true|store key==endRow><%/if>
                        <%last><%= true|store key==endRow><%/last>
-                       <%if endRow>
-                               </div>
-                       <%/if>
+                       <%if endRow></div><%/if>
                        <%last>
+                               </div>
                                <%include include/pagination.html pagination=albumPagination pageParameter=="page">
                        <%/last>
                <%/foreach>