Always show header.
[Sone.git] / src / main / resources / templates / viewSone.html
index a7686c9..b1af3f8 100644 (file)
@@ -1,4 +1,4 @@
-<div id="sone">
+<%include include/head.html>
 
        <%ifnull sone.name>
 
@@ -8,61 +8,44 @@
 
        <%else>
 
-               <h1><%= Page.ViewSone.Page.TitleWithSone|l10n|insert needle="{sone}" key=sone.niceName|html></h1>
+               <%if ! sone.current>
+                       <%include include/viewSone.html>
+               <%/if>
 
-               <h1><%= Page.ViewSone.PostList.Title|l10n|insert needle="{sone}" key=sone.niceName|html></h1>
+               <div id="import-key">
+                       <div class="import-key"><% sone.requestUri|html></div>
+               </div>
 
-               <%if ! sone.isCurrent>
-                       <%if sone.isFriend>
-                               <div><a href="unfollowSone.html?sone=<% sone.id>"><%= Page.ViewSone.UnfollowSone.Text|l10n|html></a></div>
-                       <%else>
-                               <div><a href="followSone.html?sone=<% sone.id>"><%= Page.ViewSone.FollowSone.Text|l10n|html></a></div>
-                       <%/if>
-               <%/if>
+               <h1><%= Page.ViewSone.PostList.Title|l10n|insert needle="{sone}" key=sone.niceName|html></h1>
 
                <div id="posts">
-                       <%foreach sone.posts post>
-                               <div class="post">
-                                       <div class="author"><a href="viewSone.html?sone=<% post.sone.id>"><% post.sone.niceName|html></a></div>
-                                       <div class="text"><% post.text|html></div>
-                                       <div class="time"><% post.time|date format="MMM d, yyyy, HH:mm:ss"></div>
-                               </div>
-                               <%foreach post.replies reply>
-                                       <div class="reply">
-                                               <div class="author"><a href="viewSone.html?sone=<% reply.sone.id>"><% reply.sone.niceName|html></a></div>
-                                               <div class="text"><% reply.text|html></div>
-                                               <div class="time"><% reply.time|date format="MMM d, yyyy, HH:mm:ss"></div>
-                                       </div>
-                               <%/foreach>
-                               <div class="create-reply">
-                                       <form method="post" action="createReply.html">
-                                               <input type="hidden" name="formPassword" value="<% formPassword|html>" />
-                                               <input type="hidden" name="post" value="<% post.id>" />
-                                               <input type="text" name="text" value="" />
-                                               <button type="submit">Post Reply</button>
-                                       </form>
-                               </div>
+                       <%getpage parameter=postPage>
+                       <%paginate list=sone.posts pagesize=2>
+                       <%= postPage|store key=pageParameter>
+                       <%include include/pagination.html>
+                       <%foreach pagination.items post>
+                               <%include include/viewPost.html>
                        <%foreachelse>
                                <div><%= Page.ViewSone.PostList.Text.NoPostYet|l10n|html></div>
                        <%/foreach>
+                       <%include include/pagination.html>
                </div>
-               
+
                <h1><%= Page.ViewSone.Following.Title|l10n|html></h1>
-               
+
                <div id="following">
-                       <%foreach sone.friends friend>
-                               <%first>
-                                       <ul>
-                               <%/first>
-                                       <li><a href="viewSone.html?sone=<% friend.id>"><% friend.niceName|html></a> (<% friend.requestUri|html>)</li>
-                               <%last>
-                                       </ul>
-                               <%/last>
+                       <%getpage parameter=sonePage>
+                       <%paginate list=sone.friends pagesize=2>
+                       <%= sonePage|store key=pageParameter>
+                       <%include include/pagination.html>
+                       <%foreach pagination.items sone>
+                               <%include include/viewSone.html>
                        <%foreachelse>
                                <div><%= Page.ViewSone.Following.FollowingNone.Text|l10n|html></div>
                        <%/foreach>
+                       <%include include/pagination.html>
                </div>
 
        <%/if>
 
-</div>
+<%include include/tail.html>