Move ajaxification of album creation form fields to imageBrowser.html.
[Sone.git] / src / main / resources / templates / imageBrowser.html
1 <%include include/head.html>
2
3         <script language="javascript">
4
5                 /* ajaxify album creation input field. */
6                 $(document).ready(function() {
7                         getTranslation("WebInterface.DefaultText.CreateAlbum.Name", function(text) {
8                                 $("#create-album input[name='name']").each(function() {
9                                         registerInputTextareaSwap(this, text, "name", false, true);
10                                 });
11                         });
12                         getTranslation("WebInterface.DefaultText.CreateAlbum.Description", function(text) {
13                                 $("#create-album input[name='description']").each(function() {
14                                         registerInputTextareaSwap(this, text, "description", true, true);
15                                 });
16                         });
17                 });
18
19         </script>
20
21         <div class="page-id hidden">image-browser</div>
22
23         <%if albumRequested>
24
25                 <%ifnull album>
26
27                         <p><%= Page.ImageBrowser.Album.Error.NotFound.Text|l10n|html></p>
28
29                 <%elseifnull album.name>
30
31                         <p><%= Page.ImageBrowser.Album.Error.NotFound.Text|l10n|html></p>
32
33                 <%else>
34
35                         <h1><%= Page.ImageBrowser.Album.Title|l10n|replace needle='{album}' replacementKey=album.name|html></h1>
36
37                         <div class="backlinks">
38                                 <%foreach album.backlinks backlink backlinks>
39                                         <div class="backlink">
40                                                 <a href="<% backlink.target|html>"><% backlink.name|html></a>
41                                         </div>
42                                         <%if ! backlinks.last>
43                                                 <div class="separator">&gt;</div>
44                                         <%/if>
45                                 <%/foreach>
46                         </div>
47
48                         <%foreach album.albums album>
49                                 <div class="album">
50                                         <div class="image">
51                                                 <a href="imageBrowser.html?album=<% album.id|html>">
52                                                         <%ifnull album.image>
53                                                                 <img src="images/unknown-image-0.png" width="200" height="150" alt="<% album.name|html>" title="<% album.name|html>" />
54                                                         <%else><!-- TODO -->
55                                                                 <img src="images/unknown-image-0.png" width="200" height="150" alt="<% album.name|html>" title="<% album.name|html>" />
56                                                         <%/if>
57                                                 </a>
58                                         </div>
59                                 </div>
60                         <%/foreach>
61
62                         <div id="description">
63                                 <% album.description|html>
64                         </div>
65
66                         <%if album.sone.current>
67                                 <%include include/createAlbum.html>
68                         <%/if>
69
70                 <%/if>
71
72         <%elseif imageRequested>
73
74         <%elseif soneRequested>
75
76                 <%ifnull sone>
77
78                         <p><%= Page.ImageBrowser.Sone.Error.NotFound.Text|l10n|html></p>
79
80                 <%else>
81
82                         <h1><%= Page.ImageBrowser.Sone.Title|l10n|replace needle='{sone}' replacementKey=sone.niceName|html></h1>
83
84                         <%foreach sone.albums album>
85                                 <div class="album">
86                                         <div class="image">
87                                                 <a href="imageBrowser.html?album=<% album.id|html>">
88                                                         <%ifnull album.image>
89                                                                 <img src="images/unknown-image-0.png" width="200" height="150" alt="<% album.name|html>" title="<% album.name|html>" />
90                                                         <%else><!-- TODO -->
91                                                                 <img src="images/unknown-image-0.png" width="200" height="150" alt="<% album.name|html>" title="<% album.name|html>" />
92                                                         <%/if>
93                                                 </a>
94                                         </div>
95                                 </div>
96                         <%/foreach>
97
98                         <%if sone.current>
99                                 <%include include/createAlbum.html>
100                         <%/if>
101
102                 <%/if>
103
104         <%/if>
105
106 <%include include/tail.html>