r945 - in /schooltool/trunk: ./ debian/ schooltool-skel/etc/ src/schooltool.egg-info/ src/schooltool/ src/schooltool/app/ src/schooltool/app/browser/ src/schooltool/app/browser/ftests/ src/schooltool/app/browser/templates/ src/schooltool/app/browser/tests/ src/schooltool/app/rest/ftests/ src/schooltool/app/tests/ src/schooltool/attendance/browser/ftests/ src/schooltool/basicperson/ src/schooltool/basicperson/browser/ftests/ src/schooltool/basicperson/tests/ src/schooltool/commendation/ src/schooltool/course/ src/schooltool/course/browser/ src/schooltool/course/browser/templates/ src/schooltool/course/tests/ src/schooltool/generations/ src/schooltool/gradebook/browser/ src/schooltool/person/browser/ src/schooltool/resource/browser/ src/schooltool/restclient/ftests/ src/schooltool/securitypolicy/ src/schooltool/securitypolicy/browser/ftests/ src/schooltool/securitypolicy/tests/ src/schooltool/skin/ src/schooltool/skin/resources/ src/schooltool/table/ src/schooltool/table/templates/ src/schooltool/table/tests/ src/schooltool/term/browser/ftests/ src/schooltool/testing/ src/schooltool/timetable/browser/ftests/ src/schooltool/timetable/browser/tests/

jinty-guest at users.alioth.debian.org jinty-guest at users.alioth.debian.org
Sat Jul 14 16:06:25 UTC 2007


Author: jinty-guest
Date: Sat Jul 14 16:06:24 2007
New Revision: 945

URL: http://svn.debian.org/wsvn/pkg-zope/?sc=1&rev=945
Log:
Finally, a new schooltool upstream release.

Added:
    schooltool/trunk/src/schooltool/app/ftesting.zcml
      - copied unchanged from r944, schooltool/branches/upstream/current/src/schooltool/app/ftesting.zcml
    schooltool/trunk/src/schooltool/app/testing.py
      - copied unchanged from r944, schooltool/branches/upstream/current/src/schooltool/app/testing.py
    schooltool/trunk/src/schooltool/skin/resources/downarrow.png
      - copied unchanged from r944, schooltool/branches/upstream/current/src/schooltool/skin/resources/downarrow.png
    schooltool/trunk/src/schooltool/skin/resources/rightarrow.png
      - copied unchanged from r944, schooltool/branches/upstream/current/src/schooltool/skin/resources/rightarrow.png
Removed:
    schooltool/trunk/schooltool-skel/etc/ftesting.zcml
    schooltool/trunk/setup.cfg
Modified:
    schooltool/trunk/PKG-INFO
    schooltool/trunk/debian/changelog
    schooltool/trunk/setup.py
    schooltool/trunk/src/schooltool.egg-info/PKG-INFO
    schooltool/trunk/src/schooltool.egg-info/SOURCES.txt
    schooltool/trunk/src/schooltool/app/browser/cal.py
    schooltool/trunk/src/schooltool/app/browser/ftests/app.txt
    schooltool/trunk/src/schooltool/app/browser/ftests/composite-timetables.txt
    schooltool/trunk/src/schooltool/app/browser/ftests/personinstructor.txt
    schooltool/trunk/src/schooltool/app/browser/ftests/schedule-single-student.txt
    schooltool/trunk/src/schooltool/app/browser/ftests/section-booking.txt
    schooltool/trunk/src/schooltool/app/browser/ftests/setup.py
    schooltool/trunk/src/schooltool/app/browser/ftests/test_all.py
    schooltool/trunk/src/schooltool/app/browser/templates/edit_relationships.pt
    schooltool/trunk/src/schooltool/app/browser/tests/test_cal.py
    schooltool/trunk/src/schooltool/app/rest/ftests/test_all.py
    schooltool/trunk/src/schooltool/app/tests/test_main.py
    schooltool/trunk/src/schooltool/attendance/browser/ftests/attendance-forms.txt
    schooltool/trunk/src/schooltool/attendance/browser/ftests/student-attendance.txt
    schooltool/trunk/src/schooltool/basicperson/browser/ftests/basicperson.txt
    schooltool/trunk/src/schooltool/basicperson/ftesting.zcml
    schooltool/trunk/src/schooltool/basicperson/person.py
    schooltool/trunk/src/schooltool/basicperson/tests/test_person.py
    schooltool/trunk/src/schooltool/commendation/SystemIntegration.txt
    schooltool/trunk/src/schooltool/course/browser/configure.zcml
    schooltool/trunk/src/schooltool/course/browser/course.py
    schooltool/trunk/src/schooltool/course/browser/section.py
    schooltool/trunk/src/schooltool/course/browser/templates/course_container.pt
    schooltool/trunk/src/schooltool/course/browser/templates/section_add.pt
    schooltool/trunk/src/schooltool/course/browser/tests.py
    schooltool/trunk/src/schooltool/course/interfaces.py
    schooltool/trunk/src/schooltool/course/section.py
    schooltool/trunk/src/schooltool/course/tests/test_course.py
    schooltool/trunk/src/schooltool/generations/evolve4.py
    schooltool/trunk/src/schooltool/gradebook/browser/README.txt
    schooltool/trunk/src/schooltool/person/browser/ftests.py
    schooltool/trunk/src/schooltool/resource/browser/ftests.py
    schooltool/trunk/src/schooltool/restclient/ftests/test_restclient.py
    schooltool/trunk/src/schooltool/securitypolicy/browser/ftests/helpers.py
    schooltool/trunk/src/schooltool/securitypolicy/browser/ftests/policy_table.txt
    schooltool/trunk/src/schooltool/securitypolicy/policy.py
    schooltool/trunk/src/schooltool/securitypolicy/tests/test_policy.py
    schooltool/trunk/src/schooltool/skin/configure.zcml
    schooltool/trunk/src/schooltool/skin/resources/layout.css
    schooltool/trunk/src/schooltool/table/table.py
    schooltool/trunk/src/schooltool/table/templates/batch.pt
    schooltool/trunk/src/schooltool/table/tests/test_table.py
    schooltool/trunk/src/schooltool/term/browser/ftests/term.txt
    schooltool/trunk/src/schooltool/testing/functional.py
    schooltool/trunk/src/schooltool/timetable/browser/ftests/timetable-events.txt
    schooltool/trunk/src/schooltool/timetable/browser/ftests/timetabling.txt
    schooltool/trunk/src/schooltool/timetable/browser/tests/test_timetable.py
    schooltool/trunk/src/schooltool/version.txt

Modified: schooltool/trunk/PKG-INFO
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/PKG-INFO?rev=945&op=diff
==============================================================================
--- schooltool/trunk/PKG-INFO (original)
+++ schooltool/trunk/PKG-INFO Sat Jul 14 16:06:24 2007
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: schooltool
-Version: 2006.999-2007-alpha1-svn-r7057
+Version: 2007.0.alpha2
 Summary: A common information systems platform for school administration.
 Home-page: http://www.schooltool.org
 Author: SchoolTool development team

Modified: schooltool/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/debian/changelog?rev=945&op=diff
==============================================================================
--- schooltool/trunk/debian/changelog (original)
+++ schooltool/trunk/debian/changelog Sat Jul 14 16:06:24 2007
@@ -1,3 +1,9 @@
+schooltool (2007.0.alpha2-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Brian Sutherland <brian at vanguardistas.net>  Sat, 14 Jul 2007 15:28:06 +0200
+
 schooltool (2006.999-2007-alpha1-svn-r7057-2) UNRELEASED; urgency=low
 
   * NOT RELEASED YET

Modified: schooltool/trunk/setup.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/setup.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/setup.py (original)
+++ schooltool/trunk/setup.py Sat Jul 14 16:06:24 2007
@@ -68,6 +68,7 @@
                  'schooltool.resource',
                  'schooltool.relationship',
                  'schooltool.securitypolicy',
+                 'schooltool.setupdata',
                  'schooltool.skin',
                  'schooltool.table',
                  'schooltool.term',
@@ -179,13 +180,13 @@
                       'zope.app.file',
                       'zope.app.onlinehelp',
                       'zope.app.apidoc',
-	              'z3c.breadcrumb',
-	              'z3c.layer',
+                      'z3c.breadcrumb',
+                      'z3c.layer',
                       'z3c.menu',
                       'z3c.optionstorage',
-	              'z3c.pagelet',
-	              'z3c.template',
-	              'z3c.viewlet',
+                      'z3c.pagelet',
+                      'z3c.template',
+                      'z3c.viewlet',
                       'zope.wfmc',
                       'zope.app.wfmc',
                       'zope.server',

Modified: schooltool/trunk/src/schooltool.egg-info/PKG-INFO
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool.egg-info/PKG-INFO?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool.egg-info/PKG-INFO (original)
+++ schooltool/trunk/src/schooltool.egg-info/PKG-INFO Sat Jul 14 16:06:24 2007
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: schooltool
-Version: 2006.999-2007-alpha1-svn-r7057
+Version: 2007.0.alpha2
 Summary: A common information systems platform for school administration.
 Home-page: http://www.schooltool.org
 Author: SchoolTool development team

Modified: schooltool/trunk/src/schooltool.egg-info/SOURCES.txt
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool.egg-info/SOURCES.txt?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool.egg-info/SOURCES.txt (original)
+++ schooltool/trunk/src/schooltool.egg-info/SOURCES.txt Sat Jul 14 16:06:24 2007
@@ -5,7 +5,6 @@
 i18nextract.py
 schooltool-server.py
 schooltool.conf.in
-setup.cfg
 setup.py
 test.py
 benchmark/acl.py
@@ -27,7 +26,6 @@
 images/schooltool_zebra.xcf
 schooltool-skel/bin/schooltool.in
 schooltool-skel/bin/test.in
-schooltool-skel/etc/ftesting.zcml
 schooltool-skel/etc/schooltool.conf.in
 schooltool-skel/etc/site.zcml
 schooltool-skel/log/README.txt
@@ -70,6 +68,7 @@
 src/schooltool/app/cal.py
 src/schooltool/app/config-schema.xml
 src/schooltool/app/configure.zcml
+src/schooltool/app/ftesting.zcml
 src/schooltool/app/interfaces.py
 src/schooltool/app/main.py
 src/schooltool/app/membership.py
@@ -78,6 +77,7 @@
 src/schooltool/app/security.py
 src/schooltool/app/security.txt
 src/schooltool/app/security.zcml
+src/schooltool/app/testing.py
 src/schooltool/app/browser/__init__.py
 src/schooltool/app/browser/app.py
 src/schooltool/app/browser/cal.py
@@ -878,6 +878,7 @@
 src/schooltool/skin/meta.zcml
 src/schooltool/skin/skin.py
 src/schooltool/skin/resources/delete.png
+src/schooltool/skin/resources/downarrow.png
 src/schooltool/skin/resources/editor_config.js
 src/schooltool/skin/resources/favicon.ico
 src/schooltool/skin/resources/icon.png
@@ -896,6 +897,7 @@
 src/schooltool/skin/resources/private-note-body-r.gif
 src/schooltool/skin/resources/private-note-head-l.gif
 src/schooltool/skin/resources/private-note-head-r.gif
+src/schooltool/skin/resources/rightarrow.png
 src/schooltool/skin/resources/schooltool.css
 src/schooltool/skin/resources/schooltool.js
 src/schooltool/skin/resources/schooltool.png

Modified: schooltool/trunk/src/schooltool/app/browser/cal.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/app/browser/cal.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/app/browser/cal.py (original)
+++ schooltool/trunk/src/schooltool/app/browser/cal.py Sat Jul 14 16:06:24 2007
@@ -19,7 +19,7 @@
 """
 SchoolTool application views.
 
-$Id: cal.py 6967 2007-06-04 15:01:11Z ignas $
+$Id: cal.py 7068 2007-07-14 08:57:53Z pcardune $
 """
 
 import urllib
@@ -1500,7 +1500,7 @@
         # The unproxied object will only be used for annotations.
         person = removeSecurityProxy(person)
         annotations = IAnnotations(person)
-        return annotations.get(self.SHOW_TIMETABLE_KEY, True)
+        return annotations.get(self.SHOW_TIMETABLE_KEY, False)
 
 
 class CalendarListSubscriber(object):
@@ -1539,7 +1539,7 @@
         # personal timetable
         unproxied_person = removeSecurityProxy(user) # for annotations
         annotations = IAnnotations(unproxied_person)
-        if annotations.get(CalendarSTOverlayView.SHOW_TIMETABLE_KEY, True):
+        if annotations.get(CalendarSTOverlayView.SHOW_TIMETABLE_KEY, False):
             yield (ttcalendar, '#9db8d2', '#7590ae')
             # Maybe we should change the colour to differ from the user's
             # personal calendar?

Modified: schooltool/trunk/src/schooltool/app/browser/ftests/app.txt
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/app/browser/ftests/app.txt?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/app/browser/ftests/app.txt (original)
+++ schooltool/trunk/src/schooltool/app/browser/ftests/app.txt Sat Jul 14 16:06:24 2007
@@ -123,29 +123,16 @@
 
 Lets create a section to add to that course:
 
-    >>> manager.getLink('New Section').click()
-    >>> manager.getControl('Code').value = 'HIS1'
-    >>> manager.getControl('Description').value = 'Section1'
-    >>> manager.getControl('Add').click()
-
-Notice we got redirected to the course we added the section to.
-
+    >>> from schooltool.app.browser.ftests import setup
+    >>> setup.addSection('History')
+
+Looking at the section:
+
+    >>> manager.reload()
+    >>> manager.getLink('(1)').click()
     >>> print manager.contents
     <!DOCTYPE ...>
     ...
-    ...History...
-    ...
-    ...<h3>Sections</h3>
-    ...
-    ...<p>Section1</p>
-    ...
-
-Looking at the section:
-
-    >>> manager.getLink('(HIS1)').click()
-    >>> print manager.contents
-    <!DOCTYPE ...>
-    ...
     ...Section of
     <BLANKLINE>
           <a href="http://localhost/courses/history">History</a>
@@ -154,7 +141,7 @@
 
 Frog can't see the section's calendar by default
 
-    >>> frog.open('http://localhost/sections/his1/calendar')
+    >>> frog.open('http://localhost/sections/1/calendar')
     >>> print frog.url
     http://localhost/@@login.html?forbidden=yes&nexturl=...
 
@@ -174,7 +161,7 @@
             <th></th>
             <th></th>
           </tr><tr style="background: #9db8d2"><td><input type="checkbox" checked disabled></td>
-            <td><input type="checkbox" name="my_timetable" checked></td>
+            <td><input type="checkbox" name="my_timetable"></td>
             <td style="width: 100%">My Calendar</td>
             <td></td>
           </tr><tr style="background: #e0b6af"><td><input type="checkbox" name="overlay:list" checked value="/"></td>
@@ -202,7 +189,7 @@
             <th></th>
             <th></th>
           </tr><tr style="background: #9db8d2"><td><input type="checkbox" checked disabled></td>
-            <td><input type="checkbox" name="my_timetable" checked></td>
+            <td><input type="checkbox" name="my_timetable"></td>
             <td style="width: 100%">My Calendar</td>
             <td></td>
           </tr><tr style="background: #e0b6af"><td><input type="checkbox" name="overlay:list" checked value="/"></td>
@@ -221,16 +208,16 @@
     >>> print manager.contents
     <BLANKLINE>
     ...
+      <legend>Available Instructors</legend>
+    ...
       <legend>Current Instructors</legend>
     ...
          <label for="remove_item.frog">Frog</label>
     ...
-      <legend>Available Instructors</legend>
-    ...
 
 Now Frog is in the Instructors div
 
-    >>> manager.getControl('Cancel').click()
+    >>> manager.getControl('OK').click()
     >>> print manager.contents
     <!DOCTYPE ...>
     ...
@@ -259,8 +246,8 @@
 
 Frog can see the calendar now
 
-    >>> frog.open('http://localhost/sections/his1/calendar')
-    >>> 'Calendar for HIS1' in frog.contents
+    >>> frog.open('http://localhost/sections/1/calendar')
+    >>> 'Calendar for History (1)' in frog.contents
     True
 
 And Frog's overlay portlet shows the section:
@@ -274,14 +261,14 @@
             <th></th>
             <th></th>
           </tr><tr style="background: #9db8d2"><td><input type="checkbox" checked disabled></td>
-            <td><input type="checkbox" name="my_timetable" checked></td>
+            <td><input type="checkbox" name="my_timetable"></td>
             <td style="width: 100%">My Calendar</td>
             <td></td>
-          </tr><tr style="background: #eed680"><td><input type="checkbox" name="overlay:list" checked value="/sections/his1"></td>
-            <td><input type="checkbox" name="overlay_timetables:list" value="/sections/his1"></td>
-            <td style="width: 100%">Frog -- History</td>
+          </tr><tr style="background: #eed680"><td><input type="checkbox" name="overlay:list" checked value="/sections/1"></td>
+            <td><input type="checkbox" name="overlay_timetables:list" value="/sections/1"></td>
+            <td style="width: 100%">Frog -- History (1)</td>
             <td><a class="go" style="background: #d1940c;
-                color: #d1940c" href="http://localhost/sections/his1/calendar">...</a></td>
+                color: #d1940c" href="http://localhost/sections/1/calendar">...</a></td>
         </tr><tr style="background: #e0b6af"><td><input type="checkbox" name="overlay:list" checked value="/"></td>
             <td><input type="checkbox" name="overlay_timetables:list" checked value="/"></td>
             <td style="width: 100%">SchoolTool</td>
@@ -297,13 +284,13 @@
 
 Frog can't see the section's calendar any more
 
-    >>> frog.open('http://localhost/sections/his1/calendar')
+    >>> frog.open('http://localhost/sections/1/calendar')
     >>> print frog.url
     http://localhost/@@login.html?forbidden=yes&nexturl=...
 
 and he's no longer an instructor:
 
-    >>> manager.getControl('Cancel').click()
+    >>> manager.getControl('OK').click()
     >>> print manager.contents
     <!DOCTYPE ...>
     ...
@@ -323,7 +310,7 @@
             <th></th>
             <th></th>
           </tr><tr style="background: #9db8d2"><td><input type="checkbox" checked disabled></td>
-            <td><input type="checkbox" name="my_timetable" checked></td>
+            <td><input type="checkbox" name="my_timetable"></td>
             <td style="width: 100%">My Calendar</td>
             <td></td>
           </tr><tr style="background: #e0b6af"><td><input type="checkbox" name="overlay:list" checked value="/"></td>
@@ -338,7 +325,7 @@
     >>> manager.getLink('edit individuals').click()
     >>> manager.getControl(name='add_item.toad').value = True
     >>> manager.getControl('Add').click()
-    >>> manager.getLink('HIS1').click()
+    >>> manager.getLink('1').click()
 
 Now toad is in the Students div
 
@@ -357,9 +344,9 @@
 
 Toad can see the calendar now:
 
-    >>> toad.open('http://localhost/sections/his1/calendar')
+    >>> toad.open('http://localhost/sections/1/calendar')
     >>> print toad.url
-    http://localhost/sections/his1/calendar
+    http://localhost/sections/1/calendar
 
 And Toad's overlay portlet shows the section:
 
@@ -372,14 +359,14 @@
             <th></th>
             <th></th>
           </tr><tr style="background: #9db8d2"><td><input type="checkbox" checked disabled></td>
-            <td><input type="checkbox" name="my_timetable" checked></td>
+            <td><input type="checkbox" name="my_timetable"></td>
             <td style="width: 100%">My Calendar</td>
             <td></td>
-          </tr><tr style="background: #eed680"><td><input type="checkbox" name="overlay:list" checked value="/sections/his1"></td>
-            <td><input type="checkbox" name="overlay_timetables:list" value="/sections/his1"></td>
-            <td style="width: 100%"> -- History</td>
+          </tr><tr style="background: #eed680"><td><input type="checkbox" name="overlay:list" checked value="/sections/1"></td>
+            <td><input type="checkbox" name="overlay_timetables:list" value="/sections/1"></td>
+            <td style="width: 100%"> -- History (1)</td>
             <td><a class="go" style="background: #d1940c;
-                color: #d1940c" href="http://localhost/sections/his1/calendar">...</a></td>
+                color: #d1940c" href="http://localhost/sections/1/calendar">...</a></td>
         </tr><tr style="background: #e0b6af"><td><input type="checkbox" name="overlay:list" checked value="/"></td>
             <td><input type="checkbox" name="overlay_timetables:list" checked value="/"></td>
             <td style="width: 100%">SchoolTool</td>
@@ -390,7 +377,7 @@
 Though students can't see the section list (nor sections themselves) by
 default:
 
-    >>> frog.open('http://localhost/sections/his1')
+    >>> frog.open('http://localhost/sections/1')
     >>> print frog.url
     http://localhost/@@login.html?forbidden=yes&nexturl=...
 
@@ -403,9 +390,9 @@
 
 Students still aren't given the option to change the location:
 
-    >>> frog.open('http://localhost/sections/his1')
+    >>> frog.open('http://localhost/sections/1')
     >>> print frog.url
-    http://localhost/sections/his1
+    http://localhost/sections/1
     >>> "change location" not in frog.contents
     True
 

Modified: schooltool/trunk/src/schooltool/app/browser/ftests/composite-timetables.txt
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/app/browser/ftests/composite-timetables.txt?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/app/browser/ftests/composite-timetables.txt (original)
+++ schooltool/trunk/src/schooltool/app/browser/ftests/composite-timetables.txt Sat Jul 14 16:06:24 2007
@@ -279,11 +279,14 @@
 
 Let's look at John's composite calendar:
 
-    >>> print http(r"""
-    ... GET /persons/john/calendar/2003-09-02 HTTP/1.1
-    ... Authorization: Basic john:pwd""", handle_errors=False)
-    HTTP/1.1 200 Ok
-    Content-Length: ...
+    >>> john = Browser()
+    >>> john.addHeader('Authorization', 'Basic john:pwd')
+    >>> john.open('http://localhost/persons/john/calendar/2003-09-02')
+    >>> john.getControl(name='my_timetable').value = True
+    >>> john.getControl('Apply').click()
+
+    >>> print john.contents
+    <BLANKLINE>
     ...
     English for boys
     ...

Modified: schooltool/trunk/src/schooltool/app/browser/ftests/personinstructor.txt
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/app/browser/ftests/personinstructor.txt?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/app/browser/ftests/personinstructor.txt (original)
+++ schooltool/trunk/src/schooltool/app/browser/ftests/personinstructor.txt Sat Jul 14 16:06:24 2007
@@ -36,19 +36,16 @@
     >>> 'History' in manager.contents
     True
 
-    >>> manager.getLink('History').click()
-    >>> manager.getLink('New Section').click()
-    >>> manager.getControl('Code').value = 'HIS1'
-    >>> manager.getControl('Description').value = 'Section1'
-    >>> manager.getControl('Add').click()
+    >>> from schooltool.app.browser.ftests import setup
+    >>> setup.addSection('History')
 
 Let's make the frog a teacher:
 
-    >>> manager.getLink('(HIS1)').click()
+    >>> manager.open('http://localhost/sections/1')
     >>> manager.getLink('edit instructors').click()
     >>> manager.getControl(name='add_item.frog').value = True
     >>> manager.getControl('Add').click()
-    >>> manager.getControl('Cancel').click()
+    >>> manager.getControl('OK').click()
     >>> print manager.contents
     <!DOCTYPE ...>
     ...
@@ -78,7 +75,7 @@
     >>> manager.getLink('edit individuals').click()
     >>> manager.getControl(name='add_item.toad').value = True
     >>> manager.getControl('Add').click()
-    >>> manager.getLink('HIS1').click()
+    >>> manager.getLink('1').click()
 
 Now frog can see the demographics of toad alright:
 

Modified: schooltool/trunk/src/schooltool/app/browser/ftests/schedule-single-student.txt
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/app/browser/ftests/schedule-single-student.txt?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/app/browser/ftests/schedule-single-student.txt (original)
+++ schooltool/trunk/src/schooltool/app/browser/ftests/schedule-single-student.txt Sat Jul 14 16:06:24 2007
@@ -281,8 +281,8 @@
             <td>
               <select name="sections:list">
                 <option value="" selected="selected">none</option>
-                <option value="birdwatching-2"> -- Birding</option>
-                <option value="birdwatching-3"> -- Birding</option>
+                <option value="birdwatching-2"> -- Birding2</option>
+                <option value="birdwatching-3"> -- Birding3</option>
               </select>
             </td>
     ...
@@ -290,7 +290,7 @@
             <td>
               <select name="sections:list">
                 <option value="" selected="selected">none</option>
-                <option value="birdwatching-3"> -- Birding</option>
+                <option value="birdwatching-3"> -- Birding3</option>
               </select>
             </td>
     ...
@@ -298,7 +298,7 @@
             <td>
               <select name="sections:list">
                 <option value="" selected="selected">none</option>
-                <option value="birdwatching-1"> -- Birding</option>
+                <option value="birdwatching-1"> -- Birding1</option>
               </select>
             </td>
     ...
@@ -306,8 +306,8 @@
             <td>
               <select name="sections:list">
                 <option value="" selected="selected">none</option>
-                <option value="birdwatching-1"> -- Birding</option>
-                <option value="birdwatching-2"> -- Birding</option>
+                <option value="birdwatching-1"> -- Birding1</option>
+                <option value="birdwatching-2"> -- Birding2</option>
               </select>
             </td>
     ...
@@ -329,8 +329,8 @@
             <td>
               <select name="sections:list">
                 <option value="" selected="selected">none</option>
-                <option value="birdwatching-2"> -- Birding</option>
-                <option value="birdwatching-3"> -- Birding</option>
+                <option value="birdwatching-2"> -- Birding2</option>
+                <option value="birdwatching-3"> -- Birding3</option>
               </select>
             </td>
     ...
@@ -338,7 +338,7 @@
             <td>
               <select name="sections:list">
                 <option value="" selected="selected">none</option>
-                <option value="birdwatching-3"> -- Birding</option>
+                <option value="birdwatching-3"> -- Birding3</option>
               </select>
             </td>
     ...
@@ -347,7 +347,7 @@
               <select name="sections:list">
                 <option value="">none</option>
                 <option selected="selected"
-                        value="birdwatching-1"> -- Birding</option>
+                        value="birdwatching-1"> -- Birding1</option>
               </select>
             </td>
     ...
@@ -356,8 +356,8 @@
               <select name="sections:list">
                 <option value="">none</option>
                 <option selected="selected"
-                        value="birdwatching-1"> -- Birding</option>
-                <option value="birdwatching-2"> -- Birding</option>
+                        value="birdwatching-1"> -- Birding1</option>
+                <option value="birdwatching-2"> -- Birding2</option>
               </select>
             </td>
     ...
@@ -380,8 +380,8 @@
               <select name="sections:list">
                 <option value="">none</option>
                 <option selected="selected"
-                        value="birdwatching-2"> -- Birding</option>
-                <option value="birdwatching-3"> -- Birding</option>
+                        value="birdwatching-2"> -- Birding2</option>
+                <option value="birdwatching-3"> -- Birding3</option>
               </select>
             </td>
     ...
@@ -389,7 +389,7 @@
             <td>
               <select name="sections:list">
                 <option value="" selected="selected">none</option>
-                <option value="birdwatching-3"> -- Birding</option>
+                <option value="birdwatching-3"> -- Birding3</option>
               </select>
             </td>
     ...
@@ -398,7 +398,7 @@
               <select name="sections:list">
                 <option value="">none</option>
                 <option selected="selected"
-                        value="birdwatching-1"> -- Birding</option>
+                        value="birdwatching-1"> -- Birding1</option>
               </select>
             </td>
     ...
@@ -408,16 +408,16 @@
               <select name="sections:list">
                 <option value="">none</option>
                 <option selected="selected"
-                        value="birdwatching-1"> -- Birding</option>
-                <option value="birdwatching-2"> -- Birding</option>
-              </select>
-            </td>
-            <td>
-              <select name="sections:list">
-                <option value="">none</option>
-                <option value="birdwatching-1"> -- Birding</option>
-                <option selected="selected"
-                        value="birdwatching-2"> -- Birding</option>
+                        value="birdwatching-1"> -- Birding1</option>
+                <option value="birdwatching-2"> -- Birding2</option>
+              </select>
+            </td>
+            <td>
+              <select name="sections:list">
+                <option value="">none</option>
+                <option value="birdwatching-1"> -- Birding1</option>
+                <option selected="selected"
+                        value="birdwatching-2"> -- Birding2</option>
               </select>
             </td>
             <td class="conflict">

Modified: schooltool/trunk/src/schooltool/app/browser/ftests/section-booking.txt
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/app/browser/ftests/section-booking.txt?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/app/browser/ftests/section-booking.txt (original)
+++ schooltool/trunk/src/schooltool/app/browser/ftests/section-booking.txt Sat Jul 14 16:06:24 2007
@@ -14,7 +14,7 @@
 and book it for our history class:
 
     >>> print rest("""
-    ... PUT  /sections/history6a/timetables/2005-fall.default HTTP/1.1
+    ... PUT  /sections/1/timetables/2005-fall.default HTTP/1.1
     ... Authorization: Basic manager:schooltool
     ... Content-Type: text/xml
     ...
@@ -70,7 +70,7 @@
     >>> print analyze.queryHTML('id("content-body")', manager.contents)[0]
     <div id="content-body">
     ...
-        <a href="http://localhost/sections/history6a/calendar/..." title="History 6">
+        <a href="http://localhost/sections/1/calendar/..." title="History 6">
           History 6
           <span class="start-end">
             (<span>11:35</span>
@@ -84,7 +84,7 @@
 Now if we will unschedule the other activity this one should retain
 it's description:
 
-    >>> manager.open('http://localhost/sections/history6a')
+    >>> manager.open('http://localhost/sections/1')
     >>> manager.getLink('Schedule').click()
     >>> manager.getControl(name="Monday.09:30-10:25").value = False
     >>> manager.getControl(name="Wednesday.11:35-12:20").value = True

Modified: schooltool/trunk/src/schooltool/app/browser/ftests/setup.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/app/browser/ftests/setup.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/app/browser/ftests/setup.py (original)
+++ schooltool/trunk/src/schooltool/app/browser/ftests/setup.py Sat Jul 14 16:06:24 2007
@@ -1,7 +1,7 @@
 """
 High-level setup functions for functional tests.
 
-$Id: setup.py 6887 2007-04-24 11:14:07Z ignas $
+$Id: setup.py 7080 2007-07-14 15:18:18Z ignas $
 """
 
 from zope.testbrowser.testing import Browser
@@ -72,6 +72,22 @@
     manager.getControl('Search').click()
     assert title in manager.contents
 
+def addCourse(title, description="", identifier=""):
+    """Add a course."""
+    manager = logInManager()
+    manager.getLink('Courses').click()
+    manager.getLink('New Course').click()
+    manager.getControl('Title').value = title
+    manager.getControl('Description').value = description
+    manager.getControl('Identifier').value = identifier
+    manager.getControl('Add').click()
+
+def addSection(course):
+    """Add a section."""
+    manager = logInManager()
+    manager.getLink('Courses').click()
+    manager.getLink(course).click()
+    manager.getLink('New Section').click()
 
 def setUpTimetabling(username):
     """Create the infrastructure for functional tests involving timetables.
@@ -120,30 +136,21 @@
     manager.open('http://localhost/courses')
     manager.getLink('New Course').click()
 
-    manager.getControl('Title').value = 'History 6'
-    manager.getControl('Identifier').value = 'history6'
-    manager.getControl('Description').value = 'History for the sixth class'
-    manager.getControl('Add').click()
+    addCourse('History 6', 'History for the sixth class', 'history6')
 
     # And a section:
-
-    manager.getLink('History 6').click()
-    manager.getLink('New Section').click()
-    manager.getControl('Code').value = 'history-6a'
-    manager.getControl('Identifier').value = 'history6a'
-    manager.getControl('Description').value = 'History for the class 6A'
-    manager.getControl('Add').click()
+    addSection('History 6')
 
     # Let's assign Frog as a teacher for History 6:
 
-    manager.getLink(url='http://localhost/sections/history6a').click()
+    manager.open('http://localhost/sections/1')
     manager.getLink('edit instructors').click()
     manager.getControl('Frog').selected = True
     manager.getControl('Add').click()
 
     # And schedule the section:
 
-    manager.open('http://localhost/sections/history6a')
+    manager.open('http://localhost/sections/1')
     manager.getLink('Schedule').click()
 
     manager.getControl(name="Monday.09:30-10:25").value = True

Modified: schooltool/trunk/src/schooltool/app/browser/ftests/test_all.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/app/browser/ftests/test_all.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/app/browser/ftests/test_all.py (original)
+++ schooltool/trunk/src/schooltool/app/browser/ftests/test_all.py Sat Jul 14 16:06:24 2007
@@ -19,7 +19,7 @@
 """
 Functional tests for schooltool.app.app.
 
-$Id: test_all.py 6558 2007-01-10 17:17:03Z ignas $
+$Id: test_all.py 7062 2007-07-13 16:51:44Z jinty $
 """
 
 import unittest
@@ -28,6 +28,7 @@
 from zope.publisher.interfaces.browser import IBrowserPublisher
 from zope.publisher.browser import BrowserView
 
+from schooltool.app.testing import app_functional_layer
 from schooltool.testing.functional import collect_ftests
 
 
@@ -45,7 +46,7 @@
 
 
 def test_suite():
-    return collect_ftests()
+    return collect_ftests(layer=app_functional_layer)
 
 
 if __name__ == '__main__':

Modified: schooltool/trunk/src/schooltool/app/browser/templates/edit_relationships.pt
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/app/browser/templates/edit_relationships.pt?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/app/browser/templates/edit_relationships.pt (original)
+++ schooltool/trunk/src/schooltool/app/browser/templates/edit_relationships.pt Sat Jul 14 16:06:24 2007
@@ -9,21 +9,6 @@
       
       <form method="post" tal:attributes="action request/URL" class="standalone">
 	<h3 i18n:translate="" tal:content="view/title" />
-	<fieldset tal:define="items view/getSelectedItems">
-	  <tal:if condition="items">
-	    <legend i18n:translate="" tal:content="view/current_title" />
-	    <tal:block replace="structure view/selected_table/render" />
-	    <div class="controls">
-	      <input type="submit" class="button-ok" name="REMOVE_ITEMS"
-		     value="Remove"
-		     title="Shortcut: Alt-R" accesskey="R"
-		     i18n:attributes="value; accesskey" />
-	    </div>
-	  </tal:if>
-	  <p tal:condition="not:items" i18n:translate="">
-	    There are none.
-	  </p>
-	</fieldset>
 	<fieldset>
 	  <legend i18n:translate="" tal:content="view/available_title" />
 	  <div class="item_list">
@@ -41,10 +26,26 @@
 	    </p>
 	  </div>
 	</fieldset>
+	<fieldset tal:define="items view/getSelectedItems">
+	  <tal:if condition="items">
+	    <legend i18n:translate="" tal:content="view/current_title" />
+	    <tal:block replace="structure view/selected_table/render" />
+	    <div class="controls">
+	      <input type="submit" class="button-cancel" name="REMOVE_ITEMS"
+		     value="Remove"
+		     title="Shortcut: Alt-R" accesskey="R"
+		     i18n:attributes="value; accesskey" />
+	    </div>
+	  </tal:if>
+	  <p tal:condition="not:items" i18n:translate="">
+	    There are none.
+	  </p>
+	</fieldset>
+
 	
 	<div class="controls">
-	  <input type="submit" class="button-cancel" name="CANCEL" value="Cancel"
-		 i18n:attributes="value cancel-button" />
+	  <input type="submit" class="button-ok" name="CANCEL" value="OK"
+		 i18n:attributes="value ok-button" />
 	</div>
       </form>
       

Modified: schooltool/trunk/src/schooltool/app/browser/tests/test_cal.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/app/browser/tests/test_cal.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/app/browser/tests/test_cal.py (original)
+++ schooltool/trunk/src/schooltool/app/browser/tests/test_cal.py Sat Jul 14 16:06:24 2007
@@ -19,7 +19,7 @@
 """
 Tests for SchoolTool-specific calendar views.
 
-$Id: test_cal.py 6967 2007-06-04 15:01:11Z ignas $
+$Id: test_cal.py 7080 2007-07-14 15:18:18Z ignas $
 """
 import unittest
 import calendar
@@ -5151,7 +5151,7 @@
         >>> group1 = app['groups']['g1'] = Group(title="Group 1")
         >>> group2 = app['groups']['g2'] = Group(title="Group 2")
         >>> history = app['courses']['c1'] = Course(title="History")
-        >>> section = app['sections']['s1'] = Section()
+        >>> section = app['sections']['s1'] = Section(title="History")
         >>> history.sections.add(section)
 
         >>> from schooltool.app.interfaces import IShowTimetables
@@ -5171,8 +5171,7 @@
         <div id="portlet-calendar-overlay" class="portlet">
         ...
         ...<input type="checkbox" checked="checked" disabled="disabled" />...
-        ...<input type="checkbox" name="my_timetable"
-                  checked="checked" />...
+        ...<input type="checkbox" name="my_timetable" />...
         ...My Calendar...
         ...
         ...<input type="checkbox" name="overlay:list"
@@ -5351,7 +5350,6 @@
         >>> for c, col1, col2 in subscriber.getCalendars():
         ...     print '%s (%s, %s)' % (c.title, col1, col2)
         My Calendar (#9db8d2, #7590ae)
-        My Calendar (timetable) (#9db8d2, #7590ae)
         Other Calendar (red, blue)
         Another Calendar (timetable) (green, red)
         Interesting Calendar (yellow, white)

Modified: schooltool/trunk/src/schooltool/app/rest/ftests/test_all.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/app/rest/ftests/test_all.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/app/rest/ftests/test_all.py (original)
+++ schooltool/trunk/src/schooltool/app/rest/ftests/test_all.py Sat Jul 14 16:06:24 2007
@@ -19,16 +19,17 @@
 """
 Functional tests for schooltool.app.rest.
 
-$Id: test_all.py 6558 2007-01-10 17:17:03Z ignas $
+$Id: test_all.py 7062 2007-07-13 16:51:44Z jinty $
 """
 
 import unittest
 
+from schooltool.app.testing import app_functional_layer
 from schooltool.testing.functional import collect_ftests
 
 
 def test_suite():
-    return collect_ftests()
+    return collect_ftests(layer=app_functional_layer)
 
 
 if __name__ == '__main__':

Modified: schooltool/trunk/src/schooltool/app/tests/test_main.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/app/tests/test_main.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/app/tests/test_main.py (original)
+++ schooltool/trunk/src/schooltool/app/tests/test_main.py Sat Jul 14 16:06:24 2007
@@ -19,7 +19,7 @@
 """
 Unit tests for schooltool.app.main.
 
-$Id: test_main.py 6967 2007-06-04 15:01:11Z ignas $
+$Id: test_main.py 7063 2007-07-14 07:57:05Z jinty $
 """
 
 import os
@@ -32,18 +32,8 @@
 from zope.traversing.interfaces import IContainmentRoot
 from zope.interface import directlyProvides
 
-
-def findSiteZCML():
-    import schooltool
-    dir = os.path.dirname(schooltool.__file__)
-    for trial in (('..', '..', 'schooltool-skel', 'etc', 'site.zcml'),
-                  ('..', '..', '..', 'schooltool-skel', 'etc', 'site.zcml'),
-                  ('..', '..', '..', 'etc', 'site.zcml')):
-        path = os.path.abspath(os.path.join(dir, *trial))
-        if os.path.exists(path):
-            return path
-    raise ValueError('`site.zcml` not found.')
-
+here = os.path.dirname(__file__)
+ftesting_zcml = os.path.join(here, '..', 'ftesting.zcml')
 
 def doctest_Options():
     """Tests for Options.
@@ -386,7 +376,7 @@
         ...     reportlab_fontdir = ''
         ...     devmode = False
         ...     school_type = ''
-        ...     site_definition = findSiteZCML()
+        ...     site_definition = ftesting_zcml
         >>> options.config = ConfigStub()
 
     Workaround to fix a Windows failure:
@@ -494,7 +484,7 @@
         ...     lang = 'lt'
         ...     reportlab_fontdir = ''
         ...     devmode = False
-        ...     site_definition = findSiteZCML()
+        ...     site_definition = ftesting_zcml
         >>> options.config = ConfigStub()
         >>> db = object()
 
@@ -518,7 +508,7 @@
 
         >>> from schooltool.app.main import StandaloneServer
         >>> server = StandaloneServer()
-        >>> server.siteConfigFile = findSiteZCML()
+        >>> server.siteConfigFile = ftesting_zcml
         >>> server.configure()
 
     When we start with an empty database, bootstrapSchoolTool creates a
@@ -620,7 +610,7 @@
 
         >>> from schooltool.app.main import StandaloneServer
         >>> server = StandaloneServer()
-        >>> server.siteConfigFile = findSiteZCML()
+        >>> server.siteConfigFile = ftesting_zcml
         >>> server.configure()
 
     We also need an application (we are doing the full set up in here

Modified: schooltool/trunk/src/schooltool/attendance/browser/ftests/attendance-forms.txt
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/attendance/browser/ftests/attendance-forms.txt?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/attendance/browser/ftests/attendance-forms.txt (original)
+++ schooltool/trunk/src/schooltool/attendance/browser/ftests/attendance-forms.txt Sat Jul 14 16:06:24 2007
@@ -27,14 +27,9 @@
 
 and creates a course and a section
 
-    >>> manager.getLink('Courses').click()
-    >>> manager.getLink('New Course').click()
-    >>> manager.getControl('Title').value = 'Dancing 1'
-    >>> manager.getControl('Add').click()
-    >>> manager.getLink('Dancing 1').click()
-    >>> manager.getLink('New Section').click()
-    >>> manager.getControl('Code').value = 'dancing-1a'
-    >>> manager.getControl('Add').click()
+    >>> from schooltool.app.browser.ftests import setup
+    >>> setup.addCourse('Dancing 1')
+    >>> setup.addSection('Dancing 1')
 
 We also need a term and a timetable
 
@@ -68,7 +63,7 @@
 
 Let's schedule the section
 
-    >>> manager.open('http://localhost/sections/dancing1a')
+    >>> manager.open('http://localhost/sections/1')
     >>> manager.getLink('Schedule').click()
 
     >>> manager.getControl(name="Monday.09:30-10:25").value = True
@@ -81,7 +76,7 @@
     >>> addPerson('Great Teacher Largo', 'largo', 'sittinghorse', 
     ...     groups=['teachers'])
 
-    >>> manager.open('http://localhost/sections/dancing1a')
+    >>> manager.open('http://localhost/sections/1')
     >>> manager.getLink('edit instructors').click()
     >>> manager.getControl('Great Teacher Largo').selected = True
     >>> manager.getControl('Add').click()
@@ -97,7 +92,7 @@
 
 Add them to dancing section
 
-    >>> manager.open('http://localhost/sections/dancing1a')
+    >>> manager.open('http://localhost/sections/1')
     >>> manager.getLink('edit individuals').click()
     >>> manager.getControl('Joniukas').selected = True
     >>> manager.getControl('Gretute').selected = True
@@ -128,7 +123,7 @@
     <div id="content-body">
     ...
       <h6 style="background: #...">
-        <a href="http://localhost/sections/dancing1a/calendar/..." title="Dancing 1">
+        <a href="http://localhost/sections/1/calendar/..." title="Dancing 1">
           Dancing 1
           <span class="start-end">
             (<span>09:30</span>
@@ -142,16 +137,17 @@
 You can go to the section attendance form by following the 'Attendance' link in
 the event box.
 
-    >>> largo.getLink('Attendance', url="dancing1a").click()
+    >>> largo.getLink('Attendance', url="1").click()
     >>> print analyze.queryHTML('id("content-header")', largo.contents)[0]
     <div id="content-header">
-    <h2>Section attendance for Great Teacher Largo -- Dancing 1  at 2005-12-12
+    <h2>Section attendance for Great Teacher Largo -- Dancing 1 (1)  at 2005-12-12
     period 09:30-10:25</h2>
     </div>
 
-    <>>> print analyze.queryHTML('id("content-body")', largo.contents)[0]
-    ...
-    <form method="POST" action="http://localhost/sections/dancing1a/attendance/2005-12-12/09:30-10:25">
+    >>> print analyze.queryHTML('id("content-body")', largo.contents)[0]
+    <div id="content-body">
+    <BLANKLINE>
+    <form method="POST" action="http://localhost/sections/1/attendance/2005-12-12/09%3A30-10%3A25">
     ...
 
 Mark Joniukas as absent:
@@ -191,7 +187,7 @@
           </span>
       </h6>
     ...
-      <div class="title">Was absent from dancing-1a.</div>
+      <div class="title">Was absent from Dancing 1 (1).</div>
     ...
 
 
@@ -235,14 +231,14 @@
     <BLANKLINE>
     ...
       <h6 style="background: ...">
-           Was late for da...
+           Was late for Da...
            <span class="start-end">
              (<span>09:30</span>
                - <span>10:25</span>)
            </span>
       </h6>
     ...
-      <div class="title">Was late for dancing-1a (52 minutes).</div>
+      <div class="title">Was late for Dancing 1 (1) (52 minutes).</div>
     ...
 
 
@@ -253,14 +249,14 @@
 attendance sparkline drawn along with the status symbol:
 
     >>> largo.open('http://localhost/persons/largo/calendar/2005-12-14')
-    >>> largo.getLink('Attendance', url="dancing1a").click()
+    >>> largo.getLink('Attendance', url="1").click()
     >>> print '\n'.join(analyze.queryHTML('//img[@width="30"]', largo.contents))
-    <img alt="attendance graph for the last 10 days" width="30" height="13" src="http://localhost/sections/dancing1a/@@sparkline.png?person=gretute&amp;date=2005-12-14">
-    <img alt="attendance graph for the last 10 days" width="30" height="13" src="http://localhost/sections/dancing1a/@@sparkline.png?person=joniukas&amp;date=2005-12-14">
+    <img alt="attendance graph for the last 10 days" width="30" height="13" src="http://localhost/sections/1/@@sparkline.png?person=gretute&amp;date=2005-12-14">
+    <img alt="attendance graph for the last 10 days" width="30" height="13" src="http://localhost/sections/1/@@sparkline.png?person=joniukas&amp;date=2005-12-14">
 
 "Look" at the attendance sparkline for joniukas
 
-    >>> largo.open('http://localhost/sections/dancing1a/@@sparkline.png?person=joniukas&amp;date=2005-12-14')
+    >>> largo.open('http://localhost/sections/1/@@sparkline.png?person=joniukas&amp;date=2005-12-14')
     >>> image = largo.contents
 
 It looks like this
@@ -305,7 +301,7 @@
     ...
     <h2>Attendance of Joniukas</h2>
     ...
-    ...2005-12-12 09:30: late for Great Teacher Largo -- Dancing 1...
+    ...2005-12-12 09:30: late for Great Teacher Largo -- Dancing 1 (1)...
 
 
 Even if the teachers are allowed to resolve the absences (regression test)
@@ -333,7 +329,7 @@
 
 He knows the URL and just enters it:
 
-    >>> largo.open("http://localhost/sections/dancing1a/"
+    >>> largo.open("http://localhost/sections/1/"
     ...            "attendance/2005-12-14/11:35-12:20")
 
 He gets to the retroactive attendance form.  It does not have
@@ -380,7 +376,7 @@
     <BLANKLINE>
     ...
     <h2>Section attendance for
-      Great Teacher Largo -- Dancing 1
+      Great Teacher Largo -- Dancing 1 (1)
       at 2005-12-14
       period 11:35-12:20</h2>
       ...

Modified: schooltool/trunk/src/schooltool/attendance/browser/ftests/student-attendance.txt
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/attendance/browser/ftests/student-attendance.txt?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/attendance/browser/ftests/student-attendance.txt (original)
+++ schooltool/trunk/src/schooltool/attendance/browser/ftests/student-attendance.txt Sat Jul 14 16:06:24 2007
@@ -38,18 +38,12 @@
 
 and creates a course:
 
-    >>> manager.getLink('Courses').click()
-    >>> manager.getLink('New Course').click()
-    >>> manager.getControl('Title').value = 'Dancing 1'
-    >>> manager.getControl('Add').click()
+    >>> from schooltool.app.browser.ftests import setup
+    >>> setup.addCourse('Dancing 1')
 
 add a section:
 
-    >>> manager.getLink('Courses').click()
-    >>> manager.getLink('Dancing 1').click()
-    >>> manager.getLink('New Section').click()
-    >>> manager.getControl('Code').value = 'dancing-1a'
-    >>> manager.getControl('Add').click()
+    >>> setup.addSection('Dancing 1')
 
 We also need a term and a timetable
 
@@ -89,7 +83,7 @@
 
 Let's make largo a teacher for the section:
 
-    >>> manager.open('http://localhost/sections/dancing1a')
+    >>> manager.open('http://localhost/sections/1')
     >>> manager.getLink('edit instructors').click()
     >>> manager.getControl('Great Teacher Largo').selected = True
     >>> manager.getControl('Add').click()
@@ -102,7 +96,7 @@
     >>> largo.handleErrors = False
     >>> largo.open('http://localhost/')
 
-    >>> largo.open('http://localhost/sections/dancing1a')
+    >>> largo.open('http://localhost/sections/1')
     >>> largo.getLink('Schedule').click()
 
     >>> largo.getControl(name="Monday.09:30-10:25").value = True
@@ -116,7 +110,7 @@
 
 Add them to dancing section
 
-    >>> largo.open('http://localhost/sections/dancing1a')
+    >>> largo.open('http://localhost/sections/1')
     >>> largo.getLink('edit individuals').click()
     >>> largo.getControl('Joniukas').selected = True
     >>> largo.getControl('Gretute').selected = True
@@ -124,22 +118,22 @@
 
 And register some absences
 
-    >>> largo.open('http://localhost/sections/dancing1a'
+    >>> largo.open('http://localhost/sections/1'
     ...            '/attendance/2005-11-14/09:30-10:25')
     >>> largo.getControl(name='joniukas_check').value=True
     >>> largo.getControl('Mark as absent').click()
 
-    >>> largo.open('http://localhost/sections/dancing1a'
+    >>> largo.open('http://localhost/sections/1'
     ...            '/attendance/2005-11-16/11:35-12:20')
     >>> largo.getControl(name='joniukas_check').value=True
     >>> largo.getControl('Mark as absent').click()
 
-    >>> largo.open('http://localhost/sections/dancing1a'
+    >>> largo.open('http://localhost/sections/1'
     ...            '/attendance/2005-11-21/09:30-10:25')
     >>> largo.getControl(name='joniukas_check').value=True
     >>> largo.getControl('Mark as absent').click()
 
-    >>> largo.open('http://localhost/sections/dancing1a'
+    >>> largo.open('http://localhost/sections/1'
     ...            '/attendance/2005-11-23/11:35-12:20')
     >>> largo.getControl(name='joniukas_check').value=True
     >>> largo.getControl('Mark as absent').click()

Modified: schooltool/trunk/src/schooltool/basicperson/browser/ftests/basicperson.txt
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/basicperson/browser/ftests/basicperson.txt?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/basicperson/browser/ftests/basicperson.txt (original)
+++ schooltool/trunk/src/schooltool/basicperson/browser/ftests/basicperson.txt Sat Jul 14 16:06:24 2007
@@ -13,4 +13,41 @@
 
     >>> manager.getLink('Persons').click()
     >>> manager.getLink('New Person').click()
+    >>> manager.getControl('First name').value = "John"
+    >>> manager.getControl('Last name').value = "Petterson"
+    >>> manager.getControl('Gender').value = ['male']
+    >>> manager.getControl('Email').value = 'john at example.com'
+    >>> manager.getControl('Phone').value = '111-111-1111'
+    >>> manager.getControl('Birth date').value = '1980-01-01'
 
+    >>> manager.getControl('Username').value = "john"
+    >>> manager.getControl('Password').value = "pwd"
+    >>> manager.getControl('Confirm').value = "pwd"
+    >>> manager.getControl('Add').click()
+
+Go to the person list:
+
+    >>> manager.getLink('Persons').click()
+
+Both of our users are in there:
+
+    >>> manager.getLink('John')
+    <Link text='John' url='http://localhost/persons/john'>
+
+    >>> manager.getLink('Administrator', index=1)
+    <Link text='Administrator' url='http://localhost/persons/manager'>
+
+You can filter the list:
+
+    >>> manager.getControl(name='SEARCH_TITLE').value = "John"
+    >>> manager.getControl('Find Now').click()
+
+And now we only have John in there:
+
+    >>> manager.getLink('John')
+    <Link text='John' url='http://localhost/persons/john'>
+
+    >>> manager.getLink('Administrator', index=1)
+    Traceback (most recent call last):
+    ...
+    LinkNotFoundError

Modified: schooltool/trunk/src/schooltool/basicperson/ftesting.zcml
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/basicperson/ftesting.zcml?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/basicperson/ftesting.zcml (original)
+++ schooltool/trunk/src/schooltool/basicperson/ftesting.zcml Sat Jul 14 16:06:24 2007
@@ -6,4 +6,7 @@
     <include package="schooltool.term" />
     <include package="schooltool.timetable" />
 
+    <!-- Provide local overrides of standard configurations-->
+    <includeOverrides package="schooltool.basicperson" file="overrides.zcml" />
+
 </configure>

Modified: schooltool/trunk/src/schooltool/basicperson/person.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/basicperson/person.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/basicperson/person.py (original)
+++ schooltool/trunk/src/schooltool/basicperson/person.py Sat Jul 14 16:06:24 2007
@@ -19,7 +19,7 @@
 """
 Lyceum person specific code.
 
-$Id: person.py 7031 2007-07-12 14:08:13Z ignas $
+$Id: person.py 7073 2007-07-14 10:57:59Z ignas $
 
 """
 from zope.interface import implements
@@ -104,7 +104,7 @@
         return [first_name, last_name]
 
     def createManagerUser(self, username, system_name):
-        return self(username, system_name, "Administratorius")
+        return self(username, system_name, "Administrator")
 
     def sortOn(self):
         return (("last_name", False),)

Modified: schooltool/trunk/src/schooltool/basicperson/tests/test_person.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/basicperson/tests/test_person.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/basicperson/tests/test_person.py (original)
+++ schooltool/trunk/src/schooltool/basicperson/tests/test_person.py Sat Jul 14 16:06:24 2007
@@ -19,7 +19,7 @@
 """
 Unit tests for basic person.
 
-$Id: test_person.py 7031 2007-07-12 14:08:13Z ignas $
+$Id: test_person.py 7077 2007-07-14 11:25:35Z ignas $
 """
 import unittest
 
@@ -88,7 +88,7 @@
 
         >>> manager = utility.createManagerUser("manager_username", "SchoolTool")
         >>> manager.title
-        'Administratorius SchoolTool'
+        'Administrator SchoolTool'
         >>> manager.username
         'manager_username'
 

Modified: schooltool/trunk/src/schooltool/commendation/SystemIntegration.txt
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/commendation/SystemIntegration.txt?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/commendation/SystemIntegration.txt (original)
+++ schooltool/trunk/src/schooltool/commendation/SystemIntegration.txt Sat Jul 14 16:06:24 2007
@@ -1,5 +1,5 @@
 ===================================================
-System-Integration of Commentations into SchoolTool
+System-Integration of Commendations into SchoolTool
 ===================================================
 
 Now that we have integrated the commendations on the Python level, we need to
@@ -218,40 +218,22 @@
 We get setup by accessing the site and logging in as the manager:
 
   >>> from zope.testbrowser.testing import Browser
-  >>> manager = Browser()
-  >>> manager.open('http://localhost/')
-
-  >>> manager.getLink('Log In').click()
-  >>> manager.getControl('Username').value = 'manager'
-  >>> manager.getControl('Password').value = 'schooltool'
-  >>> manager.getControl('Log in').click()
-
+  >>> from schooltool.app.browser.ftests import setup
+  >>> manager = setup.logIn("manager", "schooltool")
 
 Now that we are locked in, we have to create
 
 - a student,
 
-  >>> from schooltool.app.browser.ftests.setup import addPerson
-  >>> addPerson('Tom Hoffman', 'tha1', 'myohmy')
+  >>> setup.addPerson('Tom Hoffman', 'tha1', 'myohmy')
 
 - a course,
 
-  >>> manager.open('http://localhost/')
-  >>> manager.getLink('Courses').click()
-  >>> manager.getLink('New Course').click()
-  >>> manager.getControl('Title').value = 'Math 101'
-  >>> manager.getControl('Description').value = 'Basic Math'
-  >>> manager.getControl('Identifier').value = 'math101'
-  >>> manager.getControl('Add').click()
+  >>> setup.addCourse('Math 101', 'Basic Math', 'math101')
 
 - and a section.
 
-  >>> manager.getLink('Math 101').click()
-  >>> manager.getLink('New Section').click()
-  >>> manager.getControl('Code').value = 'Sec-A'
-  >>> manager.getControl('Description').value = 'Section A'
-  >>> manager.getControl('Identifier').value = 'math101-A'
-  >>> manager.getControl('Add').click()
+  >>> setup.addSection('Math 101')  
 
 Now we should be able to add commendations to
 
@@ -288,25 +270,18 @@
 
 - and sections.
 
-  >>> manager.getLink('Sections').click()
-  >>> manager.getLink('Sec-A').click()
+  >>> manager.getLink('Courses').click()
+  >>> manager.getLink('Math 101').click()
+  >>> manager.getLink('-- Math 101 (1)').click()
   >>> manager.getLink('Add Commendation')
-  <Link text='Add Commendation' url='...tions/math101-A/commendations/@@addCommendation.html'>
+  <Link text='Add Commendation' url='...tions/1/commendations/@@addCommendation.html'>
   >>> manager.getLink('View Commendations')
-  <Link text='View Commendations' url='...tions/math101-A/commendations'>
+  <Link text='View Commendations' url='...tions/1/commendations'>
 
 Also, not just everybody can add new commendations. For example Tom Hoffman,
 one of the students, cannot add new commendations:
 
-  >>> tom = Browser()
-  >>> tom.open('http://localhost/')
-
-  >>> tom.getLink('Log In').click()
-  >>> tom.getControl('Username').value = 'tha1'
-  >>> tom.getControl('Password').value = 'myohmy'
-  >>> tom.getControl('Log in').click()
-
-  >>> tom.handleErrors = False
+  >>> tom = setup.logIn('tha1','myohmy')
   >>> tom.open('http://localhost/persons/manager/commendations/@@addCommendation.html')
   Traceback (most recent call last):
   ...
@@ -317,7 +292,7 @@
   ...
   Unauthorized: ...
 
-  >>> tom.open('http://localhost/sections/math101-A/commendations/@@addCommendation.html')
+  >>> tom.open('http://localhost/sections/1/commendations/@@addCommendation.html')
   Traceback (most recent call last):
   ...
   Unauthorized: ...
@@ -326,6 +301,6 @@
 
   >>> tom.open('http://localhost/persons/manager/commendations')
   >>> tom.open('http://localhost/groups/students/commendations')
-  >>> tom.open('http://localhost/sections/math101-A/commendations')
+  >>> tom.open('http://localhost/sections/1/commendations')
 
 And that's all.

Modified: schooltool/trunk/src/schooltool/course/browser/configure.zcml
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/course/browser/configure.zcml?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/course/browser/configure.zcml (original)
+++ schooltool/trunk/src/schooltool/course/browser/configure.zcml Sat Jul 14 16:06:24 2007
@@ -137,7 +137,7 @@
       content_factory="..section.Section"
       permission="schooltool.edit"
       class=".section.SectionAddView">
-    <widget field="description" height="5" />
+    <widget field="description" height="2" />
   </addform>
 
   <editform

Modified: schooltool/trunk/src/schooltool/course/browser/course.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/course/browser/course.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/course/browser/course.py (original)
+++ schooltool/trunk/src/schooltool/course/browser/course.py Sat Jul 14 16:06:24 2007
@@ -19,7 +19,7 @@
 """
 course browser views.
 
-$Id: course.py 6967 2007-06-04 15:01:11Z ignas $
+$Id: course.py 7080 2007-07-14 15:18:18Z ignas $
 """
 from zope.app import zapi
 from zope.app.form.browser.add import AddView
@@ -81,12 +81,15 @@
         for section in sections:
             results.append({'title': removeSecurityProxy(section).title,
                             'section': section})
+        results.sort(key=lambda s: s['section'].__name__)
         return results
 
     def memberOf(self):
         """Seperate out generic groups from sections."""
-        return [group for group in self.context.groups
-                if not ISection.providedBy(group)]
+        sections =  [group for group in self.context.groups
+                     if not ISection.providedBy(group)]
+        sections.sort(key=lambda s: s.__name__)
+        return sections
 
     def learnerOf(self):
         """Get the sections the person is a member of."""
@@ -100,5 +103,5 @@
                                                    rel_type=URIMembership)
                 for section in group_sections:
                     results.append({'section': section, 'group': item})
-
+        results.sort(key=lambda s: s['section'].__name__)
         return results

Modified: schooltool/trunk/src/schooltool/course/browser/section.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/course/browser/section.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/course/browser/section.py (original)
+++ schooltool/trunk/src/schooltool/course/browser/section.py Sat Jul 14 16:06:24 2007
@@ -19,7 +19,7 @@
 """
 course browser views.
 
-$Id: section.py 6967 2007-06-04 15:01:11Z ignas $
+$Id: section.py 7080 2007-07-14 15:18:18Z ignas $
 """
 from zope.security.proxy import removeSecurityProxy
 from zope.app import zapi
@@ -29,7 +29,7 @@
 from zope.app.form.utility import getWidgetsData
 from zope.publisher.browser import BrowserView
 from zope.component import getMultiAdapter
-
+from zope.app.container.interfaces import INameChooser
 from zc.table import table
 
 from schooltool.person.interfaces import IPerson
@@ -45,6 +45,7 @@
 from schooltool.app.membership import URIGroup
 from schooltool.app.relationships import URISection
 from schooltool.course import booking
+from schooltool.course.section import Section
 from schooltool.app.interfaces import ISchoolToolCalendar
 from schooltool.timetable.interfaces import ICompositeTimetables
 from schooltool.app.browser.app import RelationshipViewBase
@@ -94,11 +95,18 @@
 class SectionAddView(AddView):
     """A view for adding Sections."""
 
-    error = None
-    course = None
-
-    def validCourse(self):
-        return self.course is not None
+    def newSectionId(self):
+        app = getSite()
+        sections = sorted(app['sections'].keys())
+        if len(sections) == 0:
+            return "1"
+
+        name = sections[-1]
+        try:
+            name = str(int(name)+1)
+        except ValueError:
+            name = INameChooser(app['sections']).chooseName(name, None)
+        return name
 
     def getCourseFromId(self, cid):
         app = getSite()
@@ -109,8 +117,6 @@
 
     def __init__(self, context, request):
         super(AddView, self).__init__(context, request)
-        self.update_status = None
-        self.errors = None
 
         try:
             course_id = request['field.course_id']
@@ -119,36 +125,14 @@
             return
 
         self.course = self.getCourseFromId(course_id)
-        if self.course is not None:
-            self.label = _("Add a Section to ${course}",
-                           mapping={'course': self.course.title})
-
-    def update(self):
-        if self.update_status is not None:
-            # We've been called before. Just return the previous result.
-            return self.update_status
-
-        if "UPDATE_SUBMIT" in self.request:
-            self.update_status = ''
-            try:
-                data = getWidgetsData(self, self.schema, names=self.fieldNames)
-                section = removeSecurityProxy(self.createAndAdd(data))
-                self.course.sections.add(section)
-            except WidgetsError, errors:
-                self.errors = errors
-                self.update_status = _("An error occurred.")
-                return self.update_status
-
-            self.request.response.redirect(self.nextURL())
-
-        if 'CANCEL' in self.request:
-            url = zapi.absoluteURL(self.course, self.request)
-            self.request.response.redirect(url)
-
-        return self.update_status
-
-    def nextURL(self):
-        return zapi.absoluteURL(self.course, self.request)
+
+    def __call__(self):
+        id = self.newSectionId()
+        section = Section(title=id)
+        self.context.add(section)
+        self.course.sections.add(section)
+        section.title = "%s (%s)" % (self.course.title, id)
+        self.request.response.redirect(zapi.absoluteURL(section, self.request))
 
 
 class SectionEditView(BaseEditView):
@@ -238,8 +222,8 @@
     def update(self):
         """Set self.busy_periods."""
         ttschema = self.getSchema()
-        if ttschema:
-            term = self.getTerm()
+        term = self.getTerm()
+        if ttschema and term:
             section_map = self.sectionMap(term, ttschema)
             self.busy_periods = [(key, sections)
                                  for key, sections in section_map.items()

Modified: schooltool/trunk/src/schooltool/course/browser/templates/course_container.pt
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/course/browser/templates/course_container.pt?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/course/browser/templates/course_container.pt (original)
+++ schooltool/trunk/src/schooltool/course/browser/templates/course_container.pt Sat Jul 14 16:06:24 2007
@@ -32,7 +32,7 @@
         <a tal:content="course/title"
            tal:attributes="href course/@@absolute_url">Some Object</a>
         <ul tal:condition="course/sections|nothing" class="section-list">
-          <tal:for repeat="section course/sections">
+          <tal:for repeat="section course/sections/sortby:__name__">
           <li tal:condition="section/can_access:label">
             <a i18n:translate=""
                tal:content="section/label"
@@ -58,7 +58,7 @@
         <a tal:content="course/title"
            tal:attributes="href course/@@absolute_url">Some Object</a>
         <ul tal:condition="course/sections|nothing" class="section-list">
-          <tal:for repeat="section course/sections">
+          <tal:for repeat="section course/sections/sortby:__name__">
           <li tal:condition="section/can_access:label">
             <a i18n:translate=""
                tal:condition="section/can_access:label"

Modified: schooltool/trunk/src/schooltool/course/browser/templates/section_add.pt
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/course/browser/templates/section_add.pt?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/course/browser/templates/section_add.pt (original)
+++ schooltool/trunk/src/schooltool/course/browser/templates/section_add.pt Sat Jul 14 16:06:24 2007
@@ -53,7 +53,7 @@
         </div>
         <div class="field">
           <input id="add_name" type="text" name="add_input_name"
-                 tal:attributes="value context/contentName" />
+                 tal:attributes="value view/newSectionId" />
         </div>
         <input id="field.course_id" name="field.course_id" type="hidden"
                value=""

Modified: schooltool/trunk/src/schooltool/course/browser/tests.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/course/browser/tests.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/course/browser/tests.py (original)
+++ schooltool/trunk/src/schooltool/course/browser/tests.py Sat Jul 14 16:06:24 2007
@@ -19,7 +19,7 @@
 """
 Unit tests for course and section views.
 
-$Id: tests.py 6967 2007-06-04 15:01:11Z ignas $
+$Id: tests.py 7080 2007-07-14 15:18:18Z ignas $
 """
 import unittest
 
@@ -279,68 +279,18 @@
     of a course.  If they don't have a course, they can't be created "stand
     alone".
 
-    First a request without a course reference sets the view error.
-
-        >>> request = TestRequest()
-        >>> context = AddingStub(sections, request)
-        >>> view = SectionAddViewForTesting(context, request)
-        >>> view.error
-        u'Need a course ID.'
-
-    validCourse is used to disable the update input button:
-
-        >>> view.validCourse()
-        False
-        >>> view.update()
-
-    A request with course_id doesn't
-
         >>> request = TestRequest()
         >>> request.form = {'field.course_id' : 'algebraI'}
         >>> context = AddingStub(sections, request)
         >>> view = SectionAddViewForTesting(context, request)
-        >>> view.error is None
-        True
-        >>> view.validCourse()
-        True
-        >>> view.update()
-
-    if there's a course_id in the request that doesn't match any known courses
-    the error is different.
-
-        >>> request = TestRequest()
-        >>> request.form = {'field.course_id' : 'math'}
-        >>> context = AddingStub(sections, request)
-        >>> view = SectionAddViewForTesting(context, request)
-        >>> view.error
-        u'No such course.'
-        >>> view.validCourse()
-        False
-        >>> view.update()
-
-    Currently our course has no sections
-
-        >>> for section in course.sections:
-        ...     print section
-
-        >>> request = TestRequest()
-        >>> request.form = {'UPDATE_SUBMIT': True,
-        ...                 'field.title' : 'MAT1',
-        ...                 'field.course_id' : 'algebraI'}
-        >>> context = AddingStub(sections, request)
-        >>> view = SectionAddViewForTesting(context, request)
-        >>> view.update()
-        ''
-
-        >>> translate(view.label)
-        u'Add a Section to Algebra I'
+        >>> view()
 
     Our section is now a member of the Course, we use a generic title for
     sections
 
         >>> for section in course.sections:
         ...     print section.title
-        MAT1
+        Algebra I (1)
 
         >>> tearDown()
 
@@ -536,7 +486,7 @@
     """
 
 
-def doctest_ConflictDisplayMixin_no_timetables():
+def doctest_ConflictDisplayMixin_no_timetables_terms():
     r"""Tests for ConflictDisplayMixin.
 
     ConflictDisplayMixin should work even if there are no timetables
@@ -546,9 +496,20 @@
         >>> app = setup.setUpSchoolToolSite()
         >>> view = ConflictDisplayMixin(app)
         >>> view.getSchema = lambda: None
+        >>> view.getTerm = lambda: "I am a term"
         >>> view.getAvailableItems = lambda: []
 
         >>> view.update()
+        >>> view.busy_periods
+        []
+
+    If there are no terms, but there are timetables - it still works:
+
+        >>> view.getSchema = lambda: "I am a schema"
+        >>> view.getTerm = lambda: None
+        >>> view.update()
+        >>> view.busy_periods
+        []
 
     """
 

Modified: schooltool/trunk/src/schooltool/course/interfaces.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/course/interfaces.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/course/interfaces.py (original)
+++ schooltool/trunk/src/schooltool/course/interfaces.py Sat Jul 14 16:06:24 2007
@@ -19,7 +19,7 @@
 """
 Course and Section related interfaces
 
-$Id: interfaces.py 6967 2007-06-04 15:01:11Z ignas $
+$Id: interfaces.py 7064 2007-07-14 08:10:01Z pcardune $
 """
 import zope.interface
 import zope.schema
@@ -70,9 +70,9 @@
             names, courses, and meeting time."""))
 
     title = zope.schema.TextLine(
-        title=_("Code"),
+        title=_("Title"),
         required=True,
-        description=_("ID code for the section."))
+        description=_("Title for the section."))
 
     description = zope.schema.Text(
         title=_("Description"),

Modified: schooltool/trunk/src/schooltool/course/section.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/course/section.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/course/section.py (original)
+++ schooltool/trunk/src/schooltool/course/section.py Sat Jul 14 16:06:24 2007
@@ -19,7 +19,7 @@
 """
 Section implementation
 
-$Id: section.py 6967 2007-06-04 15:01:11Z ignas $
+$Id: section.py 7080 2007-07-14 15:18:18Z ignas $
 """
 from persistent import Persistent
 import zope.interface
@@ -59,9 +59,8 @@
     @property
     def label(self):
         instructors = " ".join([i.title for i in self.instructors])
-        courses = " ".join([c.title for c in self.courses])
-        msg = _('${instructors} -- ${courses}',
-                mapping={'instructors': instructors, 'courses': courses})
+        msg = _('${instructors} -- ${section_title}',
+                mapping={'instructors': instructors, 'section_title': self.title})
         return msg
 
     @property

Modified: schooltool/trunk/src/schooltool/course/tests/test_course.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/course/tests/test_course.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/course/tests/test_course.py (original)
+++ schooltool/trunk/src/schooltool/course/tests/test_course.py Sat Jul 14 16:06:24 2007
@@ -19,7 +19,7 @@
 """
 Unit tests for course and section implementations.
 
-$Id: test_course.py 6967 2007-06-04 15:01:11Z ignas $
+$Id: test_course.py 7080 2007-07-14 15:18:18Z ignas $
 """
 import unittest
 from zope.testing import doctest
@@ -207,28 +207,23 @@
         Mr. Jones
 
     Sections are generally shown in the interface by their label.  Labels are
-    created from the list of instructors, courses, and XXX time (not yet).
+    created from the list of instructors and the section title.
 
         >>> from zope.i18n import translate
         >>> translate(section.label)
-        u'Mr. Jones -- '
+        u'Mr. Jones -- section 1'
 
     Labels are updated dynamically when more instructors are added.
 
         >>> section.instructors.add(Person('teacher2', 'Mrs. Smith'))
         >>> translate(section.label)
-        u'Mr. Jones Mrs. Smith -- '
-
-    Label s should include the courses that a Section is part of:
+        u'Mr. Jones Mrs. Smith -- section 1'
+
+    The course should be listed in courses:
 
         >>> from schooltool.course.course import Course
         >>> course = Course(title="US History")
         >>> course.sections.add(section)
-        >>> translate(section.label)
-        u'Mr. Jones Mrs. Smith -- US History'
-
-    The course should be listed in courses:
-
         >>> for course in section.courses:
         ...     print course.title
         US History

Modified: schooltool/trunk/src/schooltool/generations/evolve4.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/generations/evolve4.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/generations/evolve4.py (original)
+++ schooltool/trunk/src/schooltool/generations/evolve4.py Sat Jul 14 16:06:24 2007
@@ -22,7 +22,7 @@
 This generation ensures that all schooltool applications have a levels folder
 and a manager group.
 
-$Id: evolve4.py 6233 2006-06-12 17:52:59Z ignas $
+$Id: evolve4.py 7066 2007-07-14 08:19:04Z ignas $
 """
 
 from zope.app.publication.zopepublication import ZopePublication

Modified: schooltool/trunk/src/schooltool/gradebook/browser/README.txt
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/gradebook/browser/README.txt?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/gradebook/browser/README.txt (original)
+++ schooltool/trunk/src/schooltool/gradebook/browser/README.txt Sat Jul 14 16:06:24 2007
@@ -100,13 +100,8 @@
 Every term, the administrators of a school are going to setup sections. So
 let's add a section for our course:
 
-    >>> manager.getLink('Courses').click()
-    >>> manager.getLink('Physics I').click()
-
-    >>> manager.getLink('New Section').click()
-    >>> manager.getControl('Code').value = 'PHYI-1'
-    >>> manager.getControl('Description').value = 'Section 1'
-    >>> manager.getControl('Add').click()
+    >>> from schooltool.app.browser.ftests import setup
+    >>> setup.addSection('Physics I')
 
 But what would a section be without some students and a teacher?
 
@@ -120,14 +115,14 @@
 
     >>> manager.getLink('Courses').click()
     >>> manager.getLink('Physics I').click()
-    >>> manager.getLink('(PHYI-1)').click()
+    >>> manager.getLink('(1)').click()
 
     >>> manager.getLink('edit individuals').click()
     >>> manager.getControl('Paul Cardune').click()
     >>> manager.getControl('Tom Hoffman').click()
     >>> manager.getControl('Claudia Richter').click()
     >>> manager.getControl('Add').click()
-    >>> manager.getLink('PHYI-1').click()
+    >>> manager.getControl('OK').click()
 
     >>> 'Paul Cardune' in manager.contents
     True
@@ -135,7 +130,7 @@
     >>> manager.getLink('edit instructors').click()
     >>> manager.getControl('Stephan Richter').click()
     >>> manager.getControl('Add').click()
-    >>> manager.getControl('Cancel').click()
+    >>> manager.getControl('OK').click()
 
 
 Instructor should be automatically capable of manipulating activities
@@ -156,7 +151,7 @@
     >>> stephan.getLink('SchoolTool').click()
     >>> stephan.getLink('Courses').click()
     >>> stephan.getLink('Physics I').click()
-    >>> stephan.getLink('(PHYI-1)').click()
+    >>> stephan.getLink('(1)').click()
     >>> stephan.getLink('Activities').click()
 
 Note that the final is already listed:
@@ -216,7 +211,7 @@
     LinkNotFoundError
 
     >>> stephan.getLink('HW 1')
-    <Link text='HW 1' url='.../sections/phyi1/activities/Activity-2'>
+    <Link text='HW 1' url='.../sections/1/activities/Activity-2'>
 
 Finally, you can also delete activities that you have locally created:
 
@@ -244,7 +239,7 @@
     >>> stephan.getLink('SchoolTool').click()
     >>> stephan.getLink('Courses').click()
     >>> stephan.getLink('Physics I').click()
-    >>> stephan.getLink('(PHYI-1)').click()
+    >>> stephan.getLink('(1)').click()
     >>> stephan.getLink('Gradebook').click()
 
 The initial gradebook screen is a simple spreadsheet. In order to prevent
@@ -318,7 +313,7 @@
     >>> stephan.getLink('Claudia Richter').click()
     >>> stephan.getControl('Cancel').click()
     >>> stephan.url
-    'http://localhost/sections/phyi1/gradebook/index.html'
+    'http://localhost/sections/1/gradebook/index.html'
 
 
 Entering Scores for a Column (Activity)
@@ -387,7 +382,7 @@
     >>> stephan.getLink('HW 1').click()
     >>> stephan.getControl('Cancel').click()
     >>> stephan.url
-    'http://localhost/sections/phyi1/gradebook/index.html'
+    'http://localhost/sections/1/gradebook/index.html'
 
 
 Entering Scores for a Cell (Student, Activity)
@@ -441,7 +436,7 @@
     >>> stephan.getControl('Update').click()
 
     >>> stephan.url
-    'http://localhost/sections/phyi1/gradebook/index.html'
+    'http://localhost/sections/1/gradebook/index.html'
     >>> '>86<' in stephan.contents
     True
 
@@ -452,7 +447,7 @@
     >>> stephan.getControl('Cancel').click()
 
     >>> stephan.url
-    'http://localhost/sections/phyi1/gradebook/index.html'
+    'http://localhost/sections/1/gradebook/index.html'
     >>> '>86<' in stephan.contents
     True
 

Modified: schooltool/trunk/src/schooltool/person/browser/ftests.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/person/browser/ftests.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/person/browser/ftests.py (original)
+++ schooltool/trunk/src/schooltool/person/browser/ftests.py Sat Jul 14 16:06:24 2007
@@ -1,4 +1,5 @@
+from schooltool.app.testing import app_functional_layer
 from schooltool.testing.functional import collect_ftests
 
 def test_suite():
-    return collect_ftests()
+    return collect_ftests(layer=app_functional_layer)

Modified: schooltool/trunk/src/schooltool/resource/browser/ftests.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/resource/browser/ftests.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/resource/browser/ftests.py (original)
+++ schooltool/trunk/src/schooltool/resource/browser/ftests.py Sat Jul 14 16:06:24 2007
@@ -23,10 +23,11 @@
 """
 import unittest
 
+from schooltool.app.testing import app_functional_layer
 from schooltool.testing.functional import collect_ftests
 
 def test_suite():
-    return collect_ftests()
+    return collect_ftests(layer=app_functional_layer)
 
 if __name__ == '__main__':
     unittest.main(defaultTest='test_suite')

Modified: schooltool/trunk/src/schooltool/restclient/ftests/test_restclient.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/restclient/ftests/test_restclient.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/restclient/ftests/test_restclient.py (original)
+++ schooltool/trunk/src/schooltool/restclient/ftests/test_restclient.py Sat Jul 14 16:06:24 2007
@@ -19,17 +19,18 @@
 """
 Functional tests for schooltool.restclient
 
-$Id: test_restclient.py 6558 2007-01-10 17:17:03Z ignas $
+$Id: test_restclient.py 7062 2007-07-13 16:51:44Z jinty $
 """
 
 import unittest
 
+from schooltool.app.testing import app_functional_layer
 from schooltool.testing.functional import collect_ftests
 
 
 def test_suite():
     # 500 'cause it doesn't work yet
-    return collect_ftests(filenames=['../README.txt'], level=500)
+    return collect_ftests(filenames=['../README.txt'], level=500, layer=app_functional_layer)
 
 
 if __name__ == '__main__':

Modified: schooltool/trunk/src/schooltool/securitypolicy/browser/ftests/helpers.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/securitypolicy/browser/ftests/helpers.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/securitypolicy/browser/ftests/helpers.py (original)
+++ schooltool/trunk/src/schooltool/securitypolicy/browser/ftests/helpers.py Sat Jul 14 16:06:24 2007
@@ -1,7 +1,7 @@
 """
 Helper functions for functional tests.
 
-$Id: helpers.py 6887 2007-04-24 11:14:07Z ignas $
+$Id: helpers.py 7058 2007-07-13 15:46:19Z pcardune $
 """
 
 from zope.security.interfaces import Unauthorized
@@ -182,7 +182,7 @@
 
 
 def section_view(browser):
-    browser.open('http://localhost/sections/history6a')
+    browser.open('http://localhost/sections/1')
     return 'Section of' in browser.contents
 
 def section_edit(browser):
@@ -213,7 +213,7 @@
 
 
 def section_calendar_view(browser):
-    browser.open('http://localhost/sections/history6a/calendar')
+    browser.open('http://localhost/sections/1/calendar')
     return 'Calendar for' in browser.contents
 
 def section_calendar_edit(browser):

Modified: schooltool/trunk/src/schooltool/securitypolicy/browser/ftests/policy_table.txt
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/securitypolicy/browser/ftests/policy_table.txt?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/securitypolicy/browser/ftests/policy_table.txt (original)
+++ schooltool/trunk/src/schooltool/securitypolicy/browser/ftests/policy_table.txt Sat Jul 14 16:06:24 2007
@@ -41,11 +41,11 @@
     >>> manager.getControl('Add').click()
 
     >>> manager.getLink('Sections').click()
-    >>> manager.getLink('history-6a').click()
+    >>> manager.getLink('1').click()
     >>> manager.getLink('edit individuals').click()
     >>> manager.getControl('Student1').click()
     >>> manager.getControl('Add').click()
-    >>> manager.getLink('history-6a').click()
+    >>> manager.getLink('1').click()
     >>> manager.getLink('book resources').click()
     >>> manager.getControl('Time travel machine').click()
     >>> manager.getControl('Add').click()
@@ -55,7 +55,7 @@
     >>> manager.getLink('SchoolTool').click()
     >>> manager.getLink('Courses').click()
     >>> manager.getLink('History 6').click()
-    >>> manager.getLink('history-6a').click()
+    >>> manager.getLink('1').click()
     >>> manager.getLink('Activities').click()
     >>> manager.getLink('New Activity').click()
     >>> manager.getControl('Title').value = 'SchoolTool origin'
@@ -64,7 +64,7 @@
     >>> manager.getControl('Maximum').value = '5'
     >>> manager.getControl('Identifier').value = 'storig'
     >>> manager.getControl('Add').click()
-    >>> manager.getLink('history-6a').click()
+    >>> manager.getLink('1').click()
     >>> manager.getLink('Gradebook').click()
     >>> manager.getLink('SchoolTool origin').click()
     Traceback (most recent call last):
@@ -84,7 +84,7 @@
     >>> manager.getLink('SchoolTool').click()
     >>> manager.getLink('Courses').click()
     >>> manager.getLink('History 6').click()
-    >>> manager.getLink('history-6a').click()
+    >>> manager.getLink('1').click()
     >>> manager.getLink('Gradebook').click()
     >>> manager.getLink('SchoolTool origin').click()
     >>> manager.getControl(name='student1').value = '8'
@@ -119,7 +119,7 @@
 
 Manager can see almost everything:
 
-    >>> column(manager, 'student1', 'history6a')
+    >>> column(manager, 'student1', '1')
     course:              view  edit
     course activities:   view  edit
     gradebook scores:    view
@@ -152,7 +152,7 @@
     >>> alien = Browser()
     >>> alien.handleErrors = False
     >>> alien.open('http://localhost/')
-    >>> column(alien, 'student1', 'history6a')
+    >>> column(alien, 'student1', '1')
     course:              view
     course activities:   view
     gradebook scores:
@@ -183,7 +183,7 @@
 Student looking at another student:
 
     >>> student1 = setup.logIn('student1', 'student1')
-    >>> column(student1, 'student2', 'history6a')
+    >>> column(student1, 'student2', '1')
     course:              view
     course activities:   view
     gradebook scores:
@@ -213,7 +213,7 @@
 
 Student looking at himself (his section):
 
-    >>> column(student1, 'student1', 'history6a')
+    >>> column(student1, 'student1', '1')
     course:              view
     course activities:   view
     gradebook scores:
@@ -244,7 +244,7 @@
 Student looking at another student and not his section:
 
     >>> student2 = setup.logIn('student2', 'student2')
-    >>> column(student2, 'student1', 'history6a')
+    >>> column(student2, 'student1', '1')
     course:              view
     course activities:   view
     gradebook scores:
@@ -275,7 +275,7 @@
 Instructor looking at his student and section:
 
     >>> instructor = setup.logIn('instructor1', 'instructor1')
-    >>> column(instructor, 'student1', 'history6a')
+    >>> column(instructor, 'student1', '1')
     course:              view
     course activities:   view
     gradebook scores:    view  edit
@@ -306,7 +306,7 @@
 Group member:
 
     >>> teacher3 = setup.logIn('teacher3', 'teacher3')
-    >>> column(teacher3, 'student1', 'history6a')
+    >>> column(teacher3, 'student1', '1')
     course:              view
     course activities:   view
     gradebook scores:
@@ -337,7 +337,7 @@
 Leader stuff:
 
     >>> leader = setup.logIn('teacher2', 'teacher2')
-    >>> column(leader, 'student1', 'history6a')
+    >>> column(leader, 'student1', '1')
     course:              view  edit
     course activities:   view  edit
     gradebook scores:
@@ -392,7 +392,7 @@
     >>> manager.getControl('Everyone can view the application calendar').click()
     >>> manager.getControl('Everyone can view section information and ').click()
     >>> manager.getControl('Apply').click()
-    >>> column(alien, 'student1', 'history6a')
+    >>> column(alien, 'student1', '1')
     course:              view
     course activities:   view
     gradebook scores:
@@ -496,7 +496,7 @@
     >>> manager.getControl('Administration can grade students').click()
     >>> manager.getControl('Apply').click()
 
-#   >>> helpers.gradebook_scores_edit(manager, 'history6a')
+#   >>> helpers.gradebook_scores_edit(manager, '1')
 #   True
 
 Instructor - section relations:
@@ -512,7 +512,7 @@
     >>> manager.getControl('Student3').click()
     >>> manager.getControl('Add').click()
     >>> manager.getLink('Sections').click()
-    >>> manager.getLink('history-6a').click()
+    >>> manager.getLink('1').click()
     >>> manager.getLink('edit groups').click()
     >>> manager.getControl('Some Students').click()
     >>> manager.getControl('Add').click()
@@ -523,7 +523,7 @@
     >>> instructor.open('http://localhost/')
     >>> instructor.getLink('Frog').click()
     >>> instructor.getLink('schooldata').click()
-    >>> instructor.getLink('Frog -- History 6').click()
+    >>> instructor.getLink('Frog -- History 6 (1)').click()
     >>> instructor.getLink('edit groups').click()
     >>> 'Some Students' in instructor.contents
     True

Modified: schooltool/trunk/src/schooltool/securitypolicy/policy.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/securitypolicy/policy.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/securitypolicy/policy.py (original)
+++ schooltool/trunk/src/schooltool/securitypolicy/policy.py Sat Jul 14 16:06:24 2007
@@ -19,7 +19,7 @@
 """
 SchoolTool security policy.
 
-$Id: policy.py 6344 2006-07-05 15:51:12Z ignas $
+$Id: policy.py 7080 2007-07-14 15:18:18Z ignas $
 
 """
 
@@ -38,8 +38,8 @@
 
         # Check the generic, interface-independent permissions.
         crowdclasses = getCrowdsUtility().permcrowds.get(permission, [])
-        if self.checkCrowds(crowdclasses, obj):
-            return True
+        if crowdclasses:
+            return self.checkCrowds(crowdclasses, obj)
 
         # No quick method worked, look up the crowd by adaptation.
         return self.checkByAdaptation(permission, obj)

Modified: schooltool/trunk/src/schooltool/securitypolicy/tests/test_policy.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/securitypolicy/tests/test_policy.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/securitypolicy/tests/test_policy.py (original)
+++ schooltool/trunk/src/schooltool/securitypolicy/tests/test_policy.py Sat Jul 14 16:06:24 2007
@@ -19,7 +19,7 @@
 """
 Unit tests for schooltool.securitypolicy.policy
 
-$Id: test_policy.py 6183 2006-06-07 18:40:03Z ignas $
+$Id: test_policy.py 7080 2007-07-14 15:18:18Z ignas $
 """
 
 import unittest
@@ -80,7 +80,6 @@
         >>> obj = Obj()
 
         >>> sp.checkPermission('perm', obj)
-        checkCrowds([], <...test_policy.Obj object ...>)
         checkByAdaptation('perm', <...Obj object ...>)
         False
 
@@ -93,15 +92,14 @@
         checkCrowds(['crowd factory'], <...Obj object ...>)
         True
 
-    Another case: checkCrowds fails, but checkByAdaptation returns True:
+    Another case: there is a crowd in permcrowds but checkCrowds
+    fails:
 
         >>> checkcrowds_returns = False
-        >>> byadaptation_returns = True
 
         >>> sp.checkPermission('perm', obj)
         checkCrowds(['crowd factory'], <...Obj object ...>)
-        checkByAdaptation('perm', <...Obj object...>)
-        True
+        False
 
     """
 

Modified: schooltool/trunk/src/schooltool/skin/configure.zcml
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/skin/configure.zcml?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/skin/configure.zcml (original)
+++ schooltool/trunk/src/schooltool/skin/configure.zcml Sat Jul 14 16:06:24 2007
@@ -155,7 +155,10 @@
   <resource name="zonki-angry.png" file="resources/zonki-angry.png"
 	    layer="schooltool.skin.ISchoolToolLayer" />
 	    
-
+  <resource name="downarrow.png" file="resources/downarrow.png"
+            layer="schooltool.skin.ISchoolToolLayer" />
+  <resource name="rightarrow.png" file="resources/rightarrow.png"
+            layer="schooltool.skin.ISchoolToolLayer" />
   
   <resource name="layout.css" file="resources/layout.css"
 	    layer="schooltool.skin.ISchoolToolLayer" />

Modified: schooltool/trunk/src/schooltool/skin/resources/layout.css
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/skin/resources/layout.css?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/skin/resources/layout.css (original)
+++ schooltool/trunk/src/schooltool/skin/resources/layout.css Sat Jul 14 16:06:24 2007
@@ -388,6 +388,11 @@
 	margin: 0;
 	border-left: 1px #800 solid;
 	border-right: 1px #800 solid;
+}
+
+
+#header .tools .breadcrumbs a {
+        text-transform: capitalize;
 }
 
 #tools-zmi-principal {

Modified: schooltool/trunk/src/schooltool/table/table.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/table/table.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/table/table.py (original)
+++ schooltool/trunk/src/schooltool/table/table.py Sat Jul 14 16:06:24 2007
@@ -18,7 +18,7 @@
 #
 """Base code for table rendering and filtering.
 
-$Id: table.py 6887 2007-04-24 11:14:07Z ignas $
+$Id: table.py 7080 2007-07-14 15:18:18Z ignas $
 """
 import urllib
 
@@ -183,11 +183,6 @@
         self.index = kwargs.pop('index')
         super(IndexedGetterColumn, self).__init__(**kwargs)
 
-    def renderCell(self, item, formatter):
-        item = queryUtility(IIntIds).getObject(item['id'])
-        value = self.getter(item, formatter)
-        return self.cell_formatter(value, item, formatter)
-
     def getSortKey(self, item, formatter):
         id = item['id']
         index = item['catalog'][self.index]
@@ -336,12 +331,6 @@
 
     def wrapColumn(self, column):
         """Wrap a normal column to work with index dicts"""
-        original_renderCell = column.renderCell
-        def unindexingRenderCell(item, formatter):
-            item = queryUtility(IIntIds).getObject(item['id'])
-            return original_renderCell(item, formatter)
-        column.renderCell = unindexingRenderCell
-
         if ISortableColumn.providedBy(column):
             original_getSortKey = column.getSortKey
             def unindexingGetSortKey(item, formatter):
@@ -377,3 +366,21 @@
                 columns_before=self.wrapColumns(columns_before),
                 columns_after=self.wrapColumns(columns_after),
                 **kwargs)
+
+    def wrapGetItems(self, getItems):
+        def unindexingGetItems():
+            for item in getItems():
+                item = queryUtility(IIntIds).getObject(item['id'])
+                yield item
+        return unindexingGetItems
+
+    def render(self):
+        formatter = self._table_formatter(
+            self.context, self.request, self._items,
+            columns=self._columns,
+            batch_start=self.batch.start, batch_size=self.batch.size,
+            sort_on=self._sort_on,
+            prefix=self.prefix)
+        formatter.cssClasses['table'] = 'data'
+        formatter.getItems = self.wrapGetItems(formatter.getItems)
+        return formatter()

Modified: schooltool/trunk/src/schooltool/table/templates/batch.pt
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/table/templates/batch.pt?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/table/templates/batch.pt (original)
+++ schooltool/trunk/src/schooltool/table/templates/batch.pt Sat Jul 14 16:06:24 2007
@@ -16,7 +16,7 @@
        tal:condition="python:view.size > 10"
        class="less">Show Less</a>
 
-    <a tal:attributes="href string:${view/base_url}?batch_size.${view/name}=${view/full_size}"
+    <a tal:attributes="href string:${view/base_url}?batch_size${view/name}=${view/full_size}"
        tal:condition="python:view.size < view.full_size"
        class="all">Show All</a>
 

Modified: schooltool/trunk/src/schooltool/table/tests/test_table.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/table/tests/test_table.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/table/tests/test_table.py (original)
+++ schooltool/trunk/src/schooltool/table/tests/test_table.py Sat Jul 14 16:06:24 2007
@@ -18,7 +18,7 @@
 #
 """Table tests
 
-$Id: test_table.py 6862 2007-04-16 11:36:27Z ignas $
+$Id: test_table.py 7080 2007-07-14 15:18:18Z ignas $
 """
 import unittest
 
@@ -294,18 +294,6 @@
 
         >>> column.getSortKey(item, None)
         'Peter'
-
-    As we are rendering only a small set of items we are using the
-    real object for that, because indexed information used for
-    sorting/filtering might be different from the one that is being
-    displayed:
-
-        >>> class PersonStub(object):
-        ...     def __init__(self, title):
-        ...         self.title = title
-        >>> int_ids[5] = PersonStub('Mr. Peter')
-        >>> column.renderCell(item, None)
-        u'Mr. Peter'
 
     """
 
@@ -858,25 +846,20 @@
         u'Pete'
 
     But as our indexed table formatter is manipulating index dicts, we
-    must wrap normal columns to use them on our data:
+    must wrap columns implementing ISortableColumn so that they would
+    have direct access to data:
+
+        >>> from zc.table.interfaces import ISortableColumn
+        >>> from zope.interface import directlyProvides
 
         >>> int_ids = {}
         >>> class IntIdsStub(object):
         ...     def getObject(self, id):
         ...         return int_ids[id]
         >>> provideUtility(IntIdsStub(), IIntIds)
-
         >>> int_ids[5] = item
         >>> index_dict = {'id': 5}
-        >>> column = formatter.wrapColumn(column)
-        >>> column.renderCell(index_dict, None)
-        u'Pete'
-
-    Columns that implement ISortableColumn will get their getSortKey
-    wrapped as well:
-
-        >>> from zc.table.interfaces import ISortableColumn
-        >>> from zope.interface import directlyProvides
+
         >>> column = GetterColumn(getter=lambda i, f: i.title)
         >>> directlyProvides(column, ISortableColumn)
 

Modified: schooltool/trunk/src/schooltool/term/browser/ftests/term.txt
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/term/browser/ftests/term.txt?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/term/browser/ftests/term.txt (original)
+++ schooltool/trunk/src/schooltool/term/browser/ftests/term.txt Sat Jul 14 16:06:24 2007
@@ -125,26 +125,22 @@
 
     >>> manager.getLink('Math course').click()
     >>> manager.getLink('New Section').click()
-    >>> manager.getControl(name='field.title').value = 'Math 5'
-    >>> manager.getControl(name='add_input_name').value = 'MA5'
-    >>> manager.getControl('Add').click()
 
 Schedule the section in the timetable:
 
-    >>> manager.getLink('-- Math course (Math 5)').click()
     >>> manager.getLink('Schedule').click()
     >>> manager.getControl(name='Monday.A').value = True
     >>> manager.getControl(name='Friday.B').value = True
     >>> manager.getControl('Save').click()
-    >>> manager.getLink('Math 5').click()
+    >>> manager.getLink('1').click()
     >>> manager.getLink('View Timetables').click()
     >>> print manager.contents
     <BLANKLINE>
     <BLANKLINE>
     ...
-      Timetables for Math 5
-    ...
-       <a href="http://localhost/sections/MA5/timetables/term-2.simple-timetable">term-2.simple-timetable</a>
+      Timetables for Math course (1)
+    ...
+       <a href="http://localhost/sections/1/timetables/term-2.simple-timetable">term-2.simple-timetable</a>
     ...
 
 Let's do the edit:
@@ -211,7 +207,7 @@
 So the timetables should be also deleted:
 
     >>> manager.getLink('Section').click()
-    >>> manager.getLink('Math 5').click()
+    >>> manager.getLink('1').click()
     >>> manager.getLink('View Timetables').click()
     >>> print manager.contents
     <BLANKLINE>

Modified: schooltool/trunk/src/schooltool/testing/functional.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/testing/functional.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/testing/functional.py (original)
+++ schooltool/trunk/src/schooltool/testing/functional.py Sat Jul 14 16:06:24 2007
@@ -19,7 +19,7 @@
 """
 Functional Testing Utilities
 
-$Id: functional.py 6967 2007-06-04 15:01:11Z ignas $
+$Id: functional.py 7061 2007-07-13 16:42:06Z jinty $
 """
 
 import os
@@ -87,10 +87,6 @@
         finally:
             uninstall_db_bootstrap_hook()
 
-app_functional_layer = ZCMLLayer(find_ftesting_zcml(),
-                                 __name__,
-                                 'app_functional_layer')
-
 def collect_ftests(package=None, level=None, layer=None, filenames=None):
     """Collect all functional doctest files in a given package.
 
@@ -115,8 +111,7 @@
         if level is not None:
             suite.level = level
         if layer is None:
-            suite.layer = app_functional_layer
-        else:
-            suite.layer = layer
+            raise ValueError("ftests must specify an ftesting.zcml.")
+        suite.layer = layer
         suites.append(suite)
     return unittest.TestSuite(suites)

Modified: schooltool/trunk/src/schooltool/timetable/browser/ftests/timetable-events.txt
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/timetable/browser/ftests/timetable-events.txt?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/timetable/browser/ftests/timetable-events.txt (original)
+++ schooltool/trunk/src/schooltool/timetable/browser/ftests/timetable-events.txt Sat Jul 14 16:06:24 2007
@@ -23,7 +23,7 @@
     <div id="content-body">
     ...
       <h6 style="background: #...">
-        <a href="http://localhost/sections/history6a/calendar/..." title="History 6">
+        <a href="http://localhost/sections/1/calendar/..." title="History 6">
           History 6
           <span class="start-end">
             (<span>11:35</span>
@@ -79,10 +79,10 @@
 
     >>> manager = setup.logInManager()
 
-Now check the calendar for the history6a section.  We should have a
+Now check the calendar for the 1 section.  We should have a
 class from 9:30 to 10:25.
 
-    >>> manager.open('http://localhost/sections/history6a/calendar/2006-01-02')
+    >>> manager.open('http://localhost/sections/1/calendar/2006-01-02')
     >>> events = analyze.queryHTML('//span[@class="start-end"]', manager.contents)
     >>> for event in events: print event
     <BLANKLINE>
@@ -91,10 +91,10 @@
     >>> for event in events: '10:30' not in event
     True
 
-Now we will go and modify the schedule for history6a and see if the
+Now we will go and modify the schedule for 1 and see if the
 calendar events are updated
 
-    >>> manager.open('http://localhost/sections/history6a/@@schedule.html')
+    >>> manager.open('http://localhost/sections/1/@@schedule.html')
     >>> manager.getControl(name="Monday.09:30-10:25").value = False
     >>> manager.getControl(name="Monday.10:30-11:25").value = True
     >>> manager.getControl("Save").click()
@@ -103,11 +103,11 @@
     ...<th class="period" width="2%">10:30-11:25</th>
     <td class="activity" width="18%">History 6</td>...
 
-    >>> manager.open('http://localhost/sections/history6a/calendar/2006-01-02')
+    >>> manager.open('http://localhost/sections/1/calendar/2006-01-02')
     >>> events = analyze.queryHTML('//span[@class="start-end"]', manager.contents)
     >>> for event in events: print event
     <BLANKLINE>
     ...10:30...
     ...11:25...
     >>> for event in events: '09:30' not in event
-    True
+    True

Modified: schooltool/trunk/src/schooltool/timetable/browser/ftests/timetabling.txt
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/timetable/browser/ftests/timetabling.txt?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/timetable/browser/ftests/timetabling.txt (original)
+++ schooltool/trunk/src/schooltool/timetable/browser/ftests/timetabling.txt Sat Jul 14 16:06:24 2007
@@ -367,7 +367,7 @@
     >>> manager.getControl('Next').click()
     >>> manager.getControl('No').click()
 
-    >>> manager.open('http://localhost:8000/sections/swimming--frog/timetables/addTimetable.html')
+    >>> manager.open('http://localhost/sections/swimming--frog/timetables/addTimetable.html')
     >>> manager.getControl(name='ttschema').value = ['singleperiod']
     >>> manager.getControl('Add').click()
     >>> manager.getLink('2005-fall.singleperiod').click()
@@ -392,6 +392,28 @@
       </a>
     </h6>
 
+
+You can also delete timetable schemas and see that all the timetables related to
+that schema are also deleted.
+
+    >>> manager.getLink('School Timetables').click()
+    >>> manager.getControl(name='delete.default').value = True
+    >>> manager.getControl('Delete').click()
+    >>> manager.getControl('Confirm').click()
+    >>> manager.open('http://localhost/sections/swimming--frog/timetables')
+    >>> 'default' not in manager.contents
+    True
+
+Alternatively, we can delete terms and everything should work out as well.
+
+    >>> manager.getLink("Terms").click()
+    >>> manager.getControl(name='delete.2005-fall').value = True
+    >>> manager.getControl("Delete").click()
+    >>> manager.getControl("Confirm").click()
+    >>> manager.open('http://localhost/sections/swimming--frog/timetables')
+    >>> '2005-fall' not in manager.contents
+    True
+
 Epilogue
 --------
 

Modified: schooltool/trunk/src/schooltool/timetable/browser/tests/test_timetable.py
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/timetable/browser/tests/test_timetable.py?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/timetable/browser/tests/test_timetable.py (original)
+++ schooltool/trunk/src/schooltool/timetable/browser/tests/test_timetable.py Sat Jul 14 16:06:24 2007
@@ -19,7 +19,7 @@
 """
 Tests for schooltool timetabling views.
 
-$Id: test_timetable.py 6602 2007-01-26 13:17:25Z ignas $
+$Id: test_timetable.py 7080 2007-07-14 15:18:18Z ignas $
 """
 
 import unittest
@@ -393,8 +393,8 @@
                 <td>
                   <select name="sections:list">
                     <option value="">none</option>
-                    <option value="history"> -- </option>
-                    <option selected="selected" value="math"> -- </option>
+                    <option value="history"> -- History</option>
+                    <option selected="selected" value="math"> -- Math</option>
                   </select>
         ...
         </form>

Modified: schooltool/trunk/src/schooltool/version.txt
URL: http://svn.debian.org/wsvn/pkg-zope/schooltool/trunk/src/schooltool/version.txt?rev=945&op=diff
==============================================================================
--- schooltool/trunk/src/schooltool/version.txt (original)
+++ schooltool/trunk/src/schooltool/version.txt Sat Jul 14 16:06:24 2007
@@ -1,1 +1,1 @@
-2006.999-2007-alpha1
+2007.0.alpha2




More information about the pkg-zope-commits mailing list