From 646004e2b898f06cef9e021f47e855b45b38ebc6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 14 Jan 2011 12:06:22 +0100 Subject: [PATCH] =?utf8?q?Add=20template=20for=20=E2=80=9Csomething=20stra?= =?utf8?q?nge=20has=20happened.=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/web/WebInterface.java | 2 ++ src/main/resources/i18n/sone.en.properties | 4 ++++ src/main/resources/templates/invalid.html | 7 +++++++ 3 files changed, 13 insertions(+) create mode 100644 src/main/resources/templates/invalid.html diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index 2bf7381..52926a7 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -490,6 +490,7 @@ public class WebInterface implements CoreListener { Template logoutTemplate = templateFactory.createTemplate(createReader("/templates/logout.html")); Template optionsTemplate = templateFactory.createTemplate(createReader("/templates/options.html")); Template aboutTemplate = templateFactory.createTemplate(createReader("/templates/about.html")); + Template invalidTemplate = templateFactory.createTemplate(createReader("/templates/invalid.html")); Template postTemplate = templateFactory.createTemplate(createReader("/templates/include/viewPost.html")); Template replyTemplate = templateFactory.createTemplate(createReader("/templates/include/viewReply.html")); @@ -518,6 +519,7 @@ public class WebInterface implements CoreListener { pageToadlets.add(pageToadletFactory.createPageToadlet(new AboutPage(aboutTemplate, this, SonePlugin.VERSION), "About")); pageToadlets.add(pageToadletFactory.createPageToadlet(new SoneTemplatePage("noPermission.html", noPermissionTemplate, "Page.NoPermission.Title", this))); pageToadlets.add(pageToadletFactory.createPageToadlet(new DismissNotificationPage(dismissNotificationTemplate, this))); + pageToadlets.add(pageToadletFactory.createPageToadlet(new SoneTemplatePage("invalid.html", invalidTemplate, "Page.Invalid.Title", this))); pageToadlets.add(pageToadletFactory.createPageToadlet(new StaticPage("css/", "/static/css/", "text/css"))); pageToadlets.add(pageToadletFactory.createPageToadlet(new StaticPage("javascript/", "/static/javascript/", "text/javascript"))); pageToadlets.add(pageToadletFactory.createPageToadlet(new StaticPage("images/", "/static/images/", "image/png"))); diff --git a/src/main/resources/i18n/sone.en.properties b/src/main/resources/i18n/sone.en.properties index 88877b8..b040036 100644 --- a/src/main/resources/i18n/sone.en.properties +++ b/src/main/resources/i18n/sone.en.properties @@ -149,6 +149,10 @@ Page.WotPluginMissing.Text.LoadPlugin=Please load the Web of Trust plugin in the Page.Logout.Title=Logout - Sone +Page.Invalid.Title=Invalid Action Performed +Page.Invalid.Page.Title=Invalid Action Performed +Page.Invalid.Text=An invalid action was performed, or the action was valid but the parameters were not. Please go back to the {link}index page{/link} and try again. If the error persists you have probably found a bug. + View.CreateSone.Text.WotIdentityRequired=To create a Sone you need an identity from the {link}Web of Trust plugin{/link}. View.CreateSone.Select.Default=Select an identity View.CreateSone.Text.NoIdentities=You do not have any Web of Trust identities. Please head over to the {link}Web of Trust plugin{/link} and create an identity. diff --git a/src/main/resources/templates/invalid.html b/src/main/resources/templates/invalid.html new file mode 100644 index 0000000..d838134 --- /dev/null +++ b/src/main/resources/templates/invalid.html @@ -0,0 +1,7 @@ +<%include include/head.html> + +

<%= Page.Invalid.Page.Title|l10n|html>

+ +

<%= Page.Invalid.Text|l10n|html|replace needle="{link}" replacement=''|replace needle="{/link}" replacement=''>

+ +<%include include/tail.html> -- 2.7.4