From: David ‘Bombe’ Roden Date: Tue, 22 Mar 2011 19:46:25 +0000 (+0100) Subject: Add browsing albums of a Sone. X-Git-Tag: beta-freefall-0.6.2-1~91 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=c171fa8ea17c7e3c75caed5e2cc6747a11dd4bf9;p=Sone.git Add browsing albums of a Sone. --- diff --git a/src/main/java/net/pterodactylus/sone/web/ImageBrowserPage.java b/src/main/java/net/pterodactylus/sone/web/ImageBrowserPage.java index 6da7cda..778b429 100644 --- a/src/main/java/net/pterodactylus/sone/web/ImageBrowserPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ImageBrowserPage.java @@ -19,6 +19,7 @@ package net.pterodactylus.sone.web; import net.pterodactylus.sone.data.Album; import net.pterodactylus.sone.data.Image; +import net.pterodactylus.sone.data.Sone; import net.pterodactylus.util.template.Template; import net.pterodactylus.util.template.TemplateContext; @@ -63,6 +64,15 @@ public class ImageBrowserPage extends SoneTemplatePage { Image image = webInterface.getCore().getImage(imageId, false); templateContext.set("imageRequested", true); templateContext.set("image", image); + return; + } + Sone sone = getCurrentSone(request.getToadletContext(), false); + String soneId = request.getHttpRequest().getParam("sone", null); + if (soneId != null) { + sone = webInterface.getCore().getSone(soneId, false); } + templateContext.set("soneRequested", true); + templateContext.set("sone", sone); } + } diff --git a/src/main/resources/i18n/sone.en.properties b/src/main/resources/i18n/sone.en.properties index e58389f..e599ea3 100644 --- a/src/main/resources/i18n/sone.en.properties +++ b/src/main/resources/i18n/sone.en.properties @@ -159,6 +159,7 @@ Page.UnfollowSone.Title=Unfollow Sone - Sone Page.ImageBrowser.Title=Image Browser - Sone Page.ImageBrowser.Page.Title=Image Browser Page.ImageBrowser.Album.Error.NotFound.Text=The requested album could not be found. It is possible that it has not yet been downloaded, or that it has been deleted. +Page.ImageBrowser.Sone.Error.NotFound.Text=The requested Sone could not be found. It is possible that it has not yet been downloaded. Page.ImageBrowser.CreateAlbum.Button.CreateAlbum=Create Album Page.CreateAlbum.Title=Create Album - Sone diff --git a/src/main/resources/templates/imageBrowser.html b/src/main/resources/templates/imageBrowser.html index a441206..b1d9997 100644 --- a/src/main/resources/templates/imageBrowser.html +++ b/src/main/resources/templates/imageBrowser.html @@ -47,15 +47,25 @@ <%elseif imageRequested> - <%else> + <%elseif soneRequested> - <%foreach currentSone.albums album> -
-
<% album.name|html>
-
- <%/foreach> + <%ifnull sone> + +

<%= Page.ImageBrowser.Sone.Error.NotFound.Text|l10n|html>

+ + <%else> - <%include include/createAlbum.html> + <%foreach sone.albums album> +
+ +
+ <%/foreach> + + <%if sone.current> + <%include include/createAlbum.html> + <%/if> + + <%/if> <%/if>