[Zope3-checkins] CVS: Products3/bugtracker/browser - tracker.py:1.3 tracker_overview.pt:1.4

Stephan Richter srichter@cosmos.phy.tufts.edu
Sun, 27 Jul 2003 11:45:55 -0400


Update of /cvs-repository/Products3/bugtracker/browser
In directory cvs.zope.org:/tmp/cvs-serv10639/browser

Modified Files:
	tracker.py tracker_overview.pt 
Log Message:
Some usability improvements based on Garrett's comments:

  - rename "Search text" to "Filter text"

  - if one of the filter selections has no selection at all, then it will
    assume that all are selected. I intended it to work like that all from
    the beginning but a couple of bugs broke that functionality.


=== Products3/bugtracker/browser/tracker.py 1.2 => 1.3 ===
--- Products3/bugtracker/browser/tracker.py:1.2	Sat Jul 26 13:52:47 2003
+++ Products3/bugtracker/browser/tracker.py	Sun Jul 27 11:45:49 2003
@@ -15,15 +15,20 @@
 
 $Id$
 """
+from zope.app.browser.container.adding import Adding
+from zope.app.interfaces.dublincore import IZopeDublinCore
+from zope.app.interfaces.index.text import ISearchableText
+from zope.app.traversing import getName
 from zope.component import getAdapter
 from zope.schema.vocabulary import getVocabularyRegistry
-from zope.app.browser.container.adding import Adding
 
-from zope.app.interfaces.dublincore import IZopeDublinCore
+
+from zopeproducts.bugtracker.browser.bug import BugBaseView
 from zopeproducts.bugtracker.interfaces import \
      IStatusVocabulary, IReleaseVocabulary
 from zopeproducts.bugtracker.interfaces import \
      IPriorityVocabulary, IBugTypeVocabulary
+from zopeproducts.bugtracker.interfaces import IComment
 
 
 class BugTrackerAdding(Adding):
@@ -118,7 +123,6 @@
         vocab = getAdapter(self.context, self.vocab_iface)
         return vocab.title
 
-from zope.app.interfaces.index.text import ISearchableText
 
 def checkBug(bug, criteria, search_text):
     for name, values in criteria:
@@ -136,10 +140,6 @@
     return True
 
 
-from bug import BugBaseView
-from zopeproducts.bugtracker.interfaces import IComment
-from zope.app.traversing import getName
-
 class BugView(BugBaseView):
 
     def __init__(self, context, request):
@@ -180,8 +180,8 @@
 
         criteria = []
         for collName, dummy1, dummy2, name in self.filter_vars:
-            raw = self.request.cookies.get(collName, "")
-            criteria.append((name, raw.split(", ")))
+            raw = self.request.cookies.get('filter_'+collName, "")
+            criteria.append((name, raw != "" and raw.split(", ") or []))
         
         formatter = self.request.locale.getDateTimeFormatter('short')
         result = []
@@ -197,8 +197,9 @@
 
     def updateSettings(self):
         for collName, dummy1, dummy2, dummy3 in self.filter_vars:
-            values = self.request.get(collName, ())
-            self.request.response.setCookie(collName, ', '.join(values))
+            values = self.request.get(collName, [])
+            self.request.response.setCookie('filter_'+collName,
+                                            ', '.join(values))
         self.setSearchText()
         return self.request.response.redirect('./overview.html')
 
@@ -206,11 +207,12 @@
         registry = getVocabularyRegistry()
         info = []
         for varname, vocname, title, dummy in self.filter_vars:
-            raw = self.request.cookies.get(varname, "")
-            info.append({'setting': raw.split(", "),
+            raw = self.request.cookies.get('filter_'+varname, "")
+            info.append({'setting': raw != "" and raw.split(", ") or [],
                          'all': iter(registry.get(self.context, vocname)),
                          'title': title,
                          'name': varname})
+        print info
         return info
             
     def getSearchText(self):


=== Products3/bugtracker/browser/tracker_overview.pt 1.3 => 1.4 ===
--- Products3/bugtracker/browser/tracker_overview.pt:1.3	Sat Jul 26 18:55:37 2003
+++ Products3/bugtracker/browser/tracker_overview.pt	Sun Jul 27 11:45:49 2003
@@ -116,7 +116,7 @@
 
         <div class="row">
           <div class="field">
-            Search Text: 
+            Filter Text: 
             <input type="text" name="search_text" value=""
                 tal:attributes="value view/getSearchText">
           </div>