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;
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<Album> albums = new HashSet<Album>();
+ 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);
}
<%/if>
+ <%elseif galleryRequested>
+
+ <%foreach albums album>
+ <%first><h2><%= Page.ImageBrowser.Header.Albums|l10n|html></h2><%/first>
+ <%if loop.count|mod divisor=3><div class="album-row"><%/if>
+ <div id="album-<% album.id|html>" class="album">
+ <div class="album-id hidden"><% album.id|html></div>
+ <div class="album-container">
+ <a href="imageBrowser.html?album=<% album.id|html>" title="<% album.title|html>">
+ <%ifnull album.albumImage>
+ <img src="images/unknown-image-0.png" width="333" height="250" alt="<% album.title|html> (<%album.sone.niceName|html>)" title="<% album.title|html> (<%album.sone.niceName|html>)" style="position: relative; top: 0px; left: -41px;" />
+ <%else><!-- TODO -->
+ <% album.albumImage|image-link max-width=250 max-height=250 mode=enlarge title==album.title>
+ <%/if>
+ </a>
+ </div>
+ <div class="show-data">
+ <div class="album-sone"><a href="imageBrowser.html?sone=<%album.sone.id|html>"><%album.sone.niceName|html></a></div>
+ <div class="album-title"><% album.title|html> (<%= View.Sone.Stats.Images|l10n 0=album.images.size>)</div>
+ <div class="album-description"><% album.description|parse sone=album.sone></div>
+ </div>
+ </div>
+ <%= false|store key=endRow>
+ <%if loop.count|mod divisor=3 offset=1><%= true|store key=endRow><%/if>
+ <%last><%= true|store key=endRow><%/last>
+ <%if endRow></div><%/if>
+ <%/foreach>
+
<%/if>
<%include include/tail.html>