From: David ‘Bombe’ Roden Date: Thu, 15 Sep 2011 15:58:04 +0000 (+0200) Subject: Add and use include files to generate a div that spans all WoTNS content. X-Git-Tag: 0.0.1~2 X-Git-Url: https://git.pterodactylus.net/?p=WoTNS.git;a=commitdiff_plain;h=a626746ba02e64402514c32a5317c33fdcd7be35 Add and use include files to generate a div that spans all WoTNS content. --- diff --git a/src/main/java/net/pterodactylus/wotns/ui/web/WebInterface.java b/src/main/java/net/pterodactylus/wotns/ui/web/WebInterface.java index cb9b40e..18daf46 100644 --- a/src/main/java/net/pterodactylus/wotns/ui/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/wotns/ui/web/WebInterface.java @@ -24,6 +24,7 @@ import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.List; +import net.pterodactylus.util.template.ClassPathTemplateProvider; import net.pterodactylus.util.template.CollectionSortFilter; import net.pterodactylus.util.template.HtmlFilter; import net.pterodactylus.util.template.ReflectionAccessor; @@ -63,6 +64,7 @@ public class WebInterface { CollectionSortFilter sortFilter = new CollectionSortFilter(); sortFilter.addComparator(Identity.class, IdentityComparator.NAME); templateContextFactory.addFilter("sort", sortFilter); + templateContextFactory.addProvider(new ClassPathTemplateProvider(WebInterface.class)); } // diff --git a/src/main/resources/templates/addTarget.html b/src/main/resources/templates/addTarget.html index 9bae233..79f4d88 100644 --- a/src/main/resources/templates/addTarget.html +++ b/src/main/resources/templates/addTarget.html @@ -1,2 +1,4 @@ +<%include include/head.html>

Add target.

An error occured.

+<%include include/tail.html> \ No newline at end of file diff --git a/src/main/resources/templates/include/head.html b/src/main/resources/templates/include/head.html new file mode 100644 index 0000000..dff40ac --- /dev/null +++ b/src/main/resources/templates/include/head.html @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/src/main/resources/templates/include/tail.html b/src/main/resources/templates/include/tail.html new file mode 100644 index 0000000..7f5eaa3 --- /dev/null +++ b/src/main/resources/templates/include/tail.html @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index 2da3f2d..2144e2f 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -1,3 +1,4 @@ +<%include include/head.html>

WoTNS

Yay, Index!

@@ -24,3 +25,4 @@ <%/foreach> +<%include include/tail.html> \ No newline at end of file diff --git a/src/main/resources/templates/manage.html b/src/main/resources/templates/manage.html index 3f50a8c..a585155 100644 --- a/src/main/resources/templates/manage.html +++ b/src/main/resources/templates/manage.html @@ -1,3 +1,4 @@ +<%include include/head.html>

Manage “<%ownIdentity.nickname|html>”

<%foreach ownIdentity.targets target> <%first> @@ -21,3 +22,4 @@ +<%include include/tail.html> \ No newline at end of file diff --git a/src/main/resources/templates/unknown.html b/src/main/resources/templates/unknown.html index 6fab8b9..4f16c62 100644 --- a/src/main/resources/templates/unknown.html +++ b/src/main/resources/templates/unknown.html @@ -1,2 +1,4 @@ +<%include include/head.html>

Unknown name

-

The name “<%shortName|html>” is unknown.

\ No newline at end of file +

The name “<%shortName|html>” is unknown.

+<%include include/tail.html> \ No newline at end of file