]> git.decadent.org.uk Git - maypole.git/blobdiff - templates/factory/macros
Fix to check that a has_a points to another Model object.
[maypole.git] / templates / factory / macros
index ddd9ffbb10f47cfdb1dd945f9c62dc5f8c843c03..4a90e1771f4f1ae9e2c60cb20a2ee009dfaca165 100644 (file)
@@ -34,8 +34,8 @@ command for that object. Otherwise, it just displays the data.
 
 [%
 MACRO maybe_link_view(object) BLOCK;
-    IF object.table; # It's an object, i.e. a has-a
-        link(object.table, "view", object.id, object);
+    IF object.isa('Maypole::Model::Base');
+        link(object.table, "view", object.id.join('/'), object);
     ELSE;
         object;
     END;
@@ -81,8 +81,8 @@ This is a generic button, which performs an action on an object.
 
 #%]
 [% MACRO button(obj, action) BLOCK; %]
-<form class="actionform" action="[% base %]/[% obj.table %]/[% action %]/[% obj.id %]" method=POST>
-    <input id="actionbutton" type="submit" value="[% action %]" /></form>
+<form class="actionform" action="[% base %]/[% obj.table %]/[% action %]/[% obj.id.join('/') %]" method="post">
+<div class="field"><input class="actionbutton" type="submit" value="[% action %]" /></div></form>
 [% END %]
 [%#