projects
/
WoTNS.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b305580
)
Add and use include files to generate a div that spans all WoTNS content.
author
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Thu, 15 Sep 2011 15:58:04 +0000
(17:58 +0200)
committer
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Thu, 15 Sep 2011 15:58:04 +0000
(17:58 +0200)
src/main/java/net/pterodactylus/wotns/ui/web/WebInterface.java
patch
|
blob
|
history
src/main/resources/templates/addTarget.html
patch
|
blob
|
history
src/main/resources/templates/include/head.html
[new file with mode: 0644]
patch
|
blob
src/main/resources/templates/include/tail.html
[new file with mode: 0644]
patch
|
blob
src/main/resources/templates/index.html
patch
|
blob
|
history
src/main/resources/templates/manage.html
patch
|
blob
|
history
src/main/resources/templates/unknown.html
patch
|
blob
|
history
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
(file)
--- 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 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;
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);
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
(file)
--- a/
src/main/resources/templates/addTarget.html
+++ b/
src/main/resources/templates/addTarget.html
@@
-1,2
+1,4
@@
+<%include include/head.html>
<h1>Add target.</h1>
<p>An error occured.</p>
<h1>Add target.</h1>
<p>An error occured.</p>
+<%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
(file)
index 0000000..
dff40ac
--- /dev/null
+++ b/
src/main/resources/templates/include/head.html
@@ -0,0
+1
@@
+<div id="wotns">
\ 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
(file)
index 0000000..
7f5eaa3
--- /dev/null
+++ b/
src/main/resources/templates/include/tail.html
@@ -0,0
+1
@@
+</div>
\ 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
(file)
--- a/
src/main/resources/templates/index.html
+++ b/
src/main/resources/templates/index.html
@@
-1,3
+1,4
@@
+<%include include/head.html>
<h1>WoTNS</h1>
<p>Yay, Index!</p>
<h1>WoTNS</h1>
<p>Yay, Index!</p>
@@
-24,3
+25,4
@@
<button type="submit" name="enable">Enable</button>
</form>
<%/foreach>
<button type="submit" name="enable">Enable</button>
</form>
<%/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
(file)
--- a/
src/main/resources/templates/manage.html
+++ b/
src/main/resources/templates/manage.html
@@
-1,3
+1,4
@@
+<%include include/head.html>
<h1>Manage “<%ownIdentity.nickname|html>”</h1>
<%foreach ownIdentity.targets target>
<%first>
<h1>Manage “<%ownIdentity.nickname|html>”</h1>
<%foreach ownIdentity.targets target>
<%first>
@@
-21,3
+22,4
@@
<input type="text" name="target" value=""/>
<button type="submit" name="add">Add</button>
</form>
<input type="text" name="target" value=""/>
<button type="submit" name="add">Add</button>
</form>
+<%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
(file)
--- a/
src/main/resources/templates/unknown.html
+++ b/
src/main/resources/templates/unknown.html
@@
-1,2
+1,4
@@
+<%include include/head.html>
<h1>Unknown name</h1>
<h1>Unknown name</h1>
-<p>The name “<%shortName|html>” is unknown.</p>
\ No newline at end of file
+<p>The name “<%shortName|html>” is unknown.</p>
+<%include include/tail.html>
\ No newline at end of file