Index: main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py	(revision 6151)
+++ main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py	(revision 6152)
@@ -48,4 +48,14 @@
 grok.templatedir('templates')
 
+def addLocalRole(view, tab, **data):
+    form = view.request.form
+    localrole = form['local_role']
+    user = form['user']
+    role_manager = IPrincipalRoleManager(view.context)
+    role_map = IPrincipalRoleMap(view.context)
+    role_manager.assignRoleToPrincipal(localrole, user)
+    view.redirect(view.url(view.context, u'@@manage')+'#tab-%s' % tab)
+    return
+
 #
 # Login/logout pages...
@@ -76,5 +86,4 @@
             self.flash('You entered wrong credentials!')
 
-
 class LoginStaffPage(LoginPage):
     """A login page for staff members.
@@ -84,5 +93,4 @@
     grok.require('waeup.Public')
     title = u'Staff Login'
-
 
 class LoginStudentPage(LoginPage):
@@ -108,80 +116,7 @@
         self.redirect(self.url(self.context))
 
-
 #
 # University related pages...
 #
-
-class ContainerManageFormPage(WAeUPEditFormPage):
-    """Manage the basic properties of a container instance with local roles
-    and contents This is the base class for faculty and department containers
-    """
-    grok.name('manage')
-    grok.require('waeup.manageUniversity')
-    taboneactions = ['Save','Cancel']
-    tabtwoactions = ['Add subunit', 'Remove selected','Cancel']
-    tabthreeactions = ['Add local role', 'Remove local roles selected']
-
-    # ToDo: Show warning message before deletion
-    @grok.action('Remove selected')
-    def delSubobjects(self, **data):
-        form = self.request.form
-        if form.has_key('val_id'):
-            child_id = form['val_id']
-        else:
-            self.flash('No subunit selected!')
-            self.redirect(self.url(self.context, '@@manage')+'#tab-2')
-            return
-        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
-
-    def getLocalRoles(self):
-        roles = ILocalRolesAssignable(self.context)
-        return roles()
-
-    def getUsers(self):
-        """Get a list of all users.
-        """
-        for key, val in grok.getSite()['users'].items():
-            url = self.url(val)
-            yield(dict(url=url, name=key, val=val))
-
-    @grok.action('Save')
-    def save(self, **data):
-        self.applyData(self.context, **data)
-        return
-
-    @grok.action('Cancel', validator=NullValidator)
-    def cancel(self, **data):
-        self.redirect(self.url(self.context))
-        return
-
-    @grok.action('Add subunit', validator=NullValidator)
-    def addSubunit(self, **data):
-        self.redirect(self.url(self.context, '@@add'))
-        return
-
-    @grok.action('Add local role', validator=NullValidator)
-    def addLocalRole(self, **data):
-        form = self.request.form
-        localrole = form['local_role']
-        user = form['user']
-        role_manager = IPrincipalRoleManager(self.context)
-        role_map = IPrincipalRoleMap(self.context)
-        role_manager.assignRoleToPrincipal(localrole, user)
-        self.redirect(self.url(self.context, u'@@manage')+'#tab-3')
-        return
 
 class UniversityPage(WAeUPDisplayFormPage):
@@ -1006,11 +941,16 @@
         return 'Departments'
 
-class FacultyManageFormPage(ContainerManageFormPage):
+class FacultyManageFormPage(WAeUPEditFormPage):
     """Manage the basic properties of a `Faculty` instance.
     """
     grok.context(IFaculty)
+    grok.name('manage')
+    grok.require('waeup.manageUniversity')
     grok.template('facultymanagepage')
     pnav = 1
     subunits = 'Departments'
+    taboneactions = ['Save','Cancel']
+    tabtwoactions = ['Add department', 'Remove selected','Cancel']
+    tabthreeactions = ['Add local role', 'Remove local roles selected']
 
     form_fields = grok.AutoFields(IFaculty)
@@ -1028,4 +968,59 @@
         #warning.need()
         return super(FacultyManageFormPage, self).update()
+
+    def getLocalRoles(self):
+        roles = ILocalRolesAssignable(self.context)
+        return roles()
+
+    def getUsers(self):
+        """Get a list of all users.
+        """
+        for key, val in grok.getSite()['users'].items():
+            url = self.url(val)
+            yield(dict(url=url, name=key, val=val))
+
+    # ToDo: Show warning message before deletion
+    @grok.action('Remove selected')
+    def delSubobjects(self, **data):
+        form = self.request.form
+        if form.has_key('val_id'):
+            child_id = form['val_id']
+        else:
+            self.flash('No subunit selected!')
+            self.redirect(self.url(self.context, '@@manage')+'#tab-%s' % tab)
+            return
+        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-2')
+        return
+
+    @grok.action('Save')
+    def save(self, **data):
+        self.applyData(self.context, **data)
+        return
+
+    @grok.action('Cancel', validator=NullValidator)
+    def cancel(self, **data):
+        self.redirect(self.url(self.context))
+        return
+
+    @grok.action('Add department', validator=NullValidator)
+    def addSubunit(self, **data):
+        self.redirect(self.url(self.context, '@@add'))
+        return
+
+    @grok.action('Add local role', validator=NullValidator)
+    def addLocalRole(self, **data):
+        return addLocalRole(self, '3', **data)
 
 class DepartmentAddFormPage(WAeUPAddFormPage):
@@ -1110,4 +1105,7 @@
     tabtwoactions = ['Add course', 'Remove selected courses','Cancel']
     tabthreeactions = ['Add certificate', 'Remove selected certificates', 'Cancel']
+    tabfouractions = ['Add local role', 'Remove local roles selected']
+
+    form_fields = grok.AutoFields(IDepartment)
 
     @property
@@ -1138,6 +1136,15 @@
         super(DepartmentManageFormPage, self).update()
         return
-
-    form_fields = grok.AutoFields(IDepartment)
+        
+    def getLocalRoles(self):
+        roles = ILocalRolesAssignable(self.context)
+        return roles()
+
+    def getUsers(self):
+        """Get a list of all users.
+        """
+        for key, val in grok.getSite()['users'].items():
+            url = self.url(val)
+            yield(dict(url=url, name=key, val=val))
 
     @grok.action('Save')
@@ -1199,4 +1206,8 @@
         self.redirect(self.url(self.context))
         return
+        
+    @grok.action('Add local role', validator=NullValidator)
+    def addLocalRole(self, **data):
+        return addLocalRole(self, 4, **data)
 
 class CourseAddFormPage(WAeUPAddFormPage):
Index: main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/departmentmanagepage.pt
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/departmentmanagepage.pt	(revision 6151)
+++ main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/departmentmanagepage.pt	(revision 6152)
@@ -27,4 +27,5 @@
   <li><a href="#tab-2">Courses</a></li>
   <li><a href="#tab-3">Certificates</a></li>
+  <li><a href="#tab-4">Local Roles</a></li>
 </ul>
    
@@ -146,4 +147,44 @@
     </div>         
 </div> 
+
+<div id="tab-4">
+    <h3>Manage local roles</h3>
+    <table class="zebra">
+    <tr>
+        <td>
+        <label>User:</label>
+        </td>
+        <td>
+            <select  id="user" name="user"  tal:repeat="user view/getUsers">
+              <option tal:attributes="value user/name">
+                <span tal:replace="user/val/description">USERTITLE</span>
+              </option>
+            </select>
+        </td>
+    </tr>
+    <tr>
+        <td>
+        <label>Local Role:</label>
+        </td>
+        <td>
+            <select  id="local_role" name="local_role"  tal:repeat="localrole view/getLocalRoles">
+              <option tal:attributes="value localrole/name">
+                <span tal:replace="localrole/title">LOCALROLETITLE</span>
+              </option>
+            </select>
+        </td>
+    </tr>
+    </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.tabfouractions"
+                     tal:replace="structure action/render"/>
+            </span>
+        </span>
+    </div>
+</div>
     
 </div>
