1 <%include include/head.html>
3 <div class="page-id hidden">image-browser</div>
5 <script language="javascript">
8 /* hide all those forms. */
9 hideAndShowBlock = function(blockElement, clickToShowElement, clickToHideElement) {
10 $(blockElement).hide();
11 $(clickToShowElement).removeClass("hidden");
12 $(clickToShowElement).click(function() {
13 $(blockElement).slideDown();
14 $(clickToShowElement).addClass("hidden");
15 $(clickToHideElement).removeClass("hidden");
17 $(clickToHideElement).click(function() {
18 $(blockElement).slideUp();
19 $(clickToHideElement).addClass("hidden");
20 $(clickToShowElement).removeClass("hidden");
31 <p><%= Page.ImageBrowser.Album.Error.NotFound.Text|l10n|html></p>
33 <%elseifnull album.title>
35 <p><%= Page.ImageBrowser.Album.Error.NotFound.Text|l10n|html></p>
39 <%if album.sone.local>
40 <script language="javascript">
42 /* ID of the image currently being edited. */
43 var editingImageId = null;
46 * Shows the form for editing an image.
48 * @param imageId The ID of the image to edit.
50 function editImage(imageId) {
51 if (editingImageId != imageId) {
56 $(".show-data", "#image-" + imageId).hide();
57 $(".edit-data", "#image-" + imageId).show();
58 $(document).bind("click.sone", function(event) {
59 if ($(event.target).closest("#image-" + imageId).size() == 0) {
66 * Cancels all image editing.
68 function cancelEditing() {
69 $(".show-data").show();
70 $(".edit-data").hide();
71 $("form.edit-image").each(function() {
74 $(document).unbind("click.sone");
75 editingImageId = null;
79 getTranslation("WebInterface.DefaultText.UploadImage.Title", function(text) {
80 $("#upload-image :input[name='title']").each(function() {
81 registerInputTextareaSwap(this, text, "title", false, true);
84 getTranslation("WebInterface.DefaultText.UploadImage.Description", function(text) {
85 $("#upload-image :input[name='description']").each(function() {
86 registerInputTextareaSwap(this, text, "description", true, false);
89 $("#upload-image label").hide();
90 getTranslation("WebInterface.DefaultText.CreateAlbum.Name", function(text) {
91 $("#create-album input[name='name']").each(function() {
92 registerInputTextareaSwap(this, text, "name", false, true);
95 getTranslation("WebInterface.DefaultText.CreateAlbum.Description", function(text) {
96 $("#create-album input[name='description']").each(function() {
97 registerInputTextareaSwap(this, text, "description", true, true);
100 $("#create-album label").hide();
101 getTranslation("WebInterface.DefaultText.EditAlbum.Title", function(text) {
102 $("#edit-album input[name='title']").each(function() {
103 registerInputTextareaSwap(this, text, "title", false, true);
106 getTranslation("WebInterface.DefaultText.EditAlbum.Description", function(text) {
107 $("#edit-album :input[name='description']").each(function() {
108 registerInputTextareaSwap(this, text, "description", true, false);
111 $("#edit-album label").hide();
113 hideAndShowBlock(".edit-album", ".show-edit-album", ".hide-edit-album");
114 hideAndShowBlock(".create-album", ".show-create-album", ".hide-create-album");
115 hideAndShowBlock(".upload-image", ".show-upload-image", ".hide-upload-image");
116 hideAndShowBlock(".delete-album", ".show-delete-album", ".hide-delete-album");
118 $(".image").each(function() {
119 imageId = $(this).closest(".image").find(".image-id").text();
120 (function(element, imageId) {
121 $(".show-data", element).click(function() {
131 <h1 class="backlink"><%= Page.ImageBrowser.Album.Title|l10n|replace needle='{album}' replacementKey=album.title|html></h1>
133 <div class="backlinks">
134 <%foreach album.backlinks backlink backlinks>
135 <div class="backlink">
136 <a href="<% backlink.target|html>"><% backlink.name|html></a>
138 <%if ! backlinks.last>
139 <div class="separator">></div>
144 <p id="description"><% album.description|html></p>
146 <%if album.sone.local>
147 <div class="show-edit-album hidden toggle-link"><a class="small-link">» <%= Page.ImageBrowser.Album.Edit.Title|l10n|html></a></div>
148 <div class="hide-edit-album hidden toggle-link"><a class="small-link">« <%= Page.ImageBrowser.Album.Edit.Title|l10n|html></a></div>
149 <div class="edit-album">
150 <h2><%= Page.ImageBrowser.Album.Edit.Title|l10n|html></h2>
152 <form id="edit-album" action="editAlbum.html" method="post">
153 <input type="hidden" name="formPassword" value="<%formPassword|html>" />
154 <input type="hidden" name="album" value="<%album.id|html>" />
156 <%if ! album.images.empty>
158 <label for="album-image"><%= Page.ImageBrowser.Album.Label.AlbumImage|l10n|html></label>
159 <select name="album-image">
160 <option disabled="disabled"><%= Page.ImageBrowser.Album.AlbumImage.Choose|l10n|html></option>
161 <%foreach album.images image>
162 <option value="<% image.id|html>"<%if album.albumImage.id|match key=image.id> selected="selected"<%/if>><% image.title|html></option>
168 <label for="title"><%= Page.ImageBrowser.Album.Label.Title|l10n|html></label>
169 <input type="text" name="title" value="<%album.title|html>" />
172 <label for="description"><%= Page.ImageBrowser.Album.Label.Description|l10n|html></label>
173 <textarea name="description"><%album.description|html></textarea>
175 <button type="submit"><%= Page.ImageBrowser.Album.Button.Save|l10n|html></button>
180 <%foreach album.albums album>
181 <%first><h2><%= Page.ImageBrowser.Header.Albums|l10n|html></h2><%/first>
182 <%if loop.count|mod divisor=3><div class="image-row"><%/if>
183 <div class="album image">
184 <div class="image-container">
185 <a href="imageBrowser.html?album=<% album.id|html>" title="<% album.title|html>">
186 <%ifnull album.albumImage>
187 <img src="images/unknown-image-0.png" width="266" height="200" alt="<% album.title|html>" title="<% album.title|html>" style="position: relative; top: 0px; left: -33px;" />
189 <% album.albumImage|image-link max-width=200 max-height=200 mode=enlarge title==album.title>
193 <div class="show-data">
194 <div class="album-title"><% album.title|html></div>
195 <div class="album-description"><% album.description|html></div>
198 <%= false|store key=endRow>
199 <%if loop.count|mod divisor=3 offset=1><%= true|store key=endRow><%/if>
200 <%last><%= true|store key=endRow><%/last>
201 <%if endRow></div><%/if>
204 <%if album.sone.local>
205 <div class="show-create-album hidden toggle-link"><a class="small-link">» <%= View.CreateAlbum.Title|l10n|html></a></div>
206 <div class="hide-create-album hidden toggle-link"><a class="small-link">« <%= View.CreateAlbum.Title|l10n|html></a></div>
207 <div class="create-album">
208 <%include include/createAlbum.html>
212 <%foreach album.images image>
213 <%first><h2><%= Page.ImageBrowser.Header.Images|l10n|html></h2><%/first>
214 <%if loop.count|mod divisor=3><div class="image-row"><%/if>
215 <div id="image-<% image.id|html>" class="image">
216 <div class="image-id hidden"><% image.id|html></div>
217 <div class="image-container">
218 <a href="imageBrowser.html?image=<%image.id|html>"><% image|image-link max-width=200 max-height=200 mode=enlarge title==image.title></a>
220 <div class="show-data">
221 <div class="image-title"><% image.title|html></div>
222 <div class="image-description"><% image.description|html></div>
224 <%if album.sone.local>
225 <form class="edit-image" action="editImage.html" method="post">
226 <input type="hidden" name="formPassword" value="<%formPassword|html>" />
227 <input type="hidden" name="returnPage" value="<%request.uri|html>" />
228 <input type="hidden" name="image" value="<%image.id|html>" />
230 <div class="edit-data hidden">
232 <input type="text" name="title" value="<%image.title|html>" />
235 <textarea name="description"><%image.description|html></textarea>
238 <%notfirst><button type="submit" name="moveLeft" value="true"><%= Page.ImageBrowser.Image.Button.MoveLeft|l10n|html></button><%/notfirst>
239 <button type="submit"><%= Page.ImageBrowser.Image.Button.Save|l10n|html></button>
240 <%notlast><button type="submit" name="moveRight" value="true"><%= Page.ImageBrowser.Image.Button.MoveRight|l10n|html></button><%/notlast>
246 <%= false|store key=endRow>
247 <%if loop.count|mod divisor=3 offset=1><%= true|store key=endRow><%/if>
248 <%last><%= true|store key=endRow><%/last>
249 <%if endRow></div><%/if>
252 <%if album.sone.local>
253 <div class="show-upload-image hidden toggle-link"><a class="small-link">» <%= View.UploadImage.Title|l10n|html></a></div>
254 <div class="hide-upload-image hidden toggle-link"><a class="small-link">« <%= View.UploadImage.Title|l10n|html></a></div>
255 <div class="upload-image">
256 <%include include/uploadImage.html>
260 <div class="show-delete-album hidden toggle-link"><a class="small-link">» <%= Page.ImageBrowser.Album.Delete.Title|l10n|html></a></div>
261 <div class="hide-delete-album hidden toggle-link"><a class="small-link">« <%= Page.ImageBrowser.Album.Delete.Title|l10n|html></a></div>
262 <div class="delete-album">
263 <form id="delete-album" action="deleteAlbum.html" method="get">
264 <input type="hidden" name="album" value="<%album.id|html>" />
265 <button type="submit"><%= Page.ImageBrowser.Album.Button.Delete|l10n|html></button>
274 <%elseif imageRequested>
276 <h1 class="backlink"><%image.title|html></h1>
278 <div class="backlinks">
279 <%foreach image.album.backlinks backlink backlinks>
280 <div class="backlink">
281 <a href="<% backlink.target|html>"><% backlink.name|html></a>
283 <%if ! backlinks.last>
284 <div class="separator">></div>
293 <%if image.sone.local>
294 <script language="javascript">
296 getTranslation("WebInterface.DefaultText.EditImage.Title", function(text) {
297 $("#edit-image input[name='title']").each(function() {
298 registerInputTextareaSwap(this, text, "title", false, true);
301 getTranslation("WebInterface.DefaultText.EditImage.Description", function(text) {
302 $("#edit-image :input[name='description']").each(function() {
303 registerInputTextareaSwap(this, text, "description", true, false);
306 $("#edit-image label").hide();
308 hideAndShowBlock(".edit-image", ".show-edit-image", ".hide-edit-image");
309 hideAndShowBlock(".delete-image", ".show-delete-image", ".hide-delete-image");
314 <div class="single-image">
316 <a href="/<%image.key|html>"><% image|image-link max-width=640 max-height=480></a>
318 <a href="imageBrowser.html?image=<%image.id|html>"><% image|image-link max-width=640 max-height=480></a>
322 <p class="parsed"><%image.description|parse sone=image.sone></p>
324 <%if image.sone.local>
326 <div class="show-edit-image hidden toggle-link"><a class="small-link">» <%= Page.ImageBrowser.Image.Edit.Title|l10n|html></a></div>
327 <div class="hide-edit-image hidden toggle-link"><a class="small-link">« <%= Page.ImageBrowser.Image.Edit.Title|l10n|html></a></div>
328 <div class="edit-image">
329 <h2><%= Page.ImageBrowser.Image.Edit.Title|l10n|html></h2>
331 <form id="edit-image" action="editImage.html" method="post">
332 <input type="hidden" name="formPassword" value="<%formPassword|html>" />
333 <input type="hidden" name="returnPage" value="<%request.uri|html>" />
334 <input type="hidden" name="image" value="<%image.id|html>" />
337 <label for="title"><%= Page.ImageBrowser.Image.Title.Label|l10n|html></label>
338 <input type="text" name="title" value="<%image.title|html>" />
341 <label for="description"><%= Page.ImageBrowser.Image.Description.Label|l10n|html></label>
342 <textarea name="description"><%image.description|html></textarea>
345 <button type="submit"><%= Page.ImageBrowser.Image.Button.Save|l10n|html></button>
350 <div class="show-delete-image hidden toggle-link"><a class="small-link">» <%= Page.ImageBrowser.Image.Delete.Title|l10n|html></a></div>
351 <div class="hide-delete-image hidden toggle-link"><a class="small-link">« <%= Page.ImageBrowser.Image.Delete.Title|l10n|html></a></div>
352 <div class="delete-image">
353 <h2><%= Page.ImageBrowser.Image.Delete.Title|l10n|html></h2>
355 <form id="delete-image" action="deleteImage.html" method="get">
356 <input type="hidden" name="image" value="<%image.id|html>" />
357 <button type="submit"><%= Page.ImageBrowser.Image.Button.Delete|l10n|html></button>
365 <%elseif soneRequested>
368 <script language="javascript">
370 getTranslation("WebInterface.DefaultText.CreateAlbum.Name", function(text) {
371 $("#create-album input[name='name']").each(function() {
372 registerInputTextareaSwap(this, text, "name", false, true);
375 getTranslation("WebInterface.DefaultText.CreateAlbum.Description", function(text) {
376 $("#create-album input[name='description']").each(function() {
377 registerInputTextareaSwap(this, text, "description", true, true);
380 $("#create-album label").hide();
382 hideAndShowBlock(".create-album", ".show-create-album", ".hide-create-album");
389 <p><%= Page.ImageBrowser.Sone.Error.NotFound.Text|l10n|html></p>
393 <h1><%= Page.ImageBrowser.Sone.Title|l10n|replace needle='{sone}' replacementKey=sone.niceName|html></h1>
395 <%foreach sone.albums album>
396 <%if loop.count|mod divisor=3><div class="image-row"><%/if>
397 <div class="album image">
398 <div class="image-container">
399 <a href="imageBrowser.html?album=<% album.id|html>" title="<% album.title|html>">
400 <%ifnull album.albumImage>
401 <img src="images/unknown-image-0.png" width="266" height="200" alt="<% album.title|html>" title="<% album.title|html>" style="position: relative; top: 0px; left: -33px;"/>
403 <% album.albumImage|image-link max-width=200 max-height=200 mode=enlarge title==album.title>
407 <div class="show-data">
408 <div class="album-title"><% album.title|html></div>
409 <div class="album-description"><% album.description|html></div>
412 <%= false|store key=endRow>
413 <%if loop.count|mod divisor=3 offset=1><%= true|store key=endRow><%/if>
414 <%last><%= true|store key=endRow><%/last>
415 <%if endRow></div><%/if>
419 <div class="show-create-album hidden toggle-link"><a class="small-link">» <%= View.CreateAlbum.Title|l10n|html></a></div>
420 <div class="hide-create-album hidden toggle-link"><a class="small-link">« <%= View.CreateAlbum.Title|l10n|html></a></div>
421 <div class="create-album">
422 <%include include/createAlbum.html>
430 <%include include/tail.html>