From: Simon Cozens Date: Sat, 31 Jan 2004 15:23:41 +0000 (+0000) Subject: The beginnings of search. X-Git-Tag: 2.10~332 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=77137f7d4d6b7768b9c64eb1e893ac90083cfd63;p=maypole.git The beginnings of search. git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@30 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/templates/beer/addnew b/templates/beer/addnew index c3d351c..e19c7c2 100644 --- a/templates/beer/addnew +++ b/templates/beer/addnew @@ -4,9 +4,9 @@
+ [% FOR col = classmetadata.columns; NEXT IF col == "id"; - "";classmetadata.colnames.$col;" : "; SET element = classmetadata.cgi.$col; IF col == "brewery"; SET create_url = base _ "/brewery/edit"; @@ -21,9 +21,11 @@ element.attr("onChange", "go()"); SET element = element.unshift_content(new_element); END; - element.as_HTML; %] -
+ + [% END; %] +
[% classmetadata.colnames.$col; %] + [% element.as_HTML; %]
diff --git a/templates/factory/addnew b/templates/factory/addnew index daacf9c..f541e27 100644 --- a/templates/factory/addnew +++ b/templates/factory/addnew @@ -2,12 +2,13 @@
+ [% FOR col = classmetadata.columns; NEXT IF col == "id"; - "";classmetadata.colnames.$col;" : "; - classmetadata.cgi.$col.as_HTML; - %] -
+ %] + + [% END; %] +
[% classmetadata.colnames.$col; %] [% classmetadata.cgi.$col.as_HTML; %]
diff --git a/templates/factory/list b/templates/factory/list index 5bd6a10..efd3a95 100644 --- a/templates/factory/list +++ b/templates/factory/list @@ -5,7 +5,9 @@

Listing of all [% classmetadata.plural %]

[% INCLUDE navbar %] + +
[% FOR col = classmetadata.columns.list; @@ -24,6 +26,5 @@ FOR item = objects; ""; END %]
- - [% INCLUDE addnew; %] +
diff --git a/templates/factory/search_form b/templates/factory/search_form new file mode 100644 index 0000000..63f867d --- /dev/null +++ b/templates/factory/search_form @@ -0,0 +1,23 @@ + +

Search

+
+ + + + [% FOR col = classmetadata.columns; + NEXT IF col == "id"; + %] + + + [% END; %] +
[% classmetadata.colnames.$col; %] [% + SET element = classmetadata.cgi.$col; + IF element.tag == "select"; + USE element_maker = Class("HTML::Element"); + SET element = element.unshift_content( + element_maker.new("option", value," ")); + END; + element.as_HTML; + %]
+ +