Merge commit '0.3.1' into message-recipient
[Sone.git] / src / main / resources / templates / viewSone.html
index 7b0647f..884fa0f 100644 (file)
@@ -1,39 +1,50 @@
 <%include include/head.html>
 
-       <%ifnull sone.name>
+       <div class="page-id hidden">view-sone</div>
+       <div class="sone-id hidden"><% sone.id|html></div>
+
+       <%ifnull sone>
 
                <h1><%= Page.ViewSone.Page.TitleWithoutSone|l10n|html></h1>
 
-               <div><%= Page.ViewSone.UnknownSone.Description|l10n|html></div>
+               <p><%= Page.ViewSone.NoSone.Description|l10n|insert needle="{sone}" key=sone.id|html></p>
+
+       <%elseifnull sone.name>
+
+               <h1><%= Page.ViewSone.Page.TitleWithoutSone|l10n|html></h1>
+
+               <p><%= Page.ViewSone.UnknownSone.Description|l10n|html></p>
 
        <%else>
 
-               <h1><%= Page.ViewSone.Page.TitleWithSone|l10n|insert needle="{sone}" key=sone.niceName|html></h1>
+               <%if ! sone.current>
+                       <%include include/viewSone.html>
 
-               <h1><%= Page.ViewSone.PostList.Title|l10n|insert needle="{sone}" key=sone.niceName|html></h1>
+                       <p><%= Page.ViewSone.WriteAMessage|l10n|html></p>
 
-               <%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>
+                       <form action="createPost.html" id="post-message" method="post">
+                               <input type="hidden" name="formPassword" value="<% formPassword|html>" />
+                               <input type="hidden" name="returnPage" value="<% request.uri|html>" />
+                               <input type="hidden" name="recipient" value="<% sone.id|html>" />
+                               <input type="text" name="text" value="" />
+                               <button type="submit"><%= Page.CreatePost.Button.Post|l10n|html></button>
+                       </form>
                <%/if>
 
+
+               <h1><%= Page.ViewSone.PostList.Title|l10n|insert needle="{sone}" key=sone.niceName|html></h1>
+
                <div id="posts">
-                       <%foreach sone.posts post>
+                       <%getpage parameter=postPage>
+                       <%paginate list=sone.posts pagesize=25>
+                       <%= 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>
-               </div>
-
-               <h1><%= Page.ViewSone.Following.Title|l10n|html></h1>
-
-               <div id="following">
-                       <%foreach sone.friends sone>
-                               <%include include/viewSone.html>
-                       <%/foreach>
+                       <%include include/pagination.html>
                </div>
 
        <%/if>