]> git.decadent.org.uk Git - maypole.git/commitdiff
The beginnings of search.
authorSimon Cozens <simon@simon-cozens.org>
Sat, 31 Jan 2004 15:23:41 +0000 (15:23 +0000)
committerSimon Cozens <simon@simon-cozens.org>
Sat, 31 Jan 2004 15:23:41 +0000 (15:23 +0000)
git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@30 48953598-375a-da11-a14b-00016c27c3ee

templates/beer/addnew
templates/factory/addnew
templates/factory/list
templates/factory/search_form [new file with mode: 0644]

index c3d351cb40e14543e275492ea8188135b4eea5ad..e19c7c280ec2da8fb7dccfe39392cd99bae9d7ac 100644 (file)
@@ -4,9 +4,9 @@
 <FORM METHOD="post" ACTION="[%base%]/[%classmetadata.moniker%]/do_edit/">
     <INPUT TYPE="hidden" NAME="action" VALUE="create">
     <INPUT TYPE="hidden" NAME="class" VALUE="[%classmetadata.name%]">
+    <TABLE class="view">
      [% FOR col = classmetadata.columns;
         NEXT IF col == "id";
-        "<b>";classmetadata.colnames.$col;"</b> : "; 
         SET element = classmetadata.cgi.$col;
         IF col == "brewery";
             SET create_url = base _ "/brewery/edit";
             element.attr("onChange", "go()");
             SET element = element.unshift_content(new_element);
         END;
-        element.as_HTML;
         %]
-    <BR>
+     <TR> <TD class="field"> [% classmetadata.colnames.$col; %]
+     </TD>
+          <TD> [% element.as_HTML; %] </TD> </TR>
     [% END; %]
+    </TABLE>
     <INPUT TYPE="submit" NAME="create" VALUE="create">
 </FORM>
index daacf9c42b1c18cbb025b3415f5f6290fb4efa98..f541e27b995f2a4fb680e7e93100a29b42dda5e3 100644 (file)
@@ -2,12 +2,13 @@
 <FORM METHOD="post" ACTION="[%base%]/[%classmetadata.moniker%]/do_edit/">
     <INPUT TYPE="hidden" NAME="action" VALUE="create">
     <INPUT TYPE="hidden" NAME="class" VALUE="[%classmetadata.name%]">
+    <TABLE class="view">
      [% FOR col = classmetadata.columns;
         NEXT IF col == "id";
-        "<b>";classmetadata.colnames.$col;"</b> : "; 
-    classmetadata.cgi.$col.as_HTML;
-        %]
-    <BR>
+     %]
+     <TR> <TD class="field"> [% classmetadata.colnames.$col; %] </TD>
+     <TD> [% classmetadata.cgi.$col.as_HTML; %] </TD> </TR>
     [% END; %]
+    </TABLE>
     <INPUT TYPE="submit" NAME="create" VALUE="create">
 </FORM>
index 5bd6a10f628edb0d2a39d57a7ebf28829f1786ff..efd3a95518fb09e64bde86e16fb7f5b179a569ac 100644 (file)
@@ -5,7 +5,9 @@
 <h2> Listing of all [% classmetadata.plural %]</h2>
 
 [% INCLUDE navbar %]
+<DIV class="search"> [% INCLUDE search_form %] </DIV>
 
+<DIV class="list">
 <TABLE id="matrix" WIDTH="100%">
 <TR>
 [% FOR col = classmetadata.columns.list;
@@ -24,6 +26,5 @@ FOR item = objects;
     "</tr>";
 END %]
 </TABLE>
-
-
 [% INCLUDE addnew; %]
+</DIV>
diff --git a/templates/factory/search_form b/templates/factory/search_form
new file mode 100644 (file)
index 0000000..63f867d
--- /dev/null
@@ -0,0 +1,23 @@
+
+<h3>Search</h3>
+<FORM METHOD="post" ACTION="[%base%]/[%classmetadata.moniker%]/search/">
+    <INPUT TYPE="hidden" NAME="action" VALUE="create">
+    <INPUT TYPE="hidden" NAME="class" VALUE="[%classmetadata.name%]">
+    <TABLE class="view">
+     [% FOR col = classmetadata.columns;
+        NEXT IF col == "id";
+     %]
+     <TR> <TD class="field"> [% classmetadata.colnames.$col; %] </TD>
+     <TD> [% 
+        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; 
+        %] </TD> </TR>
+    [% END; %]
+    </TABLE>
+    <INPUT TYPE="submit" NAME="search" VALUE="search">
+</FORM>