Index: /main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt	(revision 6001)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt	(revision 6002)
@@ -248,5 +248,5 @@
 
   >>> browser.open('http://localhost/myuniversity/faculties/TF/TD')
-  >>> browser.getLink('Edit department').click()
+  >>> browser.getLink('Manage department').click()
 
 Let's set a new title and save the form:
@@ -256,20 +256,12 @@
 
 Clicking 'Save' we will stay on the settings form. So we can change
-the department again. This time we will return to the overview page
-afterwards:
+the department again. 
 
   >>> browser.getControl(name='form.title').value = "My renamed dept"
-  >>> ctrl = browser.getControl("Save and return")
+  >>> ctrl = browser.getControl("Save")
   >>> ctrl.click()
 
-If we go to the settings page and click ``Cancel`` nothing will be
-changed:
-
-  >>> browser.getLink('Edit department').click()
-  >>> browser.getControl(name='form.title').value = "Blah"
-  >>> browser.getControl('Cancel').click()
-
-Our department was indeed renamed to ``My renamed dept`` and not to
-``Blah``:
+
+Our department was indeed renamed to ``My renamed dept``:
 
   >>> browser.open('http://localhost/myuniversity/faculties/TF')
@@ -414,13 +406,13 @@
 ----------------
 
-We can delete courses by browsing the containing department and
-clicking on the appropriate 'Delete' button. As we have only one
-course, there is only one 'Delete' button yet:
-
-  >>> browser.open('http://localhost/myuniversity/faculties/TF/TD')
+We can delete courses by browsing the manage page of the containing department and
+checking the appropriate select box and clicking the ´´Remove selected´´ button. 
+
+  >>> browser.open('http://localhost/myuniversity/faculties/TF/TD/@@manage#tab-2')
   >>> 'My renamed course' in browser.contents
   True
 
-  >>> browser.getControl('Delete').click()
+  >>> browser.getControl(name='val_id').getControl(value='COURSE1').selected = True
+  >>> browser.getControl('Remove selected courses').click()
 
   >>> browser.open('http://localhost/myuniversity/faculties/TF/TD')
@@ -518,5 +510,5 @@
 
   >>> browser.open(dept_url + '/certificates/CERT1')
-  >>> browser.getLink('Edit certificate').click()
+  >>> browser.getLink('Manage certificate').click()
 
 When modifying a certificate, we cannot change the code any more:
@@ -533,9 +525,8 @@
 
 Clicking 'Save' we will stay on the settings form. So we can change
-the cert again. This time we will return to the overview page
-afterwards:
+the cert again. 
 
   >>> browser.getControl(name='form.title').value = "My renamed cert" 
-  >>> ctrl = browser.getControl("Save and return")
+  >>> ctrl = browser.getControl("Save",index=0)
   >>> ctrl.click()
 
@@ -543,5 +534,4 @@
 changed:
 
-  >>> browser.getLink('Edit certificate').click()
   >>> browser.getControl(name='form.title').value = "Blah"
   >>> browser.getControl('Cancel').click()
@@ -561,15 +551,13 @@
 ---------------------
 
-We can delete certificates by browsing the containing department and
-clicking on the appropriate 'Delete' button. As we have only one
-certificate, there is only one 'Delete' button yet:
-
-  >>> browser.open('http://localhost/myuniversity/faculties/TF/TD')
+We can delete certificates by browsing the manage page of the containing department and
+checking the appropriate select box and clicking the ´´Remove selected´´ button. 
+
+  >>> browser.open('http://localhost/myuniversity/faculties/TF/TD/@@manage#tab-3')
   >>> 'My renamed cert' in browser.contents
   True
 
-  >>> browser.getControl('Delete').click()
-
-  >>> browser.open('http://localhost/myuniversity/faculties/TF/TD')
+  >>> browser.getControl(name='val_id').getControl(value='CERT1').selected = True
+  >>> browser.getControl('Remove selected certificates').click()
   >>> 'My renamed cert' in browser.contents
   False
Index: /main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py	(revision 6001)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py	(revision 6002)
@@ -1091,18 +1091,18 @@
     grok.name('index')
     pnav = 1
+    label = 'Courses and Certificates'
 
     @property
     def title(self):
-        #import pdb; pdb.set_trace()
         return self.context.longtitle()
     
     def update(self):
-        yui.tabview.need()
-        if 'delcourse' in self.request.form:
-            code = self.request.form['code']
-            del self.context.courses[code]
-        if 'delcert' in self.request.form:
-            code = self.request.form['code']
-            del self.context.certificates[code]
+        tabs.need()
+        #if 'delcourse' in self.request.form:
+        #    code = self.request.form['code']
+        #    del self.context.courses[code]
+        #if 'delcert' in self.request.form:
+        #    code = self.request.form['code']
+        #    del self.context.certificates[code]
         self.tables = ITableProvider(self.context).getTables(view=self)
         self.coursetable = self.tables[0]
@@ -1116,6 +1116,24 @@
     grok.name('manage')
     grok.require('waeup.manageUniversity')
-    title = u'Edit department'
-    pnav = 1
+    pnav = 1
+    grok.template('departmentmanagepage')
+    taboneactions = ['Save','Cancel']
+    tabtwoactions = ['Add course', 'Remove selected courses','Cancel']
+    tabthreeactions = ['Add certificate', 'Remove selected certificates', 'Cancel']
+
+    @property
+    def label(self):
+        return 'Manage department'
+        
+    @property
+    def title(self):
+        return self.context.longtitle()   
+
+    def update(self):
+        tabs.need()
+        self.tables = ITableProvider(self.context).getTables(view=self)
+        self.coursetable = self.tables[0]
+        self.certificatetable = self.tables[1]
+        self.coursetable.need()
 
     form_fields = grok.AutoFields(IDepartment)
@@ -1125,11 +1143,54 @@
         self.applyData(self.context, **data)
         return
-    
-    @grok.action('Save and return')
-    def saveAndReturn(self, **data):
-        self.applyData(self.context, **data)
-        self.redirect(self.url(self.context))
-        return
-
+        
+    # ToDo: Show warning message before deletion
+    @grok.action('Remove selected courses')
+    def delCourses(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.courses[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, u'@@manage')+'#tab-2')    
+        return       
+     
+    @grok.action('Remove selected certificates')    
+    def delCertificates(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.certificates[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, u'@@manage')+'#tab-3')    
+        return               
+
+    @grok.action('Add course', validator=NullValidator)
+    def addCourse(self, **data):
+        self.redirect(self.url(self.context, 'addcourse'))
+        return   
+        
+    @grok.action('Add certificate', validator=NullValidator)
+    def addCertificate(self, **data):
+        self.redirect(self.url(self.context, 'addcertificate'))
+        return                     
+    
     @grok.action('Cancel', validator=NullValidator)
     def cancel(self, **data):
@@ -1161,5 +1222,5 @@
                                   'in the database')
             return
-        self.redirect(self.url(self.context))
+        self.redirect(self.url(self.context, u'@@manage')+'#tab-2')    
 
     @grok.action('Cancel', validator=NullValidator)
@@ -1202,5 +1263,5 @@
                                   'in the database')
             return
-        self.redirect(self.url(self.context))
+        self.redirect(self.url(self.context, u'@@manage')+'#tab-3')    
 
     @grok.action('Cancel', validator=NullValidator)
Index: /main/waeup.sirp/trunk/src/waeup/sirp/browser/tables.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/browser/tables.py	(revision 6001)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/browser/tables.py	(revision 6002)
@@ -48,13 +48,10 @@
         delcol = Col(header='&nbsp;', sortable=False,
                      data = [
-                '<form method="post">'
-                '<input type="submit" name="delcourse" value="Delete" />'
-                '<input type="hidden" name="code" value="%s" />'
-                '</form>' % (data[x].code)
-                for x in data])
+                '<input type="checkbox" name="val_id" value="%s" />' 
+                % (data[x].code) for x in data])
 
         if checkPermission('waeup.manageUniversity', self.context.courses):
             cols = list(cols)
-            cols.append(delcol)
+            cols = [delcol] + cols
             cols = tuple(cols)
         self.coursetable = Table('Courses', cols=cols)
@@ -75,13 +72,10 @@
         delcol = Col(header='&nbsp;', sortable=False,
                      data = [
-                '<form method="post">'
-                '<input type="submit" name="delcert" value="Delete" />'
-                '<input type="hidden" name="code" value="%s" />'
-                '</form>' % (data[x].code)
-                for x in data])
+                '<input type="checkbox" name="val_id" value="%s" />' 
+                % (data[x].code) for x in data])
 
         if checkPermission('waeup.manageUniversity', self.context.certificates):
             certcols = list(certcols)
-            certcols.append(delcol)
+            certcols = [delcol] + certcols
             certcols = tuple(certcols)
 
Index: /main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/departmentmanagepage.pt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/departmentmanagepage.pt	(revision 6002)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/departmentmanagepage.pt	(revision 6002)
@@ -0,0 +1,115 @@
+<script type="text/javascript"> 
+  var tabView = new YAHOO.widget.TabView('table-tabs'); 
+</script>
+
+<h2 i18n:translate=""
+tal:condition="view/label"
+tal:content="view/label">Label</h2>
+
+<div class="form-status"
+tal:define="status view/status"
+tal:condition="status">
+
+<div i18n:translate="" tal:content="view/status">
+  Form status summary
+</div>
+
+<ul class="errors" tal:condition="view/errors">
+  <li tal:repeat="error view/error_views">
+     <span tal:replace="structure error">Error Type</span>
+  </li>
+</ul>
+</div>
+
+
+<form action="." tal:attributes="action request/URL" method="POST"
+      class="edit-form" enctype="multipart/form-data"> 
+
+<div id="tabs">
+<ul>
+  <li><a href="#tab-1"><span>Settings</span></a></li>
+  <li><a href="#tab-2">Courses</a></li>
+  <li><a href="#tab-3">Certificates</a></li>
+</ul>
+   
+<div id="tab-1">        
+      <table class="form-fields">
+      <tbody>
+      <tal:block repeat="widget view/widgets">
+        <tr>
+          <td class="label" tal:define="hint widget/hint">
+    	<label tal:condition="python:hint"
+    	       tal:attributes="for widget/name">
+    	  <span class="required" tal:condition="widget/required"
+    		>*</span><span i18n:translate=""
+    		tal:content="widget/label">label</span>
+    	</label>
+    	<label tal:condition="python:not hint"
+    	       tal:attributes="for widget/name">
+    	  <span class="required" tal:condition="widget/required"
+    		>*</span><span i18n:translate=""
+    		tal:content="widget/label">label</span>
+    	</label>
+          </td>
+          <td class="field">
+    	<div class="widget" tal:content="structure widget">
+    	  <input type="text" />
+    	</div>
+    	<div class="error" tal:condition="widget/error">
+    	  <span tal:replace="structure widget/error">error</span>
+    	</div>
+          </td>
+        </tr>
+      </tal:block>
+      </tbody>
+      </table>
+
+    <div id="actionsView">
+        <span class="actionButtons" tal:condition="view/availableActions">
+            <span tal:repeat="action view/actions"
+                  tal:omit-tag="">
+              <input tal:condition="python:action.label in view.taboneactions"
+                     tal:replace="structure action/render"/>
+            </span>
+        </span>
+    </div>   
+
+</div>    
+    
+<div id="tab-2">  
+    <div name="thecoursetable" tal:condition="python: len(context.courses.keys())">
+	<div tal:replace="structure view/coursetable/renderHTML"></div>
+    </div> 
+    <br />
+    <div id="actionsView">
+        <span class="actionButtons" tal:condition="view/availableActions">
+            <span tal:repeat="action view/actions"
+                  tal:omit-tag="">
+              <input tal:condition="python:action.label in view.tabtwoactions"
+                     tal:replace="structure action/render"/>
+            </span>
+        </span>
+    </div>         
+</div>
+
+<div id="tab-3">  
+    <div name="thecerttable">
+	<div tal:replace="structure view/certificatetable/renderHTML"></div>
+    </div> 
+    <br />
+    <div id="actionsView">
+        <span class="actionButtons" tal:condition="view/availableActions">
+            <span tal:repeat="action view/actions"
+                  tal:omit-tag="">
+              <input tal:condition="python:action.label in view.tabthreeactions"
+                     tal:replace="structure action/render"/>
+            </span>
+        </span>
+    </div>         
+</div> 
+    
+</div>
+</form>  
+
+
+
Index: /main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/departmentpage.pt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/departmentpage.pt	(revision 6001)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/departmentpage.pt	(revision 6002)
@@ -1,26 +1,24 @@
 <script type="text/javascript"> 
   var tabView = new YAHOO.widget.TabView('table-tabs'); 
-</script> 
-<div id="table-tabs" class="yui-navset"> 
-  <ul class="yui-nav"> 
-    <li class="selected"><a href="#tab1"><em>Courses</em></a></li> 
-    <li><a href="#tab2"><em>Certificates</em></a></li> 
-  </ul>             
-  <div class="yui-content"> 
-    <div id="tab1">
-	
-      <div name="thecoursetable"
-	   tal:condition="python: len(context.courses.keys())">
-	<div tal:replace="structure view/coursetable/renderHTML" />
-      </div>
+</script>
 
+<h2 i18n:translate=""
+tal:condition="view/label"
+tal:content="view/label">Label</h2>
+
+<div id="tabs">
+    <ul>
+      <li><a href="#tab-1"><span>Courses</span></a></li>
+      <li><a href="#tab-2"><span>Certificates</span></a></li>
+    </ul>
+    <div id="tab-1">  
+        <div name="thecoursetable" tal:condition="python: len(context.courses.keys())">
+    	<div tal:replace="structure view/coursetable/renderHTML"></div>
+        </div> 
+    </div>
+    <div id="tab-2">  
+        <div name="thecerttable">
+    	<div tal:replace="structure view/certificatetable/renderHTML"></div>
+        </div> 
     </div> 
-    <div id="tab2">
-
-      <div name="thecerttable">
-	<div tal:replace="structure view/certificatetable/renderHTML" />
-      </div>
-
-    </div> 
-  </div> 
 </div>
Index: /main/waeup.sirp/trunk/src/waeup/sirp/browser/viewlets.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/browser/viewlets.py	(revision 6001)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/browser/viewlets.py	(revision 6002)
@@ -326,9 +326,9 @@
 
 class ManageDepartmentActionButton(ManageActionButton):
-    """ 'Edit settings' button for departments.
+    """ 'Manage settings' button for departments.
     """
     grok.context(IDepartment)
     grok.view(DepartmentPage)
-    text = 'Edit department'
+    text = 'Manage department'
 
 class ManageCourseActionButton(ManageActionButton):
@@ -340,12 +340,12 @@
     
 class ManageCertificateActionButton(ManageActionButton):
-    """ 'Edit settings' button for certificates.
+    """ 'Manage settings' button for certificates.
     """
     grok.context(ICertificate)
     grok.view(CertificatePage)
-    text = 'Edit certificate'
+    text = 'Manage certificate'
 
 class ManageCertificateCourseActionButton(ManageActionButton):
-    """ 'Edit settings' button for certificate courses.
+    """ 'Manage settings' button for certificate courses.
     """
     grok.context(ICertificateCourse)
@@ -373,24 +373,24 @@
 #    text = 'Add department'
 
-class AddCertificateActionButton(AddActionButton):
-    grok.context(IDepartment)
-    grok.view(DepartmentPage)
-    grok.order(3)
-    text = 'Add certificate'
-    target = 'addcertificate'
-    
-class AddCourseActionButton(AddActionButton):
-    grok.context(IDepartment)
-    grok.view(DepartmentPage)
-    grok.order(4)
-    text = 'Add course'
-    target = 'addcourse'
-
-class AddCertificateCourseActionButton(AddActionButton):
-    grok.context(ICertificate)
-    grok.view(CertificatePage)
-    grok.order(4)
-    text = 'Add course referrer'
-    target = 'addcertificatecourse'
+#class AddCertificateActionButton(AddActionButton):
+#    grok.context(IDepartment)
+#    grok.view(DepartmentPage)
+#    grok.order(3)
+#    text = 'Add certificate'
+#    target = 'addcertificate'
+    
+#class AddCourseActionButton(AddActionButton):
+#    grok.context(IDepartment)
+#    grok.view(DepartmentPage)
+#    grok.order(4)
+#    text = 'Add course'
+#    target = 'addcourse'
+
+#class AddCertificateCourseActionButton(AddActionButton):
+#    grok.context(ICertificate)
+#    grok.view(CertificatePage)
+#    grok.order(4)
+#    text = 'Add course referrer'
+#    target = 'addcertificatecourse'
 
 #
