X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterface.java;h=f975f00f190ea7ebb158b05a2de983ecbb705183;hb=793370e43152d61ca04699fdfccf39fd73707806;hp=456e103083f879d2e6ff2cabc5a44ce80a83dbf4;hpb=bbc3a5f685d350b49cd6c3ea7a3f06d4f0a821ac;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index 456e103..f975f00 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -48,10 +48,8 @@ import net.pterodactylus.util.template.Template; import net.pterodactylus.util.template.TemplateException; import net.pterodactylus.util.template.TemplateFactory; import net.pterodactylus.util.template.TemplateProvider; -import freenet.clients.http.LinkEnabledCallback; import freenet.clients.http.SessionManager; import freenet.clients.http.ToadletContainer; -import freenet.clients.http.ToadletContext; import freenet.l10n.BaseL10n; /** @@ -78,7 +76,7 @@ public class WebInterface extends AbstractService { * The Sone plugin */ public WebInterface(SonePlugin sonePlugin) { - super("Sone Web Interface"); + super("Sone Web Interface", false); this.sonePlugin = sonePlugin; } @@ -159,6 +157,7 @@ public class WebInterface extends AbstractService { Template loginTemplate = templateFactory.createTemplate(createReader("/templates/login.html")); Template indexTemplate = templateFactory.createTemplate(createReader("/templates/index.html")); Template addSoneTemplate = templateFactory.createTemplate(createReader("/templates/addSone.html")); + Template loadSoneTemplate = templateFactory.createTemplate(createReader("/templates/loadSone.html")); Template knownSonesTemplate = templateFactory.createTemplate(createReader("/templates/knownSones.html")); Template createSoneTemplate = templateFactory.createTemplate(createReader("/templates/createSone.html")); Template createPostTemplate = templateFactory.createTemplate(createReader("/templates/createPost.html")); @@ -170,6 +169,7 @@ public class WebInterface extends AbstractService { Template unblockSoneTemplate = templateFactory.createTemplate(createReader("/templates/unblockSone.html")); Template viewPostTemplate = templateFactory.createTemplate(createReader("/templates/viewPost.html")); Template deletePostTemplate = templateFactory.createTemplate(createReader("/templates/deletePost.html")); + Template deleteReplyTemplate = templateFactory.createTemplate(createReader("/templates/deleteReply.html")); Template followSoneTemplate = templateFactory.createTemplate(createReader("/templates/followSone.html")); Template unfollowSoneTemplate = templateFactory.createTemplate(createReader("/templates/unfollowSone.html")); Template deleteSoneTemplate = templateFactory.createTemplate(createReader("/templates/deleteSone.html")); @@ -179,7 +179,8 @@ public class WebInterface extends AbstractService { PageToadletFactory pageToadletFactory = new PageToadletFactory(sonePlugin.pluginRespirator().getHLSimpleClient(), "/Sone/"); pageToadlets.add(pageToadletFactory.createPageToadlet(new IndexPage(indexTemplate, this), "Index")); pageToadlets.add(pageToadletFactory.createPageToadlet(new CreateSonePage(createSoneTemplate, this), "CreateSone")); - pageToadlets.add(pageToadletFactory.createPageToadlet(new AddSonePage(addSoneTemplate, this), "AddSone")); + pageToadlets.add(pageToadletFactory.createPageToadlet(new LoadSonePage(loadSoneTemplate, this))); + pageToadlets.add(pageToadletFactory.createPageToadlet(new AddSonePage(addSoneTemplate, this))); pageToadlets.add(pageToadletFactory.createPageToadlet(new KnownSonesPage(knownSonesTemplate, this), "KnownSones")); pageToadlets.add(pageToadletFactory.createPageToadlet(new EditProfilePage(editProfileTemplate, this), "EditProfile")); pageToadlets.add(pageToadletFactory.createPageToadlet(new BackupProfilePage(backupProfileTemplate, this))); @@ -190,6 +191,7 @@ public class WebInterface extends AbstractService { pageToadlets.add(pageToadletFactory.createPageToadlet(new UnblockSonePage(unblockSoneTemplate, this))); pageToadlets.add(pageToadletFactory.createPageToadlet(new ViewPostPage(viewPostTemplate, this))); pageToadlets.add(pageToadletFactory.createPageToadlet(new DeletePostPage(deletePostTemplate, this))); + pageToadlets.add(pageToadletFactory.createPageToadlet(new DeleteReplyPage(deleteReplyTemplate, this))); pageToadlets.add(pageToadletFactory.createPageToadlet(new FollowSonePage(followSoneTemplate, this))); pageToadlets.add(pageToadletFactory.createPageToadlet(new UnfollowSonePage(unfollowSoneTemplate, this))); pageToadlets.add(pageToadletFactory.createPageToadlet(new DeleteSonePage(deleteSoneTemplate, this), "DeleteSone")); @@ -240,24 +242,6 @@ public class WebInterface extends AbstractService { } /** - * {@link LinkEnabledCallback} implementation that always returns - * {@code true} when {@link LinkEnabledCallback#isEnabled(ToadletContext)} - * is called. - * - * @author David ‘Bombe’ Roden - */ - public class AlwaysEnabledCallback implements LinkEnabledCallback { - - /** - * {@inheritDoc} - */ - @Override - public boolean isEnabled(ToadletContext toadletContext) { - return true; - } - } - - /** * Template provider implementation that uses * {@link WebInterface#createReader(String)} to load templates for * inclusion.