Index: waeup/branches/hraban/src/waeup/README.txt
===================================================================
--- waeup/branches/hraban/src/waeup/README.txt	(revision 3669)
+++ waeup/branches/hraban/src/waeup/README.txt	(revision 3737)
@@ -1,2 +1,4 @@
+.. $Id$
+
 The waeup package
 ********************
Index: waeup/branches/hraban/src/waeup/__init__.py
===================================================================
--- waeup/branches/hraban/src/waeup/__init__.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/__init__.py	(revision 3737)
@@ -0,0 +1,1 @@
+# $Id$
Index: waeup/branches/hraban/src/waeup/app.py
===================================================================
--- waeup/branches/hraban/src/waeup/app.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/app.py	(revision 3737)
@@ -1,2 +1,3 @@
+# $Id$
 import grok
 #from zope.interface import Interface
@@ -17,12 +18,7 @@
         self.__dict__.update(kw)
         
-        sc = studentcontainer.StudentContainer()
-        self["students"] = sc        
-    
-        hc = hostelcontainer.HostelContainer()
-        self["hostels"] = hc
-    
-        fc = facultycontainer.FacultyContainer()
-        self["faculties"] = fc
+        self["students"] = studentcontainer.StudentContainer()        
+        self["hostels"] = hostelcontainer.HostelContainer()
+        self["faculties"] = facultycontainer.FacultyContainer()
 
 #class Content(grok.Viewlet):
Index: waeup/branches/hraban/src/waeup/app_templates/content.pt
===================================================================
--- waeup/branches/hraban/src/waeup/app_templates/content.pt	(revision 3669)
+++ waeup/branches/hraban/src/waeup/app_templates/content.pt	(revision 3737)
@@ -1,2 +1,3 @@
+<!-- $Id$ -->
   <ul>
     <li tal:repeat="fac context/values">
Index: waeup/branches/hraban/src/waeup/app_templates/master.pt
===================================================================
--- waeup/branches/hraban/src/waeup/app_templates/master.pt	(revision 3669)
+++ waeup/branches/hraban/src/waeup/app_templates/master.pt	(revision 3737)
@@ -2,4 +2,5 @@
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
+<!-- $Id$ -->
 	<head>
 		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
Index: waeup/branches/hraban/src/waeup/basecontainer.py
===================================================================
--- waeup/branches/hraban/src/waeup/basecontainer.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/basecontainer.py	(revision 3737)
@@ -1,3 +1,4 @@
 # -*- coding: utf-8 -*-
+# $Id$
 import grok
 import os
@@ -5,4 +6,5 @@
 import waeup.viewlets as vw
 from zope.component import getMultiAdapter
+from waeup.permissions import *
 
 class BaseContainer(grok.Container):
@@ -20,18 +22,24 @@
         super(BaseContainer, self).__init__()
         self.__dict__.update(kwargs)
-    
-class Content(grok.Viewlet):
-    """
-    Base viewlet
-    """
-    grok.viewletmanager(vw.MainArea)
-    grok.view(vw.Index)
-    #grok.order(1)
+        self.ViewPermission = ViewBase
+        self.AddPermission = AddBase
+        self.EditPermission = EditBase
+
+## Forms
+
+class DisplayForm(grok.DisplayForm):
+    grok.template('content')
+
+    def __init__(self, context, request):
+        super(DisplayForm, self).__init__(context, request)
+        self.form_fields = grok.AutoFields(self.context.__class__)
 
 class AddForm(grok.AddForm):
-    template = grok.PageTemplate(filename=os.path.join('basecontainer_templates', 'edit_form.pt'))
+    #template = grok.PageTemplate(filename=os.path.join('basecontainer_templates', 'edit_form.pt'))
+    grok.template('edit_form')
 
     def __init__(self, context, request):
         super(AddForm, self).__init__(context, request)
+        # ein Objekt der untergeordneten Klasse hinzufügen!
         self.form_fields = grok.AutoFields(self.context.childClass)
 
@@ -40,9 +48,11 @@
         obj = self.context.childClass(**data)
         id = data['id'].lower()
-        self.context[id] = obj # schlägt fehlt bei nicht-Container-Objekten (not iterable)
+        #print "Add to container %s, ID %s, Obj %s" % (self.context, id, obj)
+        self.context[id] = obj # schlägt fehlt bei falschem Interface! (not iterable)
         self.redirect(self.url('@@index'))
 
 class EditForm(grok.EditForm):
-    template = grok.PageTemplate(filename=os.path.join('basecontainer_templates', 'edit_form.pt'))
+    #template = grok.PageTemplate(filename=os.path.join('basecontainer_templates', 'edit_form.pt'))
+    grok.template('edit_form')
     #form_fields = grok.AutoFields(BaseContainer)
 
@@ -51,8 +61,23 @@
         self.form_fields = grok.AutoFields(self.context.__class__)
         
-    def handle_edit_action(self, **data):
-        grok.EditForm.handle_edit_action(self, **data)
-        self.redirect(self.url('@@index'))
+#    def handle_edit_action(self, **data):
+#        grok.EditForm.handle_edit_action(self, **data)
+#        self.redirect(self.url('@@index'))
 
+## Viewlets
+
+class DisplayViewlet(grok.Viewlet):
+    grok.viewletmanager(vw.MainArea)
+    grok.context(IBaseContainer)
+    grok.view(vw.Index)
+
+    def update(self):
+        self.form = getMultiAdapter((self.context, self.request),
+                                    name='displayform')
+        self.form.update_form()
+
+    def render(self):
+        return self.form.render()
+    
 class AddViewlet(grok.Viewlet):
     grok.viewletmanager(vw.MainArea)
Index: waeup/branches/hraban/src/waeup/basecontainer_templates/content.pt
===================================================================
--- waeup/branches/hraban/src/waeup/basecontainer_templates/content.pt	(revision 3669)
+++ waeup/branches/hraban/src/waeup/basecontainer_templates/content.pt	(revision 3737)
@@ -1,2 +1,10 @@
+<!-- $Id$ -->
+<div class="breadcrumbs">
+		<a href="" tal:attributes="href python:view.url(context.__parent__)">
+		<span tal:condition="exists:context/__parent__/title" tal:content="context/__parent__/title">Part of</span>
+		<span tal:condition="exists:context/__parent__/name" tal:content="context/__parent__/name">Parent</span>
+		</a>
+</div>
+<h2><span tal:condition="exists:context/title" tal:content="context/title">Part of</span> <span tal:content="context/name">Objects</span></h2>
 <div class="menubar">
 	<ul>
@@ -11,6 +19,32 @@
 </div>
 
-<h2 tal:content="context/name">Objects</h2>
+<div class="form-fields">
+<h3>
+	<tal:block tal:condition="exists:context/childClass/plural_name" ><span tal:content="context/childClass/plural_name">Parts</span>
+	in </tal:block><span tal:condition="exists:context/title" tal:content="context/title">Part of</span> <span tal:content="context/name">Objects</span>:
+</h3>
 <ul>
-	<li tal:repeat="item context/values"><a  tal:condition="exists:item/name" href="" tal:attributes="href  python:view.url(item)" tal:content="item/name">Item</a></li>
+	<li tal:repeat="item context/values" class="form-line">
+		<a tal:condition="exists:item/name" href="" tal:attributes="href  python:view.url(item)" tal:content="item/name" class="field">Item</a>
+	</li>
 </ul>
+</div>
+
+<div class="form-fields">
+    <tal:block repeat="widget view/widgets">
+        <div class="form-line">
+            <span class="label" tal:content="widget/label">label</span>: 
+            <span class="field" tal:content="structure widget">value</span>
+        </div>
+    </tal:block>
+</div>
+
+
+<div class="form-fields introspection">
+    <tal:block repeat="item python:context.__dict__.keys()">
+        <div class="form-line">
+            <span class="label" tal:content="item">Key</span>: 
+            <span class="field" tal:content="python:context.__dict__[item]">Value</span>
+        </div>
+    </tal:block>
+</div>
Index: waeup/branches/hraban/src/waeup/basecontainer_templates/edit_form.pt
===================================================================
--- waeup/branches/hraban/src/waeup/basecontainer_templates/edit_form.pt	(revision 3669)
+++ waeup/branches/hraban/src/waeup/basecontainer_templates/edit_form.pt	(revision 3737)
@@ -1,20 +1,17 @@
+<!-- $Id -->
 <form action="." tal:attributes="action request/URL" method="post" class="edit-form" enctype="multipart/form-data">
-    <!--
-    <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
+    
+    <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>
-    <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>
-    -->
+    
     <div class="form-fields">
         <tal:block repeat="widget view/widgets">
@@ -22,10 +19,10 @@
                 <span class="label" tal:define="hint widget/hint">
                     <label tal:condition="python:hint" tal:attributes="for widget/name">
+                        <span i18n:translate="" tal:content="widget/label">label</span>
                         <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 i18n:translate="" tal:content="widget/label">label</span>
                         <span class="required" tal:condition="widget/required">*</span>
-                        <span i18n:translate="" tal:content="widget/label">label</span>
                     </label>
                 </span>
Index: waeup/branches/hraban/src/waeup/baseitem.py
===================================================================
--- waeup/branches/hraban/src/waeup/baseitem.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/baseitem.py	(revision 3737)
@@ -1,3 +1,4 @@
-# baseitem.py
+# -*- coding: utf-8 -*-
+# $Id$
 import os
 import grok
@@ -5,4 +6,5 @@
 from waeup.interfaces import IBaseItem
 from zope.component import getMultiAdapter
+from waeup.permissions import *
 
 class BaseItem(grok.Model):
@@ -14,19 +16,28 @@
     def __init__(self, **kwargs):
         super(BaseItem, self).__init__()
+        self.ViewPermission = ViewBase
+        self.AddPermission = AddBase
+        self.EditPermission = EditBase
         self.__dict__.update(kwargs)
 
-class Index(grok.Viewlet):
-    grok.viewletmanager(vw.MainArea)
-    #grok.context(IBaseItem)
-    #grok.order(1)
-    #grok.View(Index) # warum gibt das hier einen Fehler?
+## Forms
+
+class DisplayForm(grok.DisplayForm):
+    #template = grok.PageTemplate(filename=os.path.join('baseitem_templates', 'content.pt'))
     grok.template('content')
 
+    def __init__(self, context, request):
+        super(DisplayForm, self).__init__(context, request)
+        self.form_fields = grok.AutoFields(self.context.__class__)
+
+# Wird wahrscheinlich nie benutzt - was sollte man einem Item hinzufügen?
 class AddForm(grok.AddForm):
     template = grok.PageTemplate(filename=os.path.join('basecontainer_templates', 'edit_form.pt'))
+    
 
     def __init__(self, context, request):
         super(AddForm, self).__init__(context, request)
-        self.form_fields = grok.AutoFields(self.context-__class__) #.childClass)
+        self.form_fields = grok.AutoFields(self.context.__class__)
+        #grok.require(context.__class__.AddPermission)
 
     @grok.action('Add item')
@@ -34,4 +45,5 @@
         obj = self.context.__class__(**data) #.childClass(**data)
         id = data['id'].lower()
+        print "Add to item %s, ID %s, Obj %s" % (self.context, id, obj)
         self.context[id] = obj
         self.redirect(self.url('@@index'))
@@ -39,12 +51,42 @@
 class EditForm(grok.EditForm):
     template = grok.PageTemplate(filename=os.path.join('basecontainer_templates', 'edit_form.pt'))
+    
    
     def __init__(self, context, request):
         super(EditForm, self).__init__(context, request)
         self.form_fields = grok.AutoFields(self.context.__class__)
-       
-    def handle_edit_action(self, **data):
-        grok.EditForm.handle_edit_action(self, **data)
-        self.redirect(self.url('@@index'))
+        #grok.require(context.__class__.EditPermission)
+
+#    def handle_edit_action(self, **data):
+#        grok.EditForm.handle_edit_action(self, **data)
+
+#    @grok.action(u"Edit item")
+#    def edit(self, **data):
+#        id = data['id'].lower()
+#        obj = self.context[id]
+#        self.applyData(obj, **data)
+#        self.redirect(self.url('@@index')) # FIXME: funktioniert nicht!?
+
+## Viewlets
+
+class DisplayViewlet(grok.Viewlet):
+    grok.viewletmanager(vw.MainArea)
+    grok.context(IBaseItem)
+    grok.view(vw.Index)
+    #grok.order(1)
+    #grok.template('content')
+    
+    #def __init__(self, context, request, *other):
+    #    super(Index, self).__init__(context, request, *other)
+    #    grok.require(self.context.__class__.ViewPermission)
+
+    def update(self):
+        self.form = getMultiAdapter((self.context, self.request),
+                                    name='displayform')
+        self.form.update_form()
+
+    def render(self):
+        return self.form.render()
+
 
 class AddViewlet(grok.Viewlet):
Index: waeup/branches/hraban/src/waeup/baseitem_templates/content.pt
===================================================================
--- waeup/branches/hraban/src/waeup/baseitem_templates/content.pt	(revision 3669)
+++ waeup/branches/hraban/src/waeup/baseitem_templates/content.pt	(revision 3737)
@@ -1,8 +1,33 @@
+<!-- $Id$ -->
+<div class="breadcrumbs">
+		<a href="" tal:attributes="href python:view.url(context.__parent__)">
+		<span tal:condition="exists:context/__parent__/title" tal:content="context/__parent__/title">Part of</span>
+		<span tal:condition="exists:context/__parent__/name" tal:content="context/__parent__/name">Parent</span>
+		</a>
+</div>
+<h2><span tal:condition="exists:context/title" tal:content="context/title">Part of</span> <span tal:content="context/name">Objects</span></h2>
 <div class="menubar">
 	<ul>
 		<li><a href="" tal:attributes="href python:view.url(context.__parent__)">Up</a></li>
 		<li><a href="" tal:attributes="href python:view.url(context, '@@edit')">Edit</a></li>
-		<li><a href="" tal:attributes="href python:view.url(context, '@@add')">Add</a></li>
+		<!-- <li><a href="" tal:attributes="href python:view.url(context, '@@add')">Add</a></li> -->
 	</ul>
 </div>
-<h2>Object <span tal:replace="context/name">Name</span></h2>
+
+<div class="form-fields">
+    <tal:block repeat="widget view/widgets">
+        <div class="form-line">
+            <span class="label" tal:content="widget/label">label</span>: 
+            <span class="field" tal:content="structure widget">value</span>
+        </div>
+    </tal:block>
+</div>
+
+<div class="form-fields introspection">
+    <tal:block repeat="item python:context.__dict__.keys()">
+        <div class="form-line">
+            <span class="label" tal:content="item">Key</span>: 
+            <span class="field" tal:content="python:context.__dict__[item]">Value</span>
+        </div>
+    </tal:block>
+</div>
Index: waeup/branches/hraban/src/waeup/baseitem_templates/edit_form.pt
===================================================================
--- waeup/branches/hraban/src/waeup/baseitem_templates/edit_form.pt	(revision 3669)
+++ waeup/branches/hraban/src/waeup/baseitem_templates/edit_form.pt	(revision 3737)
@@ -1,2 +1,4 @@
+<!-- $Id$ -->
+<!-- Achtung, wird nicht benutzt! Statt dessen "basecontainer_templates/edit_form.pt"! -->
 <form action="." tal:attributes="action request/URL" method="post"
       class="edit-form" enctype="multipart/form-data">
Index: waeup/branches/hraban/src/waeup/baseitem_templates/index.pt
===================================================================
--- waeup/branches/hraban/src/waeup/baseitem_templates/index.pt	(revision 3737)
+++ waeup/branches/hraban/src/waeup/baseitem_templates/index.pt	(revision 3737)
@@ -0,0 +1,1 @@
+<!-- $Id$ -->
Index: waeup/branches/hraban/src/waeup/browser.txt
===================================================================
--- waeup/branches/hraban/src/waeup/browser.txt	(revision 3669)
+++ waeup/branches/hraban/src/waeup/browser.txt	(revision 3737)
@@ -1,2 +1,4 @@
+.. $Id$
+
 The waeup package
 ********************
Index: waeup/branches/hraban/src/waeup/catalog.py
===================================================================
--- waeup/branches/hraban/src/waeup/catalog.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/catalog.py	(revision 3737)
@@ -1,2 +1,3 @@
+# $Id$
 import grok, grok.index
 from hurry.query.query import Query, Text
Index: waeup/branches/hraban/src/waeup/catalog_templates/studentsearch.pt
===================================================================
--- waeup/branches/hraban/src/waeup/catalog_templates/studentsearch.pt	(revision 3669)
+++ waeup/branches/hraban/src/waeup/catalog_templates/studentsearch.pt	(revision 3737)
@@ -1,2 +1,3 @@
+<!-- $Id$ -->
 <div class="portlet">
   <form>
Index: waeup/branches/hraban/src/waeup/docs/faq-staff-de.rst
===================================================================
--- waeup/branches/hraban/src/waeup/docs/faq-staff-de.rst	(revision 3669)
+++ waeup/branches/hraban/src/waeup/docs/faq-staff-de.rst	(revision 3737)
@@ -1,2 +1,3 @@
+.. $Id$
 =============
 FAQ (deutsch)
Index: waeup/branches/hraban/src/waeup/hostel/__init__.py
===================================================================
--- waeup/branches/hraban/src/waeup/hostel/__init__.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/hostel/__init__.py	(revision 3737)
@@ -1,2 +1,3 @@
+# $Id$
 from interfaces import IHostel
 from hostelcontainer import HostelContainer
Index: waeup/branches/hraban/src/waeup/hostel/hostel.py
===================================================================
--- waeup/branches/hraban/src/waeup/hostel/hostel.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/hostel/hostel.py	(revision 3737)
@@ -1,6 +1,7 @@
+# $Id$
 import grok
 import waeup.baseitem as base
 from waeup.hostel.interfaces import IHostel
-
+from waeup.hostel.permissions import *
 
 class Hostel(base.BaseItem):
@@ -9,2 +10,5 @@
     grok.implements(IHostel)
     name = u'Hostel'
+    ViewPermission = ViewHostel
+    AddPermission = AddHostel
+    EditPermission = EditHostel
Index: waeup/branches/hraban/src/waeup/hostel/hostelcontainer.py
===================================================================
--- waeup/branches/hraban/src/waeup/hostel/hostelcontainer.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/hostel/hostelcontainer.py	(revision 3737)
@@ -1,2 +1,3 @@
+# $Id$
 import grok
 from waeup.hostel.interfaces import IHostelContainer
Index: waeup/branches/hraban/src/waeup/hostel/interfaces.py
===================================================================
--- waeup/branches/hraban/src/waeup/hostel/interfaces.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/hostel/interfaces.py	(revision 3737)
@@ -1,4 +1,3 @@
-##
-## interfaces.py
+# $Id$
 import grok
 import re
Index: waeup/branches/hraban/src/waeup/hostel/permissions.py
===================================================================
--- waeup/branches/hraban/src/waeup/hostel/permissions.py	(revision 3737)
+++ waeup/branches/hraban/src/waeup/hostel/permissions.py	(revision 3737)
@@ -0,0 +1,21 @@
+# $Id$
+import grok
+
+class ViewHostel(grok.Permission):
+    grok.name('waeup.hostels.ViewHostel')
+    grok.title('View Hostel')
+    
+
+class ViewHostelDetails(grok.Permission):
+    grok.name('waeup.hostels.ViewHostelDetails')
+    grok.title('View Hostel Details')
+
+
+class EditHostel(grok.Permission):
+    grok.name('waeup.hostels.EditHostel')
+    grok.title('Edit Hostel')
+    
+
+class AddHostel(grok.Permission):
+    grok.name('waeup.hostels.AddHostel')
+    grok.title('Add Hostel')
Index: waeup/branches/hraban/src/waeup/interfaces.py
===================================================================
--- waeup/branches/hraban/src/waeup/interfaces.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/interfaces.py	(revision 3737)
@@ -1,4 +1,4 @@
-##
 ## interfaces.py
+# $Id$
 import grok
 import re
@@ -41,5 +41,4 @@
         )
 
-
 class IUniversity(grok.interfaces.IContainer):
     """Representation of a university.
Index: waeup/branches/hraban/src/waeup/permissions.py
===================================================================
--- waeup/branches/hraban/src/waeup/permissions.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/permissions.py	(revision 3737)
@@ -1,5 +1,28 @@
+# $Id$
 import grok
 
-class FacultyRead(grok.Permission):
-    grok.name('waeup.facultyread')
 
+class ViewBase(grok.Permission):
+    grok.name('waeup.ViewBase')
+    grok.title('View Base')
+    
+class EditBase(grok.Permission):
+    grok.name('waeup.EditBase')
+    grok.title('Edit Base')
+    
+class AddBase(grok.Permission):
+    grok.name('waeup.AddBase')
+    grok.title('Add Base')
+
+
+class ViewUniversity(grok.Permission):
+    grok.name('waeup.ViewUniversity')
+    grok.title('View University')
+    
+class EditUniversity(grok.Permission):
+    grok.name('waeup.EditUniversity')
+    grok.title('Edit University')
+    
+class AddUniversity(grok.Permission):
+    grok.name('waeup.AddUniversity')
+    grok.title('Add University')
Index: waeup/branches/hraban/src/waeup/static/app.css
===================================================================
--- waeup/branches/hraban/src/waeup/static/app.css	(revision 3669)
+++ waeup/branches/hraban/src/waeup/static/app.css	(revision 3737)
@@ -1,2 +1,4 @@
+/* $Id */
+
 html {
 	font-family: JansonText, Georgia, Times;
@@ -35,5 +37,5 @@
 
 #logo img {
-	align: left;
+	text-align: left;
 	float: left;
 	padding-right: 2em;
@@ -129,4 +131,5 @@
 	border: 1px solid #feb;
 	padding: 1em;
+	margin-bottom: 1em;
 }
 
@@ -134,9 +137,12 @@
 	min-height: 1em;
 	clear: both;
+	padding: 0.125em 0 0.125em 0;
 }
 
 .form-fields .label {
-	width: 20em;
+	display: inline-block;
+	width: 10em;
 	padding-right: 1em;
+	vertical-align: top;
 }
 
@@ -147,5 +153,4 @@
 
 .form-fields .field {
-	
 }
 
@@ -154,2 +159,25 @@
 	width: 30em;
 }
+
+dl {
+	clear: both;
+}
+
+dl dt {
+	min-width: 10em;
+	float: left;
+	clear: left;
+	font-weight: bold;
+}
+
+dl dd {
+	float: left;
+}
+
+.introspection > * {
+	display:none;
+}
+
+.introspection:hover > * {
+	display: block;
+}
Index: waeup/branches/hraban/src/waeup/students/__init__.py
===================================================================
--- waeup/branches/hraban/src/waeup/students/__init__.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/students/__init__.py	(revision 3737)
@@ -0,0 +1,1 @@
+# $Id$
Index: waeup/branches/hraban/src/waeup/students/interfaces.py
===================================================================
--- waeup/branches/hraban/src/waeup/students/interfaces.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/students/interfaces.py	(revision 3737)
@@ -1,4 +1,3 @@
-##
-## interfaces.py
+# $Id$
 import grok
 import re
@@ -10,5 +9,5 @@
     pass
 
-class IStudent(Interface):
+class IStudent(IBaseItem):
     """Representation of a student.
     """
@@ -18,4 +17,9 @@
         required = True,
         constraint=(re.compile("^([A-Z]\d{6})?$").match)
+        )
+    name = schema.TextLine(
+        title = u'Name of student',
+        default = u'Nobody',
+        required = True,
         )
     entry_mode = schema.ASCIILine( # Choice?
@@ -32,11 +36,6 @@
         max=600
         )
-    name = schema.TextLine(
-        title = u'Name of student',
-        default = u'Nobody',
-        required = True,
-        )
     jamb_reg_no = schema.ASCIILine(
-        title = u'JAMB Reg. No.',
+        title = u'JAMB Reg. No.', # wie ZVS
         default = '',
         required = False,
Index: waeup/branches/hraban/src/waeup/students/permissions.py
===================================================================
--- waeup/branches/hraban/src/waeup/students/permissions.py	(revision 3737)
+++ waeup/branches/hraban/src/waeup/students/permissions.py	(revision 3737)
@@ -0,0 +1,21 @@
+# $Id$
+import grok
+
+class ViewStudent(grok.Permission):
+    grok.name('waeup.students.ViewStudent')
+    grok.title('View Student')
+    
+
+class ViewStudentDetails(grok.Permission):
+    grok.name('waeup.students.ViewStudentDetails')
+    grok.title('View Student Details')
+
+
+class EditStudent(grok.Permission):
+    grok.name('waeup.students.EditStudent')
+    grok.title('Edit Student')
+    
+
+class AddStudent(grok.Permission):
+    grok.name('waeup.students.AddStudent')
+    grok.title('Add Student')
Index: waeup/branches/hraban/src/waeup/students/student.py
===================================================================
--- waeup/branches/hraban/src/waeup/students/student.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/students/student.py	(revision 3737)
@@ -1,5 +1,7 @@
+# $Id$
 import grok
 import waeup.baseitem as base
 from interfaces import IStudent
+from waeup.students.permissions import *
 
 def fromCsv(a):
@@ -20,36 +22,41 @@
     grok.implements(IStudent)
     name = u'Student'
-
-    fields = [   "entry_mode",
-                 "end_level",
-                 "name",
-                 "jamb_reg_no",
-                 "level",
-                 "id",
-                 "lga",
-                 "entry_session",
-                 "matric_no",
-                 "sex",
-                 "phone",
-                 "session",
-                 "course",
-                 "mode",
-                 "faculty",
-                 "department",
-                 "verdict",
-                 "review_state",
-                 "perm_address",
-                 "email"
-            ]
-        
-
-    def getCsv(self):
-        #return self.entry_mode, self.end_level, self.name, self.jamb_reg_no, self.level, self.id, self.lga, self.entry_session, self.matric_no, self.sex, self.phone, self.session, self.course, self.mode, self.faculty, self.department, self.verdict, self.review_state,  self.perm_address, self.email
-        return [getattr(self, field, u"") for field in self.fields]
+    ViewPermission = ViewStudent
+    AddPermission = AddStudent
+    EditPermission = EditStudent
+#
+#    fields = [   "entry_mode",
+#                 "end_level",
+#                 "name",
+#                 "jamb_reg_no",
+#                 "level",
+#                 "id",
+#                 "lga",
+#                 "entry_session",
+#                 "matric_no",
+#                 "sex",
+#                 "phone",
+#                 "session",
+#                 "course",
+#                 "mode",
+#                 "faculty",
+#                 "department",
+#                 "verdict",
+#                 "review_state",
+#                 "perm_address",
+#                 "email"
+#            ]
+#        
+#
+#    def getCsv(self):
+#        #return self.entry_mode, self.end_level, self.name, self.jamb_reg_no, self.level, self.id, self.lga, self.entry_session, self.matric_no, self.sex, self.phone, self.session, self.course, self.mode, self.faculty, self.department, self.verdict, self.review_state,  self.perm_address, self.email
+#        return [getattr(self, field, u"") for field in self.fields]
 
 
 #class AddViewlet(base.AddViewlet):
 #    grok.context(IStudent)
+#    grok.require(waeup.students.AddStudent)
 #
-#class EditEditViewlet(base.EditViewlet):
+#class EditViewlet(base.EditViewlet):
 #    grok.context(IStudent)
+#    grok.require(waeup.students.EditStudent)
Index: waeup/branches/hraban/src/waeup/students/student.txt
===================================================================
--- waeup/branches/hraban/src/waeup/students/student.txt	(revision 3669)
+++ waeup/branches/hraban/src/waeup/students/student.txt	(revision 3737)
@@ -1,3 +1,5 @@
-waeup_ng.student
+.. $Id$
+
+waeup.students
 ****************
 
@@ -6,5 +8,5 @@
 We can create students::
 
-  >>> from waeup_ng.student import Student
+  >>> from waeup.students import Student
   >>> s = Student(name='Foo Bar')
   >>> s
@@ -14,4 +16,4 @@
 
   >>> s.name
-  'Mr. Nobody'
+  'Nobody'
 
Index: waeup/branches/hraban/src/waeup/students/studentcontainer.py
===================================================================
--- waeup/branches/hraban/src/waeup/students/studentcontainer.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/students/studentcontainer.py	(revision 3737)
@@ -1,2 +1,3 @@
+# $Id$
 import grok
 import os
Index: waeup/branches/hraban/src/waeup/university/__init__.py
===================================================================
--- waeup/branches/hraban/src/waeup/university/__init__.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/university/__init__.py	(revision 3737)
@@ -1,4 +1,6 @@
-from interfaces import IFaculty, IDepartment
-from facultycontainer import FacultyContainer
-from faculty import Faculty
-from department import Department
+# $Id$
+#from interfaces import *
+#from course import Course
+#from department import Department
+#from faculty import Faculty
+#from permissions import *
Index: waeup/branches/hraban/src/waeup/university/certificate.py
===================================================================
--- waeup/branches/hraban/src/waeup/university/certificate.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/university/certificate.py	(revision 3737)
@@ -0,0 +1,1 @@
+# $Id$
Index: waeup/branches/hraban/src/waeup/university/course.py
===================================================================
--- waeup/branches/hraban/src/waeup/university/course.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/university/course.py	(revision 3737)
@@ -1,7 +1,16 @@
+# $Id$
 import grok
 import waeup.baseitem as base
+from waeup.university import permissions
 from waeup.university.interfaces import ICourse
 
-class Course(grok.Model):
+class Course(base.BaseItem):
+    """
+    This is a Course (part of Department)
+    """
     grok.implements(ICourse)
     name = u'Course'
+    plural_name = u'Courses'
+    ViewPermission = permissions.ViewCourse
+    AddPermission = permissions.AddCourse
+    EditPermission = permissions.EditCourse
Index: waeup/branches/hraban/src/waeup/university/department.py
===================================================================
--- waeup/branches/hraban/src/waeup/university/department.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/university/department.py	(revision 3737)
@@ -1,16 +1,32 @@
+# -*- coding: utf-8 -*-
+# $Id$
 import grok
 import waeup.basecontainer as base
+from waeup.university import permissions
 from waeup.university.interfaces import IDepartment
 from waeup.university.course import Course
+#from waeup.university.containers import CourseContainer
 
 class Department(base.BaseContainer):
+    """
+    This is a Department (part of Faculty, contains Courses)
+    """
     grok.implements(IDepartment)
     childClass = Course
     name = u'Department'
+    plural_name = u'Departments'
+    ViewPermission = permissions.ViewDepartment
+    AddPermission = permissions.AddDepartment
+    EditPermission = permissions.EditDepartment
 
-#class Add(base.AddViewlet):
-#    grok.context(IDepartment)
+    def __init__(self, **kw):
+        super(Department, self).__init__(**kw)
+        self.__dict__.update(kw)
 
+# Bei BaseContainer-Klassen müsen die beiden Viewlets ans Interface angepasst werden:
 
-#class Edit(base.EditViewlet):
-#    grok.context(IDepartment)
+class DisplayViewlet(base.DisplayViewlet):
+    grok.context(IDepartment)
+    
+class AddViewlet(base.AddViewlet):
+    grok.context(IDepartment)
Index: waeup/branches/hraban/src/waeup/university/faculty.py
===================================================================
--- waeup/branches/hraban/src/waeup/university/faculty.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/university/faculty.py	(revision 3737)
@@ -1,4 +1,8 @@
+# -*- coding: utf-8 -*-
+# $Id$
 import grok
 import waeup.basecontainer as base
+from waeup.interfaces import IBaseContainer
+from waeup.university import permissions
 from waeup.university.interfaces import IFaculty
 from waeup.university.department import Department
@@ -11,8 +15,18 @@
     childClass = Department
     name = u'Faculty'
+    plural_name = u'Faculties'
+    ViewPermission = permissions.ViewFaculty
+    AddPermission = permissions.AddFaculty
+    EditPermission = permissions.EditFaculty
 
-#class Add(base.AddViewlet):
-#    grok.context(IFaculty)
-
-#class Edit(base.Edit):
-#    grok.context(IFaculty)
+    def __init__(self, **kw):
+        super(Faculty, self).__init__(**kw)
+        self.__dict__.update(kw)
+    
+# Bei BaseContainer-Klassen müsen die beiden Viewlets ans Interface angepasst werden:
+    
+class DisplayViewlet(base.DisplayViewlet):
+    grok.context(IFaculty)
+    
+class AddViewlet(base.AddViewlet):
+    grok.context(IFaculty)
Index: waeup/branches/hraban/src/waeup/university/facultycontainer.py
===================================================================
--- waeup/branches/hraban/src/waeup/university/facultycontainer.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/university/facultycontainer.py	(revision 3737)
@@ -1,6 +1,6 @@
+# $Id$
 import grok
 from waeup.basecontainer import BaseContainer
 from waeup.interfaces import IBaseContainer
-from waeup.university.interfaces import IFaculty
 from waeup.university.faculty import Faculty
 
Index: waeup/branches/hraban/src/waeup/university/interfaces.py
===================================================================
--- waeup/branches/hraban/src/waeup/university/interfaces.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/university/interfaces.py	(revision 3737)
@@ -1,6 +1,7 @@
+# $Id$
 import grok
 import re
 from zope import schema
-from waeup.interfaces import IBaseContainer
+from waeup.interfaces import IBaseContainer, IBaseItem
 
 class IFaculty(grok.interfaces.IContainer):
@@ -46,5 +47,5 @@
 
 
-class ICourse(IBaseContainer):
+class ICourse(IBaseItem):
     """Representation of a study course, provided by a department.
     """
Index: waeup/branches/hraban/src/waeup/university/permissions.py
===================================================================
--- waeup/branches/hraban/src/waeup/university/permissions.py	(revision 3737)
+++ waeup/branches/hraban/src/waeup/university/permissions.py	(revision 3737)
@@ -0,0 +1,53 @@
+# $Id$
+import grok
+
+class ViewFaculty(grok.Permission):
+    grok.name('waeup.university.ViewFaculty')
+    grok.title('View Faculty')
+    
+class EditFaculty(grok.Permission):
+    grok.name('waeup.university.EditFaculty')
+    grok.title('Edit Faculty')
+    
+class AddFaculty(grok.Permission):
+    grok.name('waeup.university.AddFaculty')
+    grok.title('Add Faculty')
+
+
+class ViewDepartment(grok.Permission):
+    grok.name('waeup.university.ViewDepartment')
+    grok.title('View Department')
+    
+class EditDepartment(grok.Permission):
+    grok.name('waeup.university.EditDepartment')
+    grok.title('Edit Department')
+    
+class AddDepartment(grok.Permission):
+    grok.name('waeup.university.AddDepartment')
+    grok.title('Add Department')
+
+
+class ViewCourse(grok.Permission):
+    grok.name('waeup.university.ViewCourse')
+    grok.title('View Course')
+    
+class EditCourse(grok.Permission):
+    grok.name('waeup.university.EditCourse')
+    grok.title('Edit Course')
+    
+class AddCourse(grok.Permission):
+    grok.name('waeup.university.AddCourse')
+    grok.title('Add Course')
+
+
+class ViewCertificate(grok.Permission):
+    grok.name('waeup.university.ViewCertificate')
+    grok.title('View Certificate')
+    
+class EditCertificate(grok.Permission):
+    grok.name('waeup.university.EditCertificate')
+    grok.title('Edit Certificate')
+    
+class AddCertificate(grok.Permission):
+    grok.name('waeup.university.AddCertificate')
+    grok.title('Add Certificate')
Index: waeup/branches/hraban/src/waeup/utils/__init__.py
===================================================================
--- waeup/branches/hraban/src/waeup/utils/__init__.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/utils/__init__.py	(revision 3737)
@@ -0,0 +1,1 @@
+# $Id$
Index: waeup/branches/hraban/src/waeup/utils/importexport.py
===================================================================
--- waeup/branches/hraban/src/waeup/utils/importexport.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/utils/importexport.py	(revision 3737)
@@ -1,2 +1,3 @@
+# $Id$
 import csv
 
Index: waeup/branches/hraban/src/waeup/viewlets.py
===================================================================
--- waeup/branches/hraban/src/waeup/viewlets.py	(revision 3669)
+++ waeup/branches/hraban/src/waeup/viewlets.py	(revision 3737)
@@ -1,4 +1,4 @@
 # -*- coding: utf-8 -*-
-# viewlets.py
+# $Id$
 import grok
 from grok.interfaces import IContainer
Index: waeup/branches/hraban/src/waeup/viewlets_templates/navigationbar.pt
===================================================================
--- waeup/branches/hraban/src/waeup/viewlets_templates/navigationbar.pt	(revision 3669)
+++ waeup/branches/hraban/src/waeup/viewlets_templates/navigationbar.pt	(revision 3737)
@@ -1,15 +1,10 @@
 <div id="adminbar" class="menubar"
     tal:define="app view/getSite">
-<!--	<ul>
-		<tal:block  tal:repeat="menuitem view/menuitems">
-			<li><a tal:attributes="href menuitem/url;title menuitem/title" tal:content="menuitem/text">Menuitem</a></li>
-		</tal:block>
-	</ul>-->
   <ul>
   	<li><a tal:attributes="href view/application_url">Home</a></li>
-    <li tal:repeat="fac app/values">
+    <li tal:repeat="item app/values">
       <a href="." 
-	 tal:content="fac/name"
-	 tal:attributes="href python:view.url(fac)" />
+	 tal:content="item/name"
+	 tal:attributes="href python:view.url(item)" />
     </li>
   </ul>
