From: David ‘Bombe’ Roden Date: Tue, 19 Oct 2010 19:25:19 +0000 (+0200) Subject: Use the addTemplateObject() method in the default template factory. X-Git-Tag: 0.1-RC1~184 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=bbc3a5f685d350b49cd6c3ea7a3f06d4f0a821ac;p=Sone.git Use the addTemplateObject() method in the default template factory. --- diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index 2177aab..456e103 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -154,62 +154,26 @@ public class WebInterface extends AbstractService { templateFactory.addFilter("l10n", new L10nFilter(l10n())); templateFactory.addFilter("substring", new SubstringFilter()); templateFactory.setTemplateProvider(new ClassPathTemplateProvider(templateFactory)); - - String formPassword = sonePlugin.pluginRespirator().getToadletContainer().getFormPassword(); + templateFactory.addTemplateObject("formPassword", sonePlugin.pluginRespirator().getToadletContainer().getFormPassword()); Template loginTemplate = templateFactory.createTemplate(createReader("/templates/login.html")); - loginTemplate.set("formPassword", formPassword); - Template indexTemplate = templateFactory.createTemplate(createReader("/templates/index.html")); - indexTemplate.set("formPassword", formPassword); - Template addSoneTemplate = templateFactory.createTemplate(createReader("/templates/addSone.html")); - addSoneTemplate.set("formPassword", formPassword); - Template knownSonesTemplate = templateFactory.createTemplate(createReader("/templates/knownSones.html")); - knownSonesTemplate.set("formPassword", formPassword); - Template createSoneTemplate = templateFactory.createTemplate(createReader("/templates/createSone.html")); - createSoneTemplate.set("formPassword", formPassword); - Template createPostTemplate = templateFactory.createTemplate(createReader("/templates/createPost.html")); - createPostTemplate.set("formPassword", formPassword); - Template createReplyTemplate = templateFactory.createTemplate(createReader("/templates/createReply.html")); - createReplyTemplate.set("formPassword", formPassword); - Template editProfileTemplate = templateFactory.createTemplate(createReader("/templates/editProfile.html")); - editProfileTemplate.set("formPassword", formPassword); - Template backupProfileTemplate = templateFactory.createTemplate(createReader("/templates/backup.xml")); - backupProfileTemplate.set("formPassword", formPassword); - Template viewSoneTemplate = templateFactory.createTemplate(createReader("/templates/viewSone.html")); - viewSoneTemplate.set("formPassword", formPassword); - Template blockSoneTemplate = templateFactory.createTemplate(createReader("/templates/blockSone.html")); - blockSoneTemplate.set("formPassword", formPassword); - Template unblockSoneTemplate = templateFactory.createTemplate(createReader("/templates/unblockSone.html")); - unblockSoneTemplate.set("formPassword", formPassword); - Template viewPostTemplate = templateFactory.createTemplate(createReader("/templates/viewPost.html")); - viewPostTemplate.set("formPassword", formPassword); - Template deletePostTemplate = templateFactory.createTemplate(createReader("/templates/deletePost.html")); - deletePostTemplate.set("formPassword", formPassword); - Template followSoneTemplate = templateFactory.createTemplate(createReader("/templates/followSone.html")); - followSoneTemplate.set("formPassword", formPassword); - Template unfollowSoneTemplate = templateFactory.createTemplate(createReader("/templates/unfollowSone.html")); - unfollowSoneTemplate.set("formPassword", formPassword); - Template deleteSoneTemplate = templateFactory.createTemplate(createReader("/templates/deleteSone.html")); - deleteSoneTemplate.set("formPassword", formPassword); - Template noPermissionTemplate = templateFactory.createTemplate(createReader("/templates/noPermission.html")); - Template logoutTemplate = templateFactory.createTemplate(createReader("/templates/logout.html")); PageToadletFactory pageToadletFactory = new PageToadletFactory(sonePlugin.pluginRespirator().getHLSimpleClient(), "/Sone/");