From 7a14e6aab2b0458ee97452447845995bbf407ae7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 23 Sep 2011 11:32:24 +0200 Subject: [PATCH] Add possibility to change album image. --- src/main/java/net/pterodactylus/sone/web/EditAlbumPage.java | 5 +++++ src/main/resources/i18n/sone.en.properties | 2 ++ src/main/resources/templates/imageBrowser.html | 11 +++++++++++ 3 files changed, 18 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/web/EditAlbumPage.java b/src/main/java/net/pterodactylus/sone/web/EditAlbumPage.java index 8e3a3e9..fd4bf7c 100644 --- a/src/main/java/net/pterodactylus/sone/web/EditAlbumPage.java +++ b/src/main/java/net/pterodactylus/sone/web/EditAlbumPage.java @@ -57,6 +57,11 @@ public class EditAlbumPage extends SoneTemplatePage { if (!webInterface.getCore().isLocalSone(album.getSone())) { throw new RedirectException("noPermission.html"); } + String albumImageId = request.getHttpRequest().getPartAsStringFailsafe("album-image", 36); + if (webInterface.getCore().getImage(albumImageId, false) == null) { + albumImageId = null; + } + album.setAlbumImage(albumImageId); String title = request.getHttpRequest().getPartAsStringFailsafe("title", 100).trim(); if (title.length() == 0) { templateContext.set("titleMissing", true); diff --git a/src/main/resources/i18n/sone.en.properties b/src/main/resources/i18n/sone.en.properties index e3a2e8a..75f9d41 100644 --- a/src/main/resources/i18n/sone.en.properties +++ b/src/main/resources/i18n/sone.en.properties @@ -192,8 +192,10 @@ Page.ImageBrowser.Header.Images=Images Page.ImageBrowser.CreateAlbum.Button.CreateAlbum=Create Album Page.ImageBrowser.Album.Edit.Title=Edit Album Page.ImageBrowser.Album.Delete.Title=Delete Album +Page.ImageBrowser.Album.Label.AlbumImage=Album Image: Page.ImageBrowser.Album.Label.Title=Title: Page.ImageBrowser.Album.Label.Description=Description: +Page.ImageBrowser.Album.AlbumImage.Choose=Choose Album Image… Page.ImageBrowser.Album.Button.Save=Save Album Page.ImageBrowser.Album.Button.Delete=Delete Album Page.ImageBrowser.Image.Edit.Title=Edit Image diff --git a/src/main/resources/templates/imageBrowser.html b/src/main/resources/templates/imageBrowser.html index a63f1a7..bb21d46 100644 --- a/src/main/resources/templates/imageBrowser.html +++ b/src/main/resources/templates/imageBrowser.html @@ -123,6 +123,17 @@ + <%if ! album.images.empty> +
+ + +
+ <%/if>
-- 2.7.4