]> git.decadent.org.uk Git - maypole.git/blobdiff - templates/factory/addnew
2.09 - maintain the order that plugins are loaded, add tests for Maypole::Application...
[maypole.git] / templates / factory / addnew
index a6027ce2de4ddbd71731f0886526cfa6bd1ac7ca..142dde6909e2cfbd7327e2c2a4c6009763e83b5c 100644 (file)
@@ -18,8 +18,21 @@ table.
     [% FOR col = classmetadata.columns %]
         [% NEXT IF col == "id" %]
             <label><span class="field">[% classmetadata.colnames.$col %]</span>
-            [% classmetadata.cgi.$col.as_XML; %]
+            [% 
+            SET elem = classmetadata.cgi.$col.clone;
+            IF request.action == 'do_edit';
+                IF elem.tag == "textarea";
+                    elem = elem.push_content(request.param(col));
+                ELSE;
+                    elem.attr("value", request.param(col));
+                END;
+            END;
+            elem.as_XML; %]
            </label>
+        [% IF errors.$col %]
+           <span class="error">[% errors.$col %]</span>
+        [% END %]
+
     [% END; %]
     <input type="submit" name="create" value="create"/>
 </fieldset>