import net.pterodactylus.sone.data.Post;
import net.pterodactylus.sone.data.Reply;
import net.pterodactylus.sone.data.Sone;
+import net.pterodactylus.sone.template.SoneAccessor;
import net.pterodactylus.util.collection.Pagination;
import net.pterodactylus.util.number.Numbers;
import net.pterodactylus.util.template.Template;
* The Sone web interface
*/
public ViewSonePage(Template template, WebInterface webInterface) {
- super("viewSone.html", template, "Page.ViewSone.Title", webInterface, false);
+ super("viewSone.html", template, webInterface, false);
}
//
* {@inheritDoc}
*/
@Override
+ protected String getPageTitle(Request request) {
+ String soneId = request.getHttpRequest().getParam("sone");
+ Sone sone = webInterface.getCore().getSone(soneId, false);
+ if ((sone != null) && (sone.getTime() > 0)) {
+ String soneName = SoneAccessor.getNiceName(sone);
+ return soneName + " - " + webInterface.getL10n().getString("Page.ViewSone.Title");
+ }
+ return webInterface.getL10n().getString("Page.ViewSone.Page.TitleWithoutSone");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
protected void processTemplate(Request request, TemplateContext templateContext) throws RedirectException {
super.processTemplate(request, templateContext);
String soneId = request.getHttpRequest().getParam("sone");