From bbc3a5f685d350b49cd6c3ea7a3f06d4f0a821ac Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 19 Oct 2010 21:25:19 +0200 Subject: [PATCH] Use the addTemplateObject() method in the default template factory. --- .../net/pterodactylus/sone/web/WebInterface.java | 38 +--------------------- 1 file changed, 1 insertion(+), 37 deletions(-) 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/"); -- 2.7.4