X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FImageBrowserPage.java;h=406a762affa54517929c195670670999e3386354;hp=3afaae6064e7b675cc88cd0e46e6431dce935bdc;hb=7bfd17c9c8b2fd5717308019bd2821ca643b4814;hpb=6fb5846e38f0d68f2870f9a4222685f9219da3ba diff --git a/src/main/java/net/pterodactylus/sone/web/ImageBrowserPage.java b/src/main/java/net/pterodactylus/sone/web/ImageBrowserPage.java index 3afaae6..406a762 100644 --- a/src/main/java/net/pterodactylus/sone/web/ImageBrowserPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ImageBrowserPage.java @@ -18,6 +18,8 @@ package net.pterodactylus.sone.web; import java.net.URI; +import java.util.HashSet; +import java.util.Set; import net.pterodactylus.sone.data.Album; import net.pterodactylus.sone.data.Image; @@ -69,11 +71,24 @@ public class ImageBrowserPage extends SoneTemplatePage { 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); + Sone sone = webInterface.getCore().getSone(soneId, false); + templateContext.set("soneRequested", true); + templateContext.set("sone", sone); + return; } + String mode = request.getHttpRequest().getParam("mode", null); + if ("gallery".equals(mode)) { + templateContext.set("galleryRequested", true); + Set albums = new HashSet(); + for (Sone sone : webInterface.getCore().getSones()) { + albums.addAll(sone.getAllAlbums()); + } + templateContext.set("albums", albums); + return; + } + Sone sone = getCurrentSone(request.getToadletContext(), false); templateContext.set("soneRequested", true); templateContext.set("sone", sone); }