]> git.decadent.org.uk Git - maypole.git/blobdiff - templates/factory/macros
Templates should be valid XHTML now...
[maypole.git] / templates / factory / macros
index edae5c1a61647b0c5dacd3a173823c3e783d5229..2442dd5d32b11bfb8b3273a3189f049127e4b9e3 100644 (file)
@@ -13,9 +13,9 @@ 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>";
+    "</a>";
 END;
 %]
 
@@ -31,7 +31,6 @@ 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);
@@ -53,7 +52,7 @@ for some.
 
 #%]
 [% MACRO display_line(item) BLOCK;
-     FOR col = classmetadata.columns;
+    FOR col = classmetadata.columns;
         NEXT IF col == "id";
         "<td>";
         IF col == "url";
@@ -64,7 +63,7 @@ for some.
             maybe_link_view(item.$col);
         END;
         "</td>";
-     END;
+    END;
     button(item, "edit");
     button(item, "delete");
 END %]
@@ -78,11 +77,11 @@ 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>
+<td>
+<form method=post action="[% base %]/[% obj.table %]/[% action %]/[% obj.id %]">
+    <input type=submit name=[% action %] value=[% action %] />
+</form>
+</td>
 [% END %]
 [%#
 
@@ -99,12 +98,12 @@ brewery) calls the accesor, and displays a list of the results.
 [% 
 MACRO view_related(object) BLOCK;
     FOR accessor = classmetadata.related_accessors.list;
-        "<H3>"; accessor | ucfirst; "</H3>\n";
-        "<UL id=\"vlist\">";
+        "<h3>"; accessor | ucfirst; "</h3>\n";
+        "<ul id=\"vlist\">";
         FOR thing = object.$accessor;
-            "<LI>"; maybe_link_view(thing); "</LI>\n";
+            "<li>"; maybe_link_view(thing); "</li>\n";
         END;
-        "</UL>";
+        "</ul>";
     END; 
 END;