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 console.log("event: " + event);
60 console.log("closest: " + $(event.target).closest("#image-" + imageId));
61 if ($(event.target).closest("#image-" + imageId).size() == 0) {
68 * Cancels all image editing.
70 function cancelEditing() {
71 $(".show-data").show();
72 $(".edit-data").hide();
73 $("form.edit-image").each(function() {
76 $(document).unbind("click.sone");
77 editingImageId = null;
81 getTranslation("WebInterface.DefaultText.UploadImage.Title", function(text) {
82 $("#upload-image :input[name='title']").each(function() {
83 registerInputTextareaSwap(this, text, "title", false, true);
86 getTranslation("WebInterface.DefaultText.UploadImage.Description", function(text) {
87 $("#upload-image :input[name='description']").each(function() {
88 registerInputTextareaSwap(this, text, "description", true, false);
91 $("#upload-image label").hide();
92 getTranslation("WebInterface.DefaultText.CreateAlbum.Name", function(text) {
93 $("#create-album input[name='name']").each(function() {
94 registerInputTextareaSwap(this, text, "name", false, true);
97 getTranslation("WebInterface.DefaultText.CreateAlbum.Description", function(text) {
98 $("#create-album input[name='description']").each(function() {
99 registerInputTextareaSwap(this, text, "description", true, true);
102 $("#create-album label").hide();
103 getTranslation("WebInterface.DefaultText.EditAlbum.Title", function(text) {
104 $("#edit-album input[name='title']").each(function() {
105 registerInputTextareaSwap(this, text, "title", false, true);
108 getTranslation("WebInterface.DefaultText.EditAlbum.Description", function(text) {
109 $("#edit-album :input[name='description']").each(function() {
110 registerInputTextareaSwap(this, text, "description", true, false);
113 $("#edit-album label").hide();
115 hideAndShowBlock(".edit-album", ".show-edit-album", ".hide-edit-album");
116 hideAndShowBlock(".create-album", ".show-create-album", ".hide-create-album");
117 hideAndShowBlock(".upload-image", ".show-upload-image", ".hide-upload-image");
118 hideAndShowBlock(".delete-album", ".show-delete-album", ".hide-delete-album");
120 $(".image").each(function() {
121 imageId = $(this).closest(".image").find(".image-id").text();
122 (function(element, imageId) {
123 $(".show-data", element).click(function() {
133 <h1 class="backlink"><%= Page.ImageBrowser.Album.Title|l10n|replace needle='{album}' replacementKey=album.title|html></h1>
135 <div class="backlinks">
136 <%foreach album.backlinks backlink backlinks>
137 <div class="backlink">
138 <a href="<% backlink.target|html>"><% backlink.name|html></a>
140 <%if ! backlinks.last>
141 <div class="separator">></div>
146 <p id="description"><% album.description|html></p>
148 <%if album.sone.local>
149 <div class="show-edit-album hidden toggle-link"><a class="small-link">» <%= Page.ImageBrowser.Album.Edit.Title|l10n|html></a></div>
150 <div class="hide-edit-album hidden toggle-link"><a class="small-link">« <%= Page.ImageBrowser.Album.Edit.Title|l10n|html></a></div>
151 <div class="edit-album">
152 <h2><%= Page.ImageBrowser.Album.Edit.Title|l10n|html></h2>
154 <form id="edit-album" action="editAlbum.html" method="post">
155 <input type="hidden" name="formPassword" value="<%formPassword|html>" />
156 <input type="hidden" name="album" value="<%album.id|html>" />
158 <%if ! album.images.empty>
160 <label for="album-image"><%= Page.ImageBrowser.Album.Label.AlbumImage|l10n|html></label>
161 <select name="album-image">
162 <option disabled="disabled"><%= Page.ImageBrowser.Album.AlbumImage.Choose|l10n|html></option>
163 <%foreach album.images image>
164 <option value="<% image.id|html>"<%if album.albumImage.id|match key=image.id> selected="selected"<%/if>><% image.title|html></option>
170 <label for="title"><%= Page.ImageBrowser.Album.Label.Title|l10n|html></label>
171 <input type="text" name="title" value="<%album.title|html>" />
174 <label for="description"><%= Page.ImageBrowser.Album.Label.Description|l10n|html></label>
175 <textarea name="description"><%album.description|html></textarea>
177 <button type="submit"><%= Page.ImageBrowser.Album.Button.Save|l10n|html></button>
182 <%foreach album.albums album>
183 <%first><h2><%= Page.ImageBrowser.Header.Albums|l10n|html></h2><%/first>
184 <%if loop.count|mod divisor=3><div class="image-row"><%/if>
185 <div class="album image">
186 <div class="image-container">
187 <a href="imageBrowser.html?album=<% album.id|html>" title="<% album.title|html>">
188 <%ifnull album.albumImage>
189 <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;" />
191 <% album.albumImage|image-link max-width=200 max-height=200 mode=enlarge title==album.title>
195 <div class="show-data">
196 <div class="album-title"><% album.title|html></div>
197 <div class="album-description"><% album.description|html></div>
200 <%= false|store key=endRow>
201 <%if loop.count|mod divisor=3 offset=1><%= true|store key=endRow><%/if>
202 <%last><%= true|store key=endRow><%/last>
203 <%if endRow></div><%/if>
206 <%if album.sone.local>
207 <div class="show-create-album hidden toggle-link"><a class="small-link">» <%= View.CreateAlbum.Title|l10n|html></a></div>
208 <div class="hide-create-album hidden toggle-link"><a class="small-link">« <%= View.CreateAlbum.Title|l10n|html></a></div>
209 <div class="create-album">
210 <%include include/createAlbum.html>
214 <%foreach album.images image>
215 <%first><h2><%= Page.ImageBrowser.Header.Images|l10n|html></h2><%/first>
216 <%if loop.count|mod divisor=3><div class="image-row"><%/if>
217 <div id="image-<% image.id|html>" class="image">
218 <div class="image-id hidden"><% image.id|html></div>
219 <div class="image-container">
220 <a href="imageBrowser.html?image=<%image.id|html>"><% image|image-link max-width=200 max-height=200 mode=enlarge title==image.title></a>
222 <div class="show-data">
223 <div class="image-title"><% image.title|html></div>
224 <div class="image-description"><% image.description|html></div>
226 <%if album.sone.local>
227 <form class="edit-image" action="editImage.html" method="post">
228 <input type="hidden" name="formPassword" value="<%formPassword|html>" />
229 <input type="hidden" name="returnPage" value="<%request.uri|html>" />
230 <input type="hidden" name="image" value="<%image.id|html>" />
232 <div class="edit-data hidden">
234 <input type="text" name="title" value="<%image.title|html>" />
237 <textarea name="description"><%image.description|html></textarea>
240 <%notfirst><button type="submit" name="moveLeft" value="true"><%= Page.ImageBrowser.Image.Button.MoveLeft|l10n|html></button><%/notfirst>
241 <button type="submit"><%= Page.ImageBrowser.Image.Button.Save|l10n|html></button>
242 <%notlast><button type="submit" name="moveRight" value="true"><%= Page.ImageBrowser.Image.Button.MoveRight|l10n|html></button><%/notlast>
248 <%= false|store key=endRow>
249 <%if loop.count|mod divisor=3 offset=1><%= true|store key=endRow><%/if>
250 <%last><%= true|store key=endRow><%/last>
251 <%if endRow></div><%/if>
254 <%if album.sone.local>
255 <div class="show-upload-image hidden toggle-link"><a class="small-link">» <%= View.UploadImage.Title|l10n|html></a></div>
256 <div class="hide-upload-image hidden toggle-link"><a class="small-link">« <%= View.UploadImage.Title|l10n|html></a></div>
257 <div class="upload-image">
258 <%include include/uploadImage.html>
262 <div class="show-delete-album hidden toggle-link"><a class="small-link">» <%= Page.ImageBrowser.Album.Delete.Title|l10n|html></a></div>
263 <div class="hide-delete-album hidden toggle-link"><a class="small-link">« <%= Page.ImageBrowser.Album.Delete.Title|l10n|html></a></div>
264 <div class="delete-album">
265 <form id="delete-album" action="deleteAlbum.html" method="get">
266 <input type="hidden" name="album" value="<%album.id|html>" />
267 <button type="submit"><%= Page.ImageBrowser.Album.Button.Delete|l10n|html></button>
276 <%elseif imageRequested>
278 <h1 class="backlink"><%image.title|html></h1>
280 <div class="backlinks">
281 <%foreach image.album.backlinks backlink backlinks>
282 <div class="backlink">
283 <a href="<% backlink.target|html>"><% backlink.name|html></a>
285 <%if ! backlinks.last>
286 <div class="separator">></div>
295 <%if image.sone.local>
296 <script language="javascript">
298 getTranslation("WebInterface.DefaultText.EditImage.Title", function(text) {
299 $("#edit-image input[name='title']").each(function() {
300 registerInputTextareaSwap(this, text, "title", false, true);
303 getTranslation("WebInterface.DefaultText.EditImage.Description", function(text) {
304 $("#edit-image :input[name='description']").each(function() {
305 registerInputTextareaSwap(this, text, "description", true, false);
308 $("#edit-image label").hide();
310 hideAndShowBlock(".edit-image", ".show-edit-image", ".hide-edit-image");
311 hideAndShowBlock(".delete-image", ".show-delete-image", ".hide-delete-image");
316 <div class="single-image">
318 <a href="/<%image.key|html>"><% image|image-link max-width=640 max-height=480></a>
320 <a href="imageBrowser.html?image=<%image.id|html>"><% image|image-link max-width=640 max-height=480></a>
324 <p class="parsed"><%image.description|parse sone=image.sone></p>
326 <%if image.sone.local>
328 <div class="show-edit-image hidden toggle-link"><a class="small-link">» <%= Page.ImageBrowser.Image.Edit.Title|l10n|html></a></div>
329 <div class="hide-edit-image hidden toggle-link"><a class="small-link">« <%= Page.ImageBrowser.Image.Edit.Title|l10n|html></a></div>
330 <div class="edit-image">
331 <h2><%= Page.ImageBrowser.Image.Edit.Title|l10n|html></h2>
333 <form id="edit-image" action="editImage.html" method="post">
334 <input type="hidden" name="formPassword" value="<%formPassword|html>" />
335 <input type="hidden" name="returnPage" value="<%request.uri|html>" />
336 <input type="hidden" name="image" value="<%image.id|html>" />
339 <label for="title"><%= Page.ImageBrowser.Image.Title.Label|l10n|html></label>
340 <input type="text" name="title" value="<%image.title|html>" />
343 <label for="description"><%= Page.ImageBrowser.Image.Description.Label|l10n|html></label>
344 <textarea name="description"><%image.description|html></textarea>
347 <button type="submit"><%= Page.ImageBrowser.Image.Button.Save|l10n|html></button>
352 <div class="show-delete-image hidden toggle-link"><a class="small-link">» <%= Page.ImageBrowser.Image.Delete.Title|l10n|html></a></div>
353 <div class="hide-delete-image hidden toggle-link"><a class="small-link">« <%= Page.ImageBrowser.Image.Delete.Title|l10n|html></a></div>
354 <div class="delete-image">
355 <h2><%= Page.ImageBrowser.Image.Delete.Title|l10n|html></h2>
357 <form id="delete-image" action="deleteImage.html" method="get">
358 <input type="hidden" name="image" value="<%image.id|html>" />
359 <button type="submit"><%= Page.ImageBrowser.Image.Button.Delete|l10n|html></button>
367 <%elseif soneRequested>
370 <script language="javascript">
372 getTranslation("WebInterface.DefaultText.CreateAlbum.Name", function(text) {
373 $("#create-album input[name='name']").each(function() {
374 registerInputTextareaSwap(this, text, "name", false, true);
377 getTranslation("WebInterface.DefaultText.CreateAlbum.Description", function(text) {
378 $("#create-album input[name='description']").each(function() {
379 registerInputTextareaSwap(this, text, "description", true, true);
382 $("#create-album label").hide();
384 hideAndShowBlock(".create-album", ".show-create-album", ".hide-create-album");
391 <p><%= Page.ImageBrowser.Sone.Error.NotFound.Text|l10n|html></p>
395 <h1><%= Page.ImageBrowser.Sone.Title|l10n|replace needle='{sone}' replacementKey=sone.niceName|html></h1>
397 <%foreach sone.albums album>
398 <%if loop.count|mod divisor=3><div class="image-row"><%/if>
399 <div class="album image">
400 <div class="image-container">
401 <a href="imageBrowser.html?album=<% album.id|html>" title="<% album.title|html>">
402 <%ifnull album.albumImage>
403 <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;"/>
405 <% album.albumImage|image-link max-width=200 max-height=200 mode=enlarge title==album.title>
409 <div class="show-data">
410 <div class="album-title"><% album.title|html></div>
411 <div class="album-description"><% album.description|html></div>
414 <%= false|store key=endRow>
415 <%if loop.count|mod divisor=3 offset=1><%= true|store key=endRow><%/if>
416 <%last><%= true|store key=endRow><%/last>
417 <%if endRow></div><%/if>
421 <div class="show-create-album hidden toggle-link"><a class="small-link">» <%= View.CreateAlbum.Title|l10n|html></a></div>
422 <div class="hide-create-album hidden toggle-link"><a class="small-link">« <%= View.CreateAlbum.Title|l10n|html></a></div>
423 <div class="create-album">
424 <%include include/createAlbum.html>
432 <%include include/tail.html>