X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=ex%2Ffancy_example%2Ftemplates%2Fcustom%2Fdisplay_inputs;fp=ex%2Ffancy_example%2Ftemplates%2Fcustom%2Fdisplay_inputs;h=0000000000000000000000000000000000000000;hb=79aa8d27d124d06bf88b2fc0487ae97563b98936;hp=6baf703c7acb546588fba45696575704c3075bc2;hpb=1c8db728a3fb5adb4f0ea876ea1316457700edf8;p=maypole.git diff --git a/ex/fancy_example/templates/custom/display_inputs b/ex/fancy_example/templates/custom/display_inputs deleted file mode 100644 index 6baf703..0000000 --- a/ex/fancy_example/templates/custom/display_inputs +++ /dev/null @@ -1,114 +0,0 @@ -[%# - -=head1 display_inputs - -This *RECURSIVELY* displays inputs for a hash of html elements - -Vars it needs: - classmetadata-- the hash of bunch of data: - cgi -- inputs keyed on column names - table -- table inputs are for - columns -- list in order want displayed inputs - colnames -- hash of what to label inputs - -errors -- hash of errors keyed on columns - - -TODO -- make it recognize a general submit button for redisplaying -values on errors - -=cut - -# -%] - -[% # some variables - foreign = []; - names = []; - # get hash of related classes keyed on accessor for Foreign Inputs - USE this = Class(classmetadata.name); - tbl = classmetadata.table; - required = { }; - FOR c IN request.config.$tbl.required_cols; - required.$c = 1; - END; - -%] - -[% -SET heading_shown = 0; -FOR col = classmetadata.columns; - NEXT IF !classmetadata.cgi.$col; - NEXT IF col == "id" OR col == classmetadata.table _ "_id"; - # Display foreign inputs last - IF (mykeys = classmetadata.cgi.$col.keys); - foreign.push(col); - names.push(classmetadata.colnames.$col); - NEXT; - END; - IF ! heading_shown; - heading = classmetadata.moniker | ucfirst; - "