[CMF-checkins] CVS: CMF/CMFCollector/skins/collector - collector_contents.pt:1.8

Ken Manheimer klm@zope.com
Tue, 16 Oct 2001 18:35:32 -0400


Update of /cvs-repository/CMF/CMFCollector/skins/collector
In directory cvs.zope.org:/tmp/cvs-serv20117

Modified Files:
	collector_contents.pt 
Log Message:
 - Much nicer search form

 - Most of the attributes work

 - The form reflects the current settings

 - Fresh browse starts with just pending and accepted (and ..._confidential variants).

Still remaining:

  - Probably still some missing fields

  - Fix the search so it'll properly 'and' the consolidated Subject
    attributes (and unravel the subject to just include the relevant stuff!)

 - Restrict the fields to just those that existing issues have
   claimed.

   Not having that info from the index is a major drawback from going
   with the suggestion about using the standard DC metadata, eg
   Creator for requestor, etc.

   The likely solution is to maintain a catalog in the collector with
   indexes *only* for the fields we need to isolate, eg: status
   ("review_state"), requester ("Creator"), and supporter
   ("Reviewer").


=== CMF/CMFCollector/skins/collector/collector_contents.pt 1.7 => 1.8 ===
                  DESCRLEN python: 120;
                  b_start python: request.get('b_start', 0);
+                 searching python: (request.get('searching') != 'yep'
+                                   and (request.set('status', ['Pending', 
+                                                               'Pending_confidential',
+                                                               'Accepted',
+                                                               'Accepted_confidential'])));
                  items here/collector_search;
                  batch python: Batch(items, BATCHSIZE, int(b_start), orphan=0);
                  prev batch/previous;
@@ -82,7 +87,7 @@
               <span tal:condition="python: int(itemattrs['security_related'])">
                 <font color="red">Security</font></span>
               <em><span tal:content="python: cap(item.review_state)">
-                STATUS</span></em>
+                  STATUS</span></em>
               <span tal:replace="python: '%s/%s'
                                        % (cap(itemattrs['topic']),
                                           cap(itemattrs['classification']))">
@@ -136,55 +141,144 @@
       ISSUE-BATCH NAVIGATION
     </div>
 
-  <form action="ME" method="get"
-        tal:attributes="action python: here.absolute_url() + '/collector_contents'">
-  Fulltext Search:  <input type="text" name="SearchableText" size="40">
-  <div>
-    Requestor:  <select name="Creator:list" multiple size="5">
-                  <option value=""
-                          tal:define="items python: here.portal_catalog.uniqueValuesFor('Creator')"
-                          tal:repeat="item items"
-                          tal:attributes="value item"
-                          tal:content="item">
-                  </option>
-                </select>
-  </div>
-  <div>
-    Status:  <select name="status:list" multiple size="5">
-               <option value=""
-                       tal:define="items python: here.portal_catalog.uniqueValuesFor('review_state')"
-                       tal:repeat="item items"
-                       tal:attributes="value item"
-                       tal:content="item">
-               </option>
+    <form action="RETURNHERE" method="get"
+          tal:attributes="action python: here.absolute_url() + '/collector_contents'"
+          tal:define="uniqueValuesFor python: here.portal_catalog.uniqueValuesFor">
+      <input type="hidden" name="searching" value="yep">
+
+        <table>
+          <tr>
+            <td colspan="6" align="center">
+              <input type="Submit" value="Search">
+            </td>
+          </tr>
+          <tr>
+            <td COLSPAN="4">
+              <strong>Any text:</strong>
+              <input type="text" name="SearchableText" size="40">
+            </td>
+            <td align="center">
+              <input type="checkbox" name="security_related" value="1">
+                Security Related?
+            </td>
+          </tr>
+          <tr>
+            <th align="center"> Status </th>
+            <th align="center"> Requester</th>
+            <th align="center"> Supporter </th>
+          </tr>
+          <tr>
+            <td align="center">
+              <select name="status:list" multiple size="SIZE"
+                    tal:define="values python: uniqueValuesFor('review_state')"
+                    tal:attributes="size python: min(max(len(values), 3), 5)">
+                <span tal:repeat="status values">
+                  <option value=""
+                          tal:attributes="value status;
+                                          selected python: status
+                                                           in request.get('status', [])"
+                          tal:condition="python: status not in ['private', 'published']"
+                          tal:content="status">
+                  </option>
+                </span>
              </select>
-  </div>
-  <div>
-    Security Related:  <input type="checkbox" name="security_related" value="1">
-  </div>
-  <div>
-    Classification:  <select name="classifications:list" multiple size="5">
-                       <option value=""
-                               tal:define="items here/classifications"
-                               tal:repeat="item items"
-                               tal:attributes="value item"
-                               tal:content="item">
-                       </option>
-                     </select>
-  </div>
-  <div>
-    Severity: <select name="severities:list" multiple size="5">
-                <option value=""
-                        tal:define="items here/severities"
-                        tal:repeat="item items"
-                        tal:attributes="value item"
-                        tal:content="item">
-                </option>
+            </td>
+            <td align="center">
+              <select name="Creator:list" multiple size="SIZE"
+                      tal:define="values python: uniqueValuesFor('Creator')"
+                      tal:attributes="size python: min(max(len(values), 3), 5)">
+                <span tal:repeat="creator values">
+                  <option value=""
+                          tal:attributes="value creator;
+                                          selected python: creator
+                                                           in request.get('Creator', [])"
+                          tal:content="creator">
+                  </option>
+                </span>
+              </select>
+            </td>
+            <td align="center">
+              <select name="supporters:list" multiple size="SIZE"
+                      tal:define="values python: here.supporters"
+                      tal:attributes="size python: min(max(len(values), 3), 5)">
+                <span tal:repeat="supporter values">
+                  <option value=""
+                          tal:attributes="value supporter;
+                                          selected python: supporter 
+                                                           in request.get('supporters', [])"
+                          tal:content="supporter">
+                  </option>
+                </span>
               </select>
-  </div>
-  <div>
-    <input type="Submit" value="Search">
-  </div>
+            </td>
+          </tr>
+          <tr>
+            <th align="center"> Topic </th>
+            <th align="center"> Classification </th>
+            <th align="center"> Severity </th>
+            <th align="center"> Importance </th>
+          </tr>
+          <tr>
+            <td align="center">
+              <select name="topics:list" multiple size="SIZE"
+                    tal:define="values python: here.topics"
+                    tal:attributes="size python: min(max(len(values), 3), 5)">
+                <span tal:repeat="topic values">
+                  <option value=""
+                          tal:attributes="value topic;
+                                          selected python: topic
+                                                           in request.get('topics', [])"
+                          tal:content="topic">
+                  </option>
+                </span>
+             </select>
+            </td>
+            <td align="center">
+              <select name="classifications:list" multiple size="SIZE"
+                      tal:define="values python: here.classifications"
+                      tal:attributes="size python: min(max(len(values), 3), 5)">
+                <span tal:repeat="classification values">
+                  <option value=""
+                          tal:attributes="value classification;
+                                          selected python: classification
+                                                           in request.get('classifications',
+                                                                          [])"
+                          tal:content="classification">
+                  </option>
+                </span>
+              </select>
+            </td>
+            <td align="center">
+              <select name="importances:list" multiple size="SIZE"
+                      tal:define="values python: here.importances"
+                      tal:attributes="size python: min(max(len(values), 3), 5)">
+                <span tal:repeat="importance values">
+                  <option value=""
+                          tal:attributes="value importance;
+                                          selected python: importance
+                                                           in request.get('importances',[])"
+                          tal:content="importance">
+                  </option>
+                </span>
+             </select>
+          </td>
+            <td align="center">
+              <select name="severities:list" multiple size="SIZE"
+                      tal:define="values python: here.severities"
+                      tal:attributes="size python: min(max(len(values), 3), 5)">
+                <span tal:repeat="severity values">
+                  <option value=""
+                          tal:attributes="value severity;
+                                          selected python: severity
+                                                           in request.get('severities', [])"
+                          tal:content="severity">
+                  </option>
+                </span>
+             </select>
+          </td>
+        </tr>
+      </table>
+
 </form>
 
 </div>