Add functions to lock and unlock a Sone.
[Sone.git] / src / main / resources / templates / include / viewSone.html
index 39d42da..82c0861 100644 (file)
@@ -1,4 +1,4 @@
-<div class="sone <% sone.status|html><%if sone.modified> modified<%/if> <% sone.id|html><%if sone.local> local<%/if>">
+<div class="sone <% sone.status|html><%if sone.modified> modified<%/if> <% sone.id|css|html><%if sone.local> local<%/if><%if sone.new> new<%/if>">
        <div class="id"><% sone.id|html></div>
        <div class="unknown-marker" title="<%= View.Sone.Status.Unknown|l10n|html>">?</div>
        <div class="modified-marker" title="<%= View.Sone.Status.Modified|l10n|html>">!</div>
@@ -9,46 +9,33 @@
        <div class="profile-link"><a href="viewSone.html?sone=<% sone.id|html>" title="<% sone.requestUri|html>"><% sone.niceName|html></a></div>
        <div class="short-request-uri"><% sone.requestUri|substring start=4 length=43|html></div>
        <div class="hidden"><% sone.blacklisted></div>
+       <%if sone.local>
+               <form class="lock<%if sone.locked> hidden<%/if>" action="lockSone.html" method="post">
+                       <input type="hidden" name="formPassword" value="<% formPassword|html>" />
+                       <input type="hidden" name="sone" value="<% sone.id|html>" />
+                       <input type="hidden" name="returnPage" value="<% request.uri|html>" />
+                       <button type="submit"><%= View.Sone.Button.LockSone|l10n|html></button>
+               </form>
+               <form class="unlock<%if !sone.locked> hidden<%/if>" action="unlockSone.html" method="post">
+                       <input type="hidden" name="formPassword" value="<% formPassword|html>" />
+                       <input type="hidden" name="sone" value="<% sone.id|html>" />
+                       <input type="hidden" name="returnPage" value="<% request.uri|html>" />
+                       <button type="submit"><%= View.Sone.Button.UnlockSone|l10n|html></button>
+               </form>
+       <%/if>
        <%if ! sone.current>
-               <%if ! sone.blacklisted>
-                       <form class="blacklist" action="blacklistSone.html" method="post">
+               <%ifnull ! currentSone>
+                       <form class="unfollow<%if ! sone.friend> hidden<%/if>" action="unfollowSone.html" method="post">
                                <input type="hidden" name="formPassword" value="<% formPassword|html>" />
                                <input type="hidden" name="sone" value="<% sone.id|html>" />
                                <input type="hidden" name="returnPage" value="<% request.uri|html>" />
-                               <button type="submit"><%= View.Sone.Button.BlacklistSone|l10n|html></button>
+                               <button type="submit"><%= View.Sone.Button.UnfollowSone|l10n|html></button>
                        </form>
-                       <%ifnull ! currentSone>
-                               <form class="unfollow<%if ! sone.friend> hidden<%/if>" action="unfollowSone.html" method="post">
-                                       <input type="hidden" name="formPassword" value="<% formPassword|html>" />
-                                       <input type="hidden" name="sone" value="<% sone.id|html>" />
-                                       <input type="hidden" name="returnPage" value="<% request.uri|html>" />
-                                       <button type="submit"><%= View.Sone.Button.UnfollowSone|l10n|html></button>
-                               </form>
-                               <form class="follow<%if sone.friend> hidden<%/if>" action="followSone.html" method="post">
-                                       <input type="hidden" name="formPassword" value="<% formPassword|html>" />
-                                       <input type="hidden" name="sone" value="<% sone.id|html>" />
-                                       <input type="hidden" name="returnPage" value="<% request.uri|html>" />
-                                       <button type="submit"><%= View.Sone.Button.FollowSone|l10n|html></button>
-                               </form>
-                               <form class="unblock<%if ! sone.blocked> hidden<%/if>" action="unblockSone.html" method="post">
-                                       <input type="hidden" name="formPassword" value="<% formPassword|html>" />
-                                       <input type="hidden" name="sone" value="<% sone.id|html>" />
-                                       <input type="hidden" name="returnPage" value="<% request.uri|html>" />
-                                       <button type="submit"><%= View.Sone.Button.UnblockSone|l10n|html></button>
-                               </form>
-                               <form class="block<%if sone.blocked> hidden<%/if>" action="blockSone.html" method="post">
-                                       <input type="hidden" name="formPassword" value="<% formPassword|html>" />
-                                       <input type="hidden" name="sone" value="<% sone.id|html>" />
-                                       <input type="hidden" name="returnPage" value="<% request.uri|html>" />
-                                       <button type="submit"><%= View.Sone.Button.BlockSone|l10n|html></button>
-                               </form>
-                       <%/if>
-               <%else>
-                       <form class="unblacklist" action="unblacklistSone.html" method="post">
+                       <form class="follow<%if sone.friend> hidden<%/if>" action="followSone.html" method="post">
                                <input type="hidden" name="formPassword" value="<% formPassword|html>" />
                                <input type="hidden" name="sone" value="<% sone.id|html>" />
                                <input type="hidden" name="returnPage" value="<% request.uri|html>" />
-                               <button type="submit"><%= View.Sone.Button.UnblacklistSone|l10n|html></button>
+                               <button type="submit"><%= View.Sone.Button.FollowSone|l10n|html></button>
                        </form>
                <%/if>
        <%/if>