]> git.decadent.org.uk Git - maypole.git/blobdiff - ex/fancy_example/templates/custom/edit
Merge commit '2.13' into HEAD
[maypole.git] / ex / fancy_example / templates / custom / edit
diff --git a/ex/fancy_example/templates/custom/edit b/ex/fancy_example/templates/custom/edit
deleted file mode 100644 (file)
index dae8c42..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-[%#
-
-=head1 edit
-
-This is the edit page. It edits the passed-in object, by displaying a
-form similar to L<addnew> but with the current values filled in.
-
-=cut
-
-#%]
-[% PROCESS macros %]
-[% INCLUDE header %]
-[% INCLUDE title %]
-
-[% IF request.action == 'edit' %]
-[% INCLUDE navbar %]
-[% END %]
-
-[% IF objects.size %]
-<div id="title">Edit a [% classmetadata.moniker %]</div>
-[% FOR item = objects; %]
-<form action="[% base %]/[% item.table %]/do_edit/[% item.id %]" method="post">
-<fieldset>
-<legend>Edit [% item.name %]</legend>
-[% FOR col = classmetadata.columns;
-    NEXT IF col == "id" OR col == classmetadata.table _ "_id";
-    '<label><span class="field">';
-    classmetadata.colnames.$col || col | ucfirst | replace('_',' '); ":</span>";
-    item.to_field(col).as_XML;
-    "</label>";
-    IF errors.$col; 
-       '<span class="error">'; errors.$col;'</span>';
-    END;
-    END %]
-    <input type="submit" name="edit" value="edit"/>
-    <input type="hidden" name="__form_id" value="[% request.make_random_id %]">
-    </fieldset></form>
-    
-    [% END %]
-[% ELSE %]
-
-<div id="addnew">
-<form method="post" action="[% base %]/[% classmetadata.table %]/do_edit/">
-<fieldset>
-<legend>Add a new [% classmetadata.moniker %]</legend>
-    [% FOR col = classmetadata.columns %]
-        [% NEXT IF col == "id" %]
-            <label><span class="field">[% classmetadata.colnames.$col %]</span>
-            [% 
-            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 | html  %]</span>
-        [% END %]
-
-    [% END; %]
-    <input type="submit" name="create" value="create" />
-    <input type="hidden" name="__form_id" value="[% request.make_random_id %]" />
-</fieldset>
-</form>
-</div>
-
-[% END %]
-[% INCLUDE footer %]