Only show follow and unfollow buttons if there are Sones on the page.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 20 Nov 2011 10:10:21 +0000 (11:10 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 20 Nov 2011 10:10:21 +0000 (11:10 +0100)
src/main/resources/templates/knownSones.html

index b25b11c..afd40df 100644 (file)
                </form>
        </div>
 
-       <div>
-               <form action="followSone.html" method="post">
-                       <input type="hidden" name="formPassword" value="<%formPassword|html>" />
-                       <input type="hidden" name="returnPage" value="<%request.uri|html>" />
-                       <input type="hidden" name="sone" value="<%foreach pagination.items sone><%if !sone.friend><%if !sone.current><%sone.id> <%/if><%/if><%/foreach>" />
-                       <button type="submit"><%= Page.KnownSones.Button.FollowAllSones|l10n|html></button>
-               </form>
-       </div>
+       <%if !pagination.items.empty>
+               <div>
+                       <form action="followSone.html" method="post">
+                               <input type="hidden" name="formPassword" value="<%formPassword|html>" />
+                               <input type="hidden" name="returnPage" value="<%request.uri|html>" />
+                               <input type="hidden" name="sone" value="<%foreach pagination.items sone><%if !sone.friend><%if !sone.current><%sone.id> <%/if><%/if><%/foreach>" />
+                               <button type="submit"><%= Page.KnownSones.Button.FollowAllSones|l10n|html></button>
+                       </form>
+               </div>
 
-       <div>
-               <form action="unfollowSone.html" method="post">
-                       <input type="hidden" name="formPassword" value="<%formPassword|html>" />
-                       <input type="hidden" name="returnPage" value="<%request.uri|html>" />
-                       <input type="hidden" name="sone" value="<%foreach pagination.items sone><%if sone.friend><%sone.id> <%/if><%/foreach>" />
-                       <button type="submit"><%= Page.KnownSones.Button.UnfollowAllSones|l10n|html></button>
-               </form>
-       </div>
+               <div>
+                       <form action="unfollowSone.html" method="post">
+                               <input type="hidden" name="formPassword" value="<%formPassword|html>" />
+                               <input type="hidden" name="returnPage" value="<%request.uri|html>" />
+                               <input type="hidden" name="sone" value="<%foreach pagination.items sone><%if sone.friend><%sone.id> <%/if><%/foreach>" />
+                               <button type="submit"><%= Page.KnownSones.Button.UnfollowAllSones|l10n|html></button>
+                       </form>
+               </div>
+       <%/if>
 
        <div id="known-sones">
                <%= page|store key=pageParameter>