]> git.decadent.org.uk Git - maypole.git/blobdiff - templates/factory/addnew
XHTML second try
[maypole.git] / templates / factory / addnew
index daacf9c42b1c18cbb025b3415f5f6290fb4efa98..9345c78b0adbc8d1fdca7d1661089f3c137e6c23 100644 (file)
@@ -1,13 +1,26 @@
-<h3>Add a new [%classmetadata.moniker%]</h3>
-<FORM METHOD="post" ACTION="[%base%]/[%classmetadata.moniker%]/do_edit/">
-    <INPUT TYPE="hidden" NAME="action" VALUE="create">
-    <INPUT TYPE="hidden" NAME="class" VALUE="[%classmetadata.name%]">
-     [% FOR col = classmetadata.columns;
-        NEXT IF col == "id";
-        "<b>";classmetadata.colnames.$col;"</b> : "; 
-    classmetadata.cgi.$col.as_HTML;
-        %]
-    <BR>
+[%#
+
+=head1 addnew
+
+This is the interface to adding a new instance of an object. (or a new
+row in the database, if you want to look at it that way) It displays a
+form containing a list of HTML components for each of the columns in the
+table.
+
+=cut
+
+#%]
+<h3>Add a new [% classmetadata.moniker %]</h3>
+<form method="post" action="[% base %]/[% classmetadata.table %]/do_edit/">
+    <input type="hidden" name="action" value="create"/>
+    <table class="view">
+    [% FOR col = classmetadata.columns %]
+        [% NEXT IF col == "id" %]
+        <tr>
+            <td>[% classmetadata.colnames.$col %]</td>
+            <td>[% classmetadata.cgi.$col.as_HTML; %]</td>
+        </tr>
     [% END; %]
-    <INPUT TYPE="submit" NAME="create" VALUE="create">
-</FORM>
+    </table>
+    <input type="submit" name="create" value="create"/>
+</form>