Merge branch 'next' into dev/image
[Sone.git] / src / main / resources / templates / viewSone.html
index fac920b..d80818a 100644 (file)
@@ -7,13 +7,17 @@
 
                <h1><%= Page.ViewSone.Page.TitleWithoutSone|l10n|html></h1>
 
-               <p><%= Page.ViewSone.NoSone.Description|l10n|replace needle="{sone}" replacementKey=sone.id|html></p>
+               <p><%= Page.ViewSone.NoSone.Description|l10n|replace needle="{sone}" replacementKey=soneId|html></p>
 
        <%elseifnull sone.name>
 
                <h1><%= Page.ViewSone.Page.TitleWithoutSone|l10n|html></h1>
 
                <p><%= Page.ViewSone.UnknownSone.Description|l10n|html></p>
+               <p>
+                       <%= Page.ViewSone.UnknownSone.LinkToWebOfTrust|l10n|html>
+                       <a href="/WebOfTrust/ShowIdentity?id=<% sone.id|html>"><%= Page.ViewSone.Profile.Name.WoTLink|l10n|html></a>
+               </p>
 
        <%else>
 
 
                        <div class="profile-field">
                                <div class="name"><%= Page.ViewSone.Profile.Label.Name|l10n|html></div>
-                               <div class="value"><a href="/WoT/ShowIdentity?id=<% sone.id|html>"><% sone.niceName|html></a></div>
+                               <div class="value"><% sone.niceName|html> (<a href="/WebOfTrust/ShowIdentity?id=<% sone.id|html>"><%= Page.ViewSone.Profile.Name.WoTLink|l10n|html></a>)</div>
                        </div>
 
+                       <%foreach sone.albums album>
+                               <%first>
+                                       <div class="profile-field">
+                                               <div class="name"><%= Page.ViewSone.Profile.Label.Albums|l10n|html></div>
+                                               <div class="value">
+                               <%/first>
+                                       <a href="imageBrowser.html?album=<%album.id|html>"><%album.title|html></a><%notlast>, <%/notlast>
+                               <%last>
+                                               </div>
+                                       </div>
+                               <%/last>
+                       <%/foreach>
+
                        <%foreach sone.profile.fields field>
                                <div class="profile-field">
                                        <div class="name"><% field.name|html></div>
                                </div>
                        <%/foreach>
 
-               <%if ! sone.current>
-                       <p><%= Page.ViewSone.WriteAMessage|l10n|html></p>
-
-                       <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>
+               <%ifnull ! currentSone>
+                       <%if ! sone.current>
+                               <p><%= Page.ViewSone.WriteAMessage|l10n|html></p>
+
+                               <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>" />
+                                       <label for="sender"><%= Page.Index.Label.Sender|l10n|html></label>
+                                       <div class="sender">
+                                               <select name="sender" title="<%= View.UpdateStatus.Text.ChooseSenderIdentity|l10n|html>">
+                                                       <%foreach localSones localSone>
+                                                               <option value="<% localSone.id|html>"<%if localSone.current> selected="selected"<%/if>><% localSone.niceName|html></option>
+                                                       <%/foreach>
+                                               </select>
+                                       </div>
+                                       <div class="select-sender"><button type="button" title="<%= View.UpdateStatus.Text.ChooseSenderIdentity|l10n|html>">+</button></div><label for="text"><%= Page.Index.Label.Text|l10n|html></label>
+                                       <input type="text" name="text" value="" />
+                                       <button type="submit"><%= Page.CreatePost.Button.Post|l10n|html></button>
+                               </form>
+                       <%/if>
                <%/if>
 
                <h1><%= Page.ViewSone.PostList.Title|l10n|replace needle="{sone}" replacementKey=sone.niceName|html></h1>
 
-               <div id="posts">
-                       <%: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>
-                       <%include include/pagination.html>
-               </div>
+               <%foreach posts post>
+                       <%first>
+                               <div id="posts">
+                                       <%include include/pagination.html pagination=postPagination pageParameter==postPage paginationName==post-navigation>
+                       <%/first>
+                       <%include include/viewPost.html>
+                       <%last>
+                                       <%include include/pagination.html pagination=postPagination pageParameter==postPage>
+                               </div>
+                       <%/last>
+               <%foreachelse>
+                       <div><%= Page.ViewSone.PostList.Text.NoPostYet|l10n|html></div>
+               <%/foreach>
+
+               <%foreach repliedPosts post>
+                       <%first>
+                               <h2><%= Page.ViewSone.Replies.Title|l10n|html|replace needle="{sone}" replacementKey=sone.niceName></h2>
+                               <div id="replied-posts">
+                                       <%include include/pagination.html pagination=repliedPostPagination pageParameter==repliedPostPage paginationName==reply-navigation>
+                       <%/first>
+                       <%include include/viewPost.html>
+                       <%last>
+                                       <%include include/pagination.html pagination=repliedPostPagination pageParameter==repliedPostPage>
+                               </div>
+                       <%/last>
+               <%/foreach>
 
        <%/if>