]> git.decadent.org.uk Git - maypole.git/blobdiff - templates/factory/macros
fixed layout and made factory templates xhtml compliant
[maypole.git] / templates / factory / macros
index 3d45a6fa65c36bae4d5a48db84e17722b41b38d2..06f57735b99709da092c3d9a411c4185574b6393 100644 (file)
@@ -55,8 +55,8 @@ for some.
     FOR col = classmetadata.columns;
         NEXT IF col == "id";
         "<td>";
-        IF col == "url";
-            "<a href="; item.url; "> "; item.url; "</a>";
+        IF col == "url" AND item.url;
+            '<a href="'; item.url; '"> '; item.url; '</a>';
         ELSIF col == item.stringify_column;
             maybe_link_view(item);
         ELSE;
@@ -64,8 +64,10 @@ for some.
         END;
         "</td>";
     END;
+    "<td>";
     button(item, "edit");
     button(item, "delete");
+    "</td>";
 END %]
 [%#
 
@@ -77,12 +79,8 @@ This is a generic button, which performs an action on an object.
 
 #%]
 [% MACRO button(obj, action) BLOCK; %]
-<td>
-<form method="post"
-    action="[% base %]/[% obj.table %]/[% action %]/[% obj.id %]">
-    <input type="submit" name="[% action %]" value="[% action %]"/>
-</form>
-</td>
+<a class="action" href="[% base %]/[% obj.table %]/[% action %]/[% obj.id %]">
+    [% action %]</a>
 [% END %]
 [%#