Hide labels after ajaxfication of album creation form fields.
[Sone.git] / src / main / resources / templates / imageBrowser.html
index d48cfa1..c2257bd 100644 (file)
@@ -1,8 +1,25 @@
 <%include include/head.html>
 
-       <div class="page-id hidden">image-browser</div>
+       <script language="javascript">
+
+               /* ajaxify album creation input field. */
+               $(document).ready(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();
+               });
+
+       </script>
 
-       <h1><%= Page.ImageBrowser.Page.Title|l10n|html></h1>
+       <div class="page-id hidden">image-browser</div>
 
        <%if albumRequested>
 
@@ -16,7 +33,7 @@
 
                <%else>
 
-                       <h2><%= Page.ImageBrowser.Album.Title|l10n|replace needle='{album}' replacementKey=album.name|html></h2>
+                       <h1><%= Page.ImageBrowser.Album.Title|l10n|replace needle='{album}' replacementKey=album.name|html></h1>
 
                        <div class="backlinks">
                                <%foreach album.backlinks backlink backlinks>
 
                        <%foreach album.albums album>
                                <div class="album">
-                                       <div class="name"><a href="imageBrowser.html?album=<% album.id|html>"><% album.name|html></a></div>
+                                       <div class="image">
+                                               <a href="imageBrowser.html?album=<% album.id|html>">
+                                                       <%ifnull album.image>
+                                                               <img src="images/unknown-image-0.png" width="200" height="150" alt="<% album.name|html>" title="<% album.name|html>" />
+                                                       <%else><!-- TODO -->
+                                                               <img src="images/unknown-image-0.png" width="200" height="150" alt="<% album.name|html>" title="<% album.name|html>" />
+                                                       <%/if>
+                                               </a>
+                                       </div>
                                </div>
                        <%/foreach>
 
 
                <%else>
 
+                       <h1><%= Page.ImageBrowser.Sone.Title|l10n|replace needle='{sone}' replacementKey=sone.niceName|html></h1>
+
                        <%foreach sone.albums album>
                                <div class="album">
-                                       <div class="name"><a href="imageBrowser.html?album=<% album.id|html>"><% album.name|html></a></div>
+                                       <div class="image">
+                                               <a href="imageBrowser.html?album=<% album.id|html>">
+                                                       <%ifnull album.image>
+                                                               <img src="images/unknown-image-0.png" width="200" height="150" alt="<% album.name|html>" title="<% album.name|html>" />
+                                                       <%else><!-- TODO -->
+                                                               <img src="images/unknown-image-0.png" width="200" height="150" alt="<% album.name|html>" title="<% album.name|html>" />
+                                                       <%/if>
+                                               </a>
+                                       </div>
                                </div>
                        <%/foreach>