X-Git-Url: https://git.decadent.org.uk/gitweb/?p=maypole.git;a=blobdiff_plain;f=examples%2Ffancy_example%2Ftemplates%2Fcustom%2Fedit;fp=examples%2Ffancy_example%2Ftemplates%2Fcustom%2Fedit;h=dae8c4280739eaaec79c9f60ef1ac1d841867726;hp=0000000000000000000000000000000000000000;hb=fadcae3ffddebaa38da172f9624cc60176d80b33;hpb=d813b3413bbd58789200c2ef02c7386e33cabe00 diff --git a/examples/fancy_example/templates/custom/edit b/examples/fancy_example/templates/custom/edit new file mode 100644 index 0000000..dae8c42 --- /dev/null +++ b/examples/fancy_example/templates/custom/edit @@ -0,0 +1,72 @@ +[%# + +=head1 edit + +This is the edit page. It edits the passed-in object, by displaying a +form similar to L but with the current values filled in. + +=cut + +#%] +[% PROCESS macros %] +[% INCLUDE header %] +[% INCLUDE title %] + +[% IF request.action == 'edit' %] +[% INCLUDE navbar %] +[% END %] + +[% IF objects.size %] +
Edit a [% classmetadata.moniker %]
+[% FOR item = objects; %] +
+
+Edit [% item.name %] +[% FOR col = classmetadata.columns; + NEXT IF col == "id" OR col == classmetadata.table _ "_id"; + '"; + IF errors.$col; + ''; errors.$col;''; + END; + END %] + + +
+ + [% END %] +[% ELSE %] + +
+
+
+Add a new [% classmetadata.moniker %] + [% FOR col = classmetadata.columns %] + [% NEXT IF col == "id" %] + + [% IF errors.$col %] + [% errors.$col | html %] + [% END %] + + [% END; %] + + +
+
+
+ +[% END %] +[% INCLUDE footer %]