Index: /main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py	(revision 6004)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py	(revision 6005)
@@ -858,4 +858,57 @@
     #        except:
     #            self.flash('Could not delete %s.' % code)
+    
+    
+class FacultyContainerManageFormPage(WAeUPEditFormPage):
+    """Manage the basic properties of a `Faculty` instance.
+    """
+    grok.context(IFacultyContainer)
+    grok.name('manage')
+    grok.require('waeup.manageUniversity')
+    grok.template('facultycontainermanagepage')
+    pnav = 1
+    taboneactions = ['Add faculty', 'Remove selected','Cancel']
+    subunits = 'Faculties'
+    title = 'Academics'
+
+    @property
+    def label(self):
+        return 'Manage academic section'
+        
+    def update(self):
+        tabs.need()
+        #warning.need()
+        return super(FacultyContainerManageFormPage, self).update()
+
+    # ToDo: Show warning message before deletion
+    @grok.action('Remove selected')
+    def delFaculties(self, **data):
+        form = self.request.form
+        child_id = form['val_id']
+        if not isinstance(child_id, list):
+            child_id = [child_id]
+        deleted = []
+        for id in child_id:
+            try:
+                del self.context[id]
+                deleted.append(id)
+            except:
+                self.flash('Could not delete %s: %s: %s' % (
+                        id, sys.exc_info()[0], sys.exc_info()[1]))
+        if len(deleted):
+            self.flash('Successfully removed: %s' % ', '.join(deleted))
+        self.redirect(self.url(self.context, '@@manage')+'#tab-1')    
+        return       
+
+    @grok.action('Add faculty', validator=NullValidator)
+    def addFaculty(self, **data):
+        self.redirect(self.url(self.context, '@@add'))
+        return    
+        
+    @grok.action('Cancel', validator=NullValidator)
+    def cancel(self, **data):
+        self.redirect(self.url(self.context))
+        return
+    
 
 class FacultyAddFormPage(WAeUPAddFormPage):
@@ -924,38 +977,4 @@
     #        except:
     #            self.flash('Could not delete %s.' % code)
-
-class DepartmentAddFormPage(WAeUPAddFormPage):
-    """Add a department to a faculty.
-    """
-    grok.context(IFaculty)
-    grok.name('add')
-    grok.require('waeup.manageUniversity')
-    label = 'Add department'
-    form_fields = grok.AutoFields(IDepartmentAdd)
-    pnav = 1
-
-    @property
-    def title(self):
-        return self.context.longtitle()
-    
-    @grok.action('Add department')
-    def addDepartment(self, **data):
-        department = createObject(u'waeup.Department')
-        self.applyData(department, **data)
-        try:
-            self.context.addDepartment(department)
-        except KeyError:
-            self.status = Invalid('The code chosen already exists '
-                                  'in the database')
-            return
-        except DuplicationError:
-            self.status = Invalid('The code chosen already exists '
-                                  'in the database')
-            return
-        self.redirect(self.url(self.context, u'@@manage')+'#tab-2')
-        
-    @grok.action('Cancel')
-    def cancel(self, **data):
-        self.redirect(self.url(self.context))
 
 class FacultyManageFormPage(WAeUPEditFormPage):
@@ -1021,54 +1040,39 @@
         return
 
-class FacultyContainerManageFormPage(WAeUPEditFormPage):
-    """Manage the basic properties of a `Faculty` instance.
-    """
-    grok.context(IFacultyContainer)
-    grok.name('manage')
-    grok.require('waeup.manageUniversity')
-    grok.template('facultycontainermanagepage')
-    pnav = 1
-    taboneactions = ['Add faculty', 'Remove selected','Cancel']
-    subunits = 'Faculties'
-    title = 'Academics'
-
-    @property
-    def label(self):
-        return 'Manage academic section'
-        
-    def update(self):
-        tabs.need()
-        #warning.need()
-        return super(FacultyContainerManageFormPage, self).update()
-
-    # ToDo: Show warning message before deletion
-    @grok.action('Remove selected')
-    def delFaculties(self, **data):
-        form = self.request.form
-        child_id = form['val_id']
-        if not isinstance(child_id, list):
-            child_id = [child_id]
-        deleted = []
-        for id in child_id:
-            try:
-                del self.context[id]
-                deleted.append(id)
-            except:
-                self.flash('Could not delete %s: %s: %s' % (
-                        id, sys.exc_info()[0], sys.exc_info()[1]))
-        if len(deleted):
-            self.flash('Successfully removed: %s' % ', '.join(deleted))
-        self.redirect(self.url(self.context, '@@manage')+'#tab-1')    
-        return       
-
-    @grok.action('Add faculty', validator=NullValidator)
-    def addFaculty(self, **data):
-        self.redirect(self.url(self.context, '@@add'))
-        return    
-        
-    @grok.action('Cancel', validator=NullValidator)
+
+class DepartmentAddFormPage(WAeUPAddFormPage):
+    """Add a department to a faculty.
+    """
+    grok.context(IFaculty)
+    grok.name('add')
+    grok.require('waeup.manageUniversity')
+    label = 'Add department'
+    form_fields = grok.AutoFields(IDepartmentAdd)
+    pnav = 1
+
+    @property
+    def title(self):
+        return self.context.longtitle()
+    
+    @grok.action('Add department')
+    def addDepartment(self, **data):
+        department = createObject(u'waeup.Department')
+        self.applyData(department, **data)
+        try:
+            self.context.addDepartment(department)
+        except KeyError:
+            self.status = Invalid('The code chosen already exists '
+                                  'in the database')
+            return
+        except DuplicationError:
+            self.status = Invalid('The code chosen already exists '
+                                  'in the database')
+            return
+        self.redirect(self.url(self.context, u'@@manage')+'#tab-2')
+        
+    @grok.action('Cancel')
     def cancel(self, **data):
         self.redirect(self.url(self.context))
-        return
+
 
 
@@ -1432,4 +1436,34 @@
         return
 
+class CertificateCourseAddFormPage(WAeUPAddFormPage):
+    """Add-page to add a course ref to a certificate
+    """
+    grok.context(ICertificate)
+    grok.name('addcertificatecourse')
+    grok.require('waeup.manageUniversity')
+    form_fields = grok.AutoFields(ICertificateCourseAdd)
+    pnav = 1
+    title = 'Add course referrer'
+
+    @grok.action('Add course referrer')
+    def addCertcourse(self, **data):
+        try:
+            self.context.addCourseRef(**data)
+        except KeyError:
+            self.status = Invalid('The chosen course referrer is already part of'
+                                  'this certificate')
+            return
+        except DuplicationError:
+            self.status = Invalid('The chosen course referrer is already part of'
+                                  'this certificate')
+            return
+        self.redirect(self.url(self.context))
+
+    @grok.action('Cancel', validator=NullValidator)
+    def cancel(self, **data):
+        self.redirect(self.url(self.context))
+        return
+
+
 #
 # Certificate course pages...
@@ -1448,5 +1482,5 @@
         return 'Course Referrer: %s' % (self.context.__name__)
 
-class CertificateCourseFormPage(WAeUPEditFormPage):
+class CertificateCourseManageFormPage(WAeUPEditFormPage):
     """Manage the basic properties of a `CertificateCourse` instance.
     """
@@ -1481,30 +1515,2 @@
         return
 
-class CertificateCourseAddFormPage(WAeUPAddFormPage):
-    """Add-page to add a course ref to a certificate
-    """
-    grok.context(ICertificate)
-    grok.name('addcertificatecourse')
-    grok.require('waeup.manageUniversity')
-    form_fields = grok.AutoFields(ICertificateCourseAdd)
-    pnav = 1
-    title = 'Add course referrer'
-
-    @grok.action('Add course referrer')
-    def addCertcourse(self, **data):
-        try:
-            self.context.addCourseRef(**data)
-        except KeyError:
-            self.status = Invalid('The chosen course referrer is already part of'
-                                  'this certificate')
-            return
-        except DuplicationError:
-            self.status = Invalid('The chosen course referrer is already part of'
-                                  'this certificate')
-            return
-        self.redirect(self.url(self.context))
-
-    @grok.action('Cancel', validator=NullValidator)
-    def cancel(self, **data):
-        self.redirect(self.url(self.context))
-        return
