import net.pterodactylus.sone.data.Post;
import net.pterodactylus.sone.data.Reply;
+import net.pterodactylus.sone.template.SoneAccessor;
import net.pterodactylus.util.template.Template;
import net.pterodactylus.util.template.TemplateContext;
* {@inheritDoc}
*/
@Override
+ protected String getPageTitle(Request request) {
+ String postId = request.getHttpRequest().getParam("post");
+ Post post = webInterface.getCore().getPost(postId, false);
+ String title = "";
+ if ((post != null) && (post.getSone() != null)) {
+ title = post.getText().substring(0, Math.min(20, post.getText().length())) + "…";
+ title += " - " + SoneAccessor.getNiceName(post.getSone()) + " - ";
+ }
+ title += webInterface.getL10n().getString("Page.ViewPost.Title");
+ return title;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
protected void processTemplate(Request request, TemplateContext templateContext) throws RedirectException {
super.processTemplate(request, templateContext);
String postId = request.getHttpRequest().getParam("post");