From 09b9d94dea6b6750a00475ab4e75d378bd76cc8f Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 16 Oct 2010 12:27:32 +0200 Subject: [PATCH] Create inclusion template for viewing a post. --- src/main/resources/i18n/sone.en.properties | 3 +++ src/main/resources/templates/include/viewPost.html | 21 +++++++++++++++++++++ src/main/resources/templates/index.html | 21 +-------------------- src/main/resources/templates/viewPost.html | 21 +-------------------- 4 files changed, 26 insertions(+), 40 deletions(-) create mode 100644 src/main/resources/templates/include/viewPost.html diff --git a/src/main/resources/i18n/sone.en.properties b/src/main/resources/i18n/sone.en.properties index 2d3c1d3..179ab52 100644 --- a/src/main/resources/i18n/sone.en.properties +++ b/src/main/resources/i18n/sone.en.properties @@ -107,3 +107,6 @@ Page.ViewPost.Button.PostReply=Post Reply! Page.FollowSone.Title=Follow Sone - Sone Page.Logout.Title=Logout - Sone + +View.Post.DeleteLink=Delete Post +View.Post.SendReply=Post Reply! diff --git a/src/main/resources/templates/include/viewPost.html b/src/main/resources/templates/include/viewPost.html new file mode 100644 index 0000000..c6ea6a2 --- /dev/null +++ b/src/main/resources/templates/include/viewPost.html @@ -0,0 +1,21 @@ +
+ +
<% post.text|html>
+ + <%if post.sone.isCurrent> +
+<%foreach post.replies reply> +
+ +
<% reply.text|html>
+
<% reply.time|date format="MMM d, yyyy, HH:mm:ss">
+
+<%/foreach> +
+
+ + + + +
+
diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index d148926..3db413d 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -28,26 +28,7 @@
<%foreach posts post> -
- -
<% post.text|html>
- -
- <%foreach post.replies reply> -
- -
<% reply.text|html>
-
<% reply.time|date format="MMM d, yyyy, HH:mm:ss">
-
- <%/foreach> -
-
- - - - -
-
+ <%include include/viewPost.html> <%foreachelse>
<%= Page.Index.PostList.Text.NoPostYet|l10n|html>
<%/foreach> diff --git a/src/main/resources/templates/viewPost.html b/src/main/resources/templates/viewPost.html index 237bfce..0209b20 100644 --- a/src/main/resources/templates/viewPost.html +++ b/src/main/resources/templates/viewPost.html @@ -2,25 +2,6 @@

<%= Page.ViewPost.Page.Title|l10n|insert needle="{sone}" key=post.sone.niceName|html>

-
- -
<% post.text|html>
-
<% post.time|date format="MMM d, yyyy, HH:mm:ss">
-
- <%foreach post.replies reply> -
- -
<% reply.text|html>
-
<% reply.time|date format="MMM d, yyyy, HH:mm:ss">
-
- <%/foreach> -
-
- - - - -
-
+ <%include include/viewPost.html>
-- 2.7.4