Only show block/unblock buttons if the user is logged in.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 18 Oct 2010 18:38:29 +0000 (20:38 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 18 Oct 2010 18:38:29 +0000 (20:38 +0200)
src/main/resources/templates/knownSones.html

index a0b270a..9cf616c 100644 (file)
@@ -7,18 +7,20 @@
                        <div>
                                <div class="profile-link"><a href="viewSone.html?sone=<% sone.id>"><% sone.niceName|html></a></div>
                                <div>(<% sone.requestUri|html>)</div>
-                               <%if sone.isBlocked>
-                                       <form class="unblock" action="unblockSone.html" method="post">
-                                               <input type="hidden" name="formPassword" value="<% formPassword|html>" />
-                                               <input type="hidden" name="sone" value="<% sone.id>" />
-                                               <button type="submit"><%= View.Sone.Button.UnblockSone|l10n|html></button>
-                                       </form>
-                               <%else>
-                                       <form class="block" action="blockSone.html" method="post">
-                                               <input type="hidden" name="formPassword" value="<% formPassword|html>" />
-                                               <input type="hidden" name="sone" value="<% sone.id>" />
-                                               <button type="submit"><%= View.Sone.Button.BlockSone|l10n|html></button>
-                                       </form>
+                               <%ifnull ! currentSone>
+                                       <%if sone.isBlocked>
+                                               <form class="unblock" action="unblockSone.html" method="post">
+                                                       <input type="hidden" name="formPassword" value="<% formPassword|html>" />
+                                                       <input type="hidden" name="sone" value="<% sone.id>" />
+                                                       <button type="submit"><%= View.Sone.Button.UnblockSone|l10n|html></button>
+                                               </form>
+                                       <%else>
+                                               <form class="block" action="blockSone.html" method="post">
+                                                       <input type="hidden" name="formPassword" value="<% formPassword|html>" />
+                                                       <input type="hidden" name="sone" value="<% sone.id>" />
+                                                       <button type="submit"><%= View.Sone.Button.BlockSone|l10n|html></button>
+                                               </form>
+                                       <%/if>
                                <%/if>
                        </div>
                <%foreachelse>