Only show “save profile” button after fields if there are any fields.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 14 Jan 2011 12:01:59 +0000 (13:01 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 14 Jan 2011 12:01:59 +0000 (13:01 +0100)
src/main/resources/templates/editProfile.html

index ecdf2a7..cac92a1 100644 (file)
                                <div class="<%if fieldLoop.first>hidden <%/if>move-up-field"><button type="submit" name="move-up-field-<% fieldLoop.count>" value="true"><%= Page.EditProfile.Fields.Button.MoveUp|l10n|html></button></div>
                                <div class="value"><input type="text" name="field-<% fieldLoop.count>" value="<% field.value|html>" /></div>
                        </div>
-               <%/foreach>
 
-               <div>
-                       <button type="submit" name="save-profile" value="true"><%= Page.EditProfile.Button.Save|l10n|html></button>
-               </div>
+                       <%if fieldLoop.last>
+                               <div>
+                                       <button type="submit" name="save-profile" value="true"><%= Page.EditProfile.Button.Save|l10n|html></button>
+                               </div>
+                       <%/if>
+               <%/foreach>
 
        </form>