Index: /waeup/branches/ulif-layout/src/waeup/browser/__init__.py
===================================================================
--- /waeup/branches/ulif-layout/src/waeup/browser/__init__.py	(revision 4584)
+++ /waeup/branches/ulif-layout/src/waeup/browser/__init__.py	(revision 4584)
@@ -0,0 +1,3 @@
+from waeup.browser.layout import (WAeUPPage, WAeUPLayout, WAeUPDisplayFormPage,
+                                  WAeUPEditFormPage, WAeUPAddFormPage,
+                                  LeftSidebarLink)
Index: /waeup/branches/ulif-layout/src/waeup/browser/layout.py
===================================================================
--- /waeup/branches/ulif-layout/src/waeup/browser/layout.py	(revision 4584)
+++ /waeup/branches/ulif-layout/src/waeup/browser/layout.py	(revision 4584)
@@ -0,0 +1,100 @@
+"""Basic layout components.
+"""
+import grok
+from hurry import yui
+from megrok.layout import Page, Layout, EditForm, DisplayForm, AddForm
+from waeup.interfaces import IWAeUPObject
+from waeup.viewlets import LeftSidebar
+from z3c.flashmessage.interfaces import IMessageSource
+from zope.component import queryUtility, ComponentLookupError
+from zope.interface import Interface
+# Conditional import. getSite moved to zope.site.hooks in recent grok versions.
+try:
+    from zope.site.hooks import getSite
+except ImportError:
+    from zope.app.component.hooks import getSite
+
+grok.templatedir('templates')
+    
+class UtilityView(object):
+    """A view mixin with useful methods.
+
+    XXX: This class was copied verbatim from megrok.layout trunk. It
+    can be imported with next release of megrok.layout, so that this
+    piece can be removed.
+    """
+    def application_url(self, name=None):
+        """Return the URL of the nearest site.
+        """
+        site = getSite()
+        #if not site:
+        #    raise ComponentLookupError("No site found.")
+        return self.url(site, name)
+
+    def flash(self, message, type='message'):
+        """Send a short message to the user.
+        """
+        source = queryUtility(IMessageSource, name='session')
+        if source is None:
+            return None
+        source.send(message, type)
+        return True
+
+class WAeUPLayout(Layout, UtilityView):
+    """A megrok.layout.Layout with additional methods.
+    """
+    grok.baseclass()
+    
+class WAeUPPage(Page, UtilityView):
+    """A megrok.layout page with additional methods.
+    """
+    grok.baseclass()
+
+class WAeUPDisplayFormPage(DisplayForm, UtilityView):
+    """A megrok.layout.DisplayForm with additional methods.
+    """
+    grok.baseclass()
+
+class WAeUPEditFormPage(EditForm, UtilityView):
+    """A megrok.layout.EditForm with additional methods.
+    """
+    grok.baseclass()
+
+class WAeUPAddFormPage(AddForm,  UtilityView):
+    """A megrok.layout.AddForm with additional methods.
+    """
+    grok.baseclass()
+
+class LeftSidebarLink(grok.Viewlet):
+    """ An entry on left sidebar.
+
+    This is only a baseclass that won't be rendered actually. Deriving
+    viewlets can override certain values and will be rendered with the
+    values set here as default.
+    """
+    grok.baseclass()
+    grok.viewletmanager(LeftSidebar)
+    grok.context(Interface)
+    grok.order(5)
+    grok.require('waeup.manageUniversity')
+
+    title = 'Text of link'
+    @property
+    def url(self):
+        return 'URL to link to'
+    
+    def render(self):
+        return u'<div class="portlet"><a href="%s">%s</a></div>' % (
+            self.url, self.title)
+
+class SiteLayout(WAeUPLayout):
+    """ The general site layout.
+    """
+    grok.context(IWAeUPObject)
+
+    def update(self):
+        yui.reset_fonts_grids.need()
+        yui.sam.need()
+        yui.tabview.need()
+        yui.layout.need()
+
Index: /waeup/branches/ulif-layout/src/waeup/browser/pages.py
===================================================================
--- /waeup/branches/ulif-layout/src/waeup/browser/pages.py	(revision 4584)
+++ /waeup/branches/ulif-layout/src/waeup/browser/pages.py	(revision 4584)
@@ -0,0 +1,43 @@
+# -*- coding: utf-8 -*-
+""" Viewing components for WAeUP objects.
+"""
+import grok
+from waeup.browser import WAeUPPage, WAeUPEditFormPage
+from waeup.interfaces import IUniversity
+from waeup.widgets.interfaces import ITableProvider
+
+grok.templatedir('templates')
+
+class UniversityPage(WAeUPPage):
+    """ The main university page.
+    """
+    grok.name('index')
+    grok.context(IUniversity)
+
+    def update(self):
+        self.table = ITableProvider(self.context).getTables(self)[0]
+        self.table.need()
+
+class Manage(WAeUPEditFormPage):
+    """Manage the basic properties of a `University` instance.
+    """
+    form_fields = grok.AutoFields(IUniversity)
+    grok.context(IUniversity)
+    grok.require('waeup.manageUniversity')
+
+    @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.flash('Action cancelled.')
+        self.redirect(self.url(self.context))
+        return
Index: /waeup/branches/ulif-layout/src/waeup/browser/templates/manageaction.pt
===================================================================
--- /waeup/branches/ulif-layout/src/waeup/browser/templates/manageaction.pt	(revision 4584)
+++ /waeup/branches/ulif-layout/src/waeup/browser/templates/manageaction.pt	(revision 4584)
@@ -0,0 +1,9 @@
+<span class="yui-button yui-link-button" noclass="actionbarlink">
+  <span class="first-child">
+    <a href="" id="linkbutton1"
+       tal:attributes="href python: view.url(context) + '/@@manage'">
+      <img alt="edit"
+	   tal:attributes="src static/actionicon_modify.png"/>
+    <span>Edit settings</span></a>
+  </span>
+</span>
Index: /waeup/branches/ulif-layout/src/waeup/browser/templates/managefacultiesaction.pt
===================================================================
--- /waeup/branches/ulif-layout/src/waeup/browser/templates/managefacultiesaction.pt	(revision 4584)
+++ /waeup/branches/ulif-layout/src/waeup/browser/templates/managefacultiesaction.pt	(revision 4584)
@@ -0,0 +1,10 @@
+<span class="yui-button yui-link-button" noclass="actionbarlink">
+  <span class="first-child">
+    <a href="" id="linkbutton1"
+       tal:attributes="href python: view.url(
+		       context, 'faculties')">
+      <img alt="edit"
+	   tal:attributes="src static/actionicon_manage.png"/>
+    <span>Browse faculties</span></a>
+  </span>
+</span>
Index: /waeup/branches/ulif-layout/src/waeup/browser/templates/sitelayout.pt
===================================================================
--- /waeup/branches/ulif-layout/src/waeup/browser/templates/sitelayout.pt	(revision 4584)
+++ /waeup/branches/ulif-layout/src/waeup/browser/templates/sitelayout.pt	(revision 4584)
@@ -0,0 +1,62 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+<base href="http://localhost:8080/app/@@page" />
+    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+    <meta name="robots" content="index, follow" />
+    <tal:head content="structure provider:head" />
+
+    <link rel="shortcut icon" tal:attributes="href static/favicon.ico" 
+	  type="image/x-icon" />
+
+</head>
+<body id="doc233" noclass="yui-t2" class="yui-skin-sam">
+  <div id="hd">
+    <tal:header content="structure provider:header" />
+    <div id="navbar" class="yui-navset" style="text-align:right;">
+      <ul class="yui-nav">
+	<li>
+	  <a tal:attributes="href 
+			     python:view.application_url() + '/faculties'">
+	<em>Faculties</em></a></li>
+	<li>
+	  <a tal:attributes="href
+			     python:view.application_url() + '/@@search'">
+	<em>Search</em></a></li>
+      </ul>
+    </div>
+  </div>
+
+  <div id="yui-main" class="yui-main">
+
+<!--
+    <tal:breadcrumbs content="structure provider:breadcrumbs" />
+-->
+
+    <div tal:content="structure context/@@messages">
+      MESSAGE
+    </div>
+
+    <div>
+      <tal:actionbar content="structure provider:actionbar" />
+    </div>
+
+    <div id="innermain">
+      <div noclass="yui-b">
+	<div tal:replace="structure view/content">
+	  THE CONTENT
+	</div>
+      </div>
+    </div>
+  </div>
+  <div id="left" noclass="yui-b">
+    <tal:left content="structure provider:left" />
+  </div>
+
+  <div id="ft">
+    <tal:footer content="structure provider:footer" />
+  </div>
+  
+</body>
+</html>
Index: /waeup/branches/ulif-layout/src/waeup/browser/templates/universitypage.pt
===================================================================
--- /waeup/branches/ulif-layout/src/waeup/browser/templates/universitypage.pt	(revision 4584)
+++ /waeup/branches/ulif-layout/src/waeup/browser/templates/universitypage.pt	(revision 4584)
@@ -0,0 +1,14 @@
+<div class="unilayout" tal:content="context/name">
+  University Name
+</div>
+<div>
+  This is the default frontpage of the Student Registration Portal
+  (SRP) which is part of the West African e-University Project
+  (<a href="http://www.waeup.org/">WAeUP</a>).
+</div>
+
+<div name="tableexample" class="yui-skin-sam">
+  <div tal:replace="structure view/table/renderHTML" />
+</div>
+
+  
Index: /waeup/branches/ulif-layout/src/waeup/browser/viewlets.py
===================================================================
--- /waeup/branches/ulif-layout/src/waeup/browser/viewlets.py	(revision 4584)
+++ /waeup/branches/ulif-layout/src/waeup/browser/viewlets.py	(revision 4584)
@@ -0,0 +1,81 @@
+# -*- coding: utf-8 -*-
+
+import grok
+
+from hurry import yui
+from zope.component import getMultiAdapter
+from zope.location.interfaces import ISite
+from waeup.browser.pages import UniversityPage
+from waeup.interfaces import (IUniversity, IWAeUPObject, IWAeUPXMLExporter,
+                              IWAeUPXMLImporter, IFacultyContainer, IFaculty,
+                              IDepartment, ICourse, ICertificate,
+                              ICertificateCourse,)
+from waeup.utils.helpers import getInnerHTMLPart
+from waeup.viewlets import LeftSidebar, ActionBar
+
+grok.templatedir('templates')
+
+#grok.context(zope.interface.Interface)
+
+#
+# waeup.app.University viewlets...
+#
+class ManageLink(grok.Viewlet):
+    grok.viewletmanager(LeftSidebar)
+    grok.context(IUniversity)
+    grok.view(UniversityPage)
+    grok.order(5)
+    # This link is only displayed, if the user is
+    # allowed to use it!
+    grok.require('waeup.manageUniversity')
+    
+    def render(self):
+        return u'<div class="portlet"><a href="manage">Settings</a></div>'
+
+class ManageFacultiesLink(grok.Viewlet):
+    grok.viewletmanager(LeftSidebar)
+    grok.context(IUniversity)
+    grok.view(UniversityPage)
+    grok.order(6)
+    # This is so cool! This link is only displayed, when the user is
+    # allowed to use it!
+    grok.require('waeup.manageUniversity')
+    
+    def render(self):
+        return u'<div class="portlet"><a href="faculties">Manage faculties</a></div>'
+
+class ManageUsersLink(grok.Viewlet):
+    grok.viewletmanager(LeftSidebar)
+    grok.context(IUniversity)
+    grok.view(UniversityPage)
+    grok.order(6)
+    grok.require('waeup.manageUsers')
+
+    def render(self):
+        return u'<div class="portlet"><a href="users">Manage users</a></div>'
+
+class ManageDataCenter(grok.Viewlet):
+    grok.viewletmanager(LeftSidebar)
+    grok.context(IUniversity)
+    grok.view(UniversityPage)
+    grok.order(6)
+    grok.require('waeup.manageUniversity')
+
+    def render(self):
+        return u'<div class="portlet"><a href="datacenter">Data Center</a></div>'
+
+class ManageUniversityAction(grok.Viewlet):
+    grok.viewletmanager(ActionBar)
+    grok.context(IUniversity)
+    grok.view(UniversityPage)
+    grok.require('waeup.manageUniversity')
+    grok.order(2)
+    grok.template('manageaction')
+
+class GoToFacultiesAction(grok.Viewlet):
+    grok.viewletmanager(ActionBar)
+    grok.context(IUniversity)
+    grok.view(UniversityPage)
+    grok.require('waeup.manageUniversity')
+    grok.order(3)
+    grok.template('managefacultiesaction')
