Index: /waeup/branches/ulif-layout/src/waeup/browser/pages.py
===================================================================
--- /waeup/branches/ulif-layout/src/waeup/browser/pages.py	(revision 4734)
+++ /waeup/branches/ulif-layout/src/waeup/browser/pages.py	(revision 4735)
@@ -15,5 +15,6 @@
 from waeup.interfaces import (IUniversity, IWAeUPObject, IUserContainer,
                               IUserAccount, IFacultyContainer, IDataCenter,
-                              IFaculty, IDepartment, ICourse, ICertificate)
+                              IFaculty, IDepartment, ICourse, ICertificate,
+                              ICertificateCourse)
 from waeup.widgets.interfaces import ITableProvider
 from waeup.utils.helpers import getName
@@ -709,2 +710,105 @@
             levels[str(level)][str(semester)].append(new_entry)
         return levels
+
+class CertificateManageForm(WAeUPEditFormPage):
+    """Manage the basic properties of a `Certificate` instance.
+    """
+    grok.context(ICertificate)
+    grok.name('manage')
+    grok.require('waeup.manageUniversity')
+    form_fields = grok.AutoFields(ICertificate)
+    pnav = 1
+
+    @property
+    def title(self):
+        # Set certificate name as form label
+        return self.form_fields['title'].field.get(self.context)
+    
+    @grok.action('Save')
+    def save(self, **data):
+        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
+
+    @grok.action('Cancel')
+    def cancel(self, **data):
+        self.redirect(self.url(self.context))
+        return
+
+#
+# Certificate course pages...
+#
+class CertificateCoursePage(WAeUPDisplayFormPage):
+    """Course index page.
+    """
+    grok.context(ICertificateCourse)
+    grok.name('index')
+    grok.require('waeup.View')
+    pnav = 1
+    form_fields = grok.AutoFields(ICertificateCourse)
+
+    @property
+    def title(self):
+        return self.context.course.title
+
+class CertificateCourseFormPage(WAeUPEditFormPage):
+    """Manage the basic properties of a `CertificateCourse` instance.
+    """
+    grok.context(ICertificateCourse)
+    grok.name('manage')
+    grok.require('waeup.manageUniversity')
+    form_fields = grok.AutoFields(ICertificateCourse)
+    pnav = 1
+    
+    @property
+    def title(self):
+        return 'Edit certificate course %s' % self.context.course.code
+    
+    @grok.action('Save and return')
+    def saveAndReturn(self, **data):
+        parent = self.context.__parent__
+        if self.context.level == data['level']:
+            self.applyData(self.context, **data)
+        else:
+            # The level changed. We have to create a new certcourse as
+            # the key of the entry will change as well...
+            old_level = self.context.level
+            parent.addCourseRef(**data)
+            parent.delCourseRef(data['course'].code, level=old_level)
+        self.redirect(self.url(parent))
+        return
+
+    @grok.action('Cancel')
+    def cancel(self, **data):
+        self.redirect(self.url(self.context))
+        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(ICertificateCourse)
+    pnav = 1
+    title = 'Add a course'
+
+    @grok.action('Add course')
+    def addCertcourse(self, **data):
+        try:
+            self.context.addCourseRef(**data)
+        except DuplicationError:
+            self.status = Invalid('The chosen course is already part of'
+                                  'this certificate')
+            return
+        self.redirect(self.url(self.context))
+
+    @grok.action('Cancel')
+    def cancel(self, **data):
+        self.redirect(self.url(self.context))
+        return
