]> git.decadent.org.uk Git - maypole.git/blobdiff - templates/factory/macros
Needed for Apache2, apparently.
[maypole.git] / templates / factory / macros
index 7e3284c3861196d45be137e0e57b1765ef9a40a3..edae5c1a61647b0c5dacd3a173823c3e783d5229 100644 (file)
@@ -13,7 +13,7 @@ catenating the base URL, table, command, and any arguments.
 #%]
 [%
 MACRO link(table, command, additional, label) BLOCK;
-    '<A HREF="' _ base _ table _ "/" _ command _ "/" _ additional _ '">';
+    '<A HREF="' _ base _ "/" _ table _ "/" _ command _ "/" _ additional _ '">';
     label;
     "</A>";
 END;
@@ -31,9 +31,10 @@ command for that object. Otherwise, it just displays the data.
 #%]
 
 [%
+
 MACRO maybe_link_view(object) BLOCK;
-    IF object.moniker; # It's an object, i.e. a has-a
-        link(object.moniker, "view", object.id, object);
+    IF object.table; # It's an object, i.e. a has-a
+        link(object.table, "view", object.id, object);
     ELSE;
         object;
     END;
@@ -57,7 +58,7 @@ for some.
         "<td>";
         IF col == "url";
             "<A HREF="; item.url; "> "; item.url; "</A>";
-        ELSIF col == "name";
+        ELSIF col == item.stringify_column;
             maybe_link_view(item);
         ELSE;
             maybe_link_view(item.$col);
@@ -78,7 +79,7 @@ This is a generic button, which performs an action on an object.
 #%]
 [% MACRO button(obj, action) BLOCK; %]
 <TD>
-<FORM METHOD="post" ACTION="[%base%]/[%obj.moniker%]/[%action%]/[%obj.id%]">
+<FORM METHOD="post" ACTION="[%base%]/[%obj.table%]/[%action%]/[%obj.id%]">
     <INPUT TYPE="submit" NAME="[%action%]" VALUE="[%action%]">
 </FORM>
 </TD>