Changeset 3558 for waeup/branches/hraban/src
- Timestamp:
- 3 Jul 2008, 00:02:46 (16 years ago)
- Location:
- waeup/branches/hraban/src/waeup
- Files:
-
- 1 added
- 1 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/hraban/src/waeup/basecontainer.py
r3557 r3558 1 1 import grok 2 import os 2 3 from waeup.interfaces import IBaseContainer 3 4 from waeup.baseitem import BaseItem 4 from waeup.viewlets import MainArea 5 from waeup.viewlets import MainArea, Edit 6 from zope.component import getMultiAdapter 5 7 6 class BaseContainer( BaseItem,grok.Container):8 class BaseContainer(grok.Container): 7 9 """ 8 10 The base container. This is a stub for now. It can have … … 19 21 """ 20 22 grok.viewletmanager(MainArea) 21 #grok.context(grok.interfaces.IContainer) 22 23 class Add(grok.AddForm): 24 #form_fields = grok.AutoFields(self.context.childClass) 25 #DOESN'T WORK grok.template("../basecontainer_templates/add.pt") 23 24 class AddForm(grok.AddForm): 25 #grok.template('edit_form') 26 template = grok.PageTemplate(filename=os.path.join('basecontainer_templates', 'edit_form.pt')) 26 27 27 28 def update(self): … … 29 30 grok.AddForm.update(self) 30 31 31 @grok.action('Add Item') 32 def addItem(self, name, *args, **kw): 33 item = self.context.childClass(name=name) 34 self.context[name] = item 35 self.redirect(self.url(item)) 32 @grok.action('Add item') 33 def add(self, **data): 34 obj = self.context.childClass(**data) 35 name = data['name'].lower().replace(' ', '_') 36 self.context[name] = obj 37 38 class Add(grok.Viewlet): 39 grok.viewletmanager(MainArea) 40 #grok.template('edit_form') 41 grok.context(IBaseContainer) 42 grok.view(Edit) 43 44 def update(self): 45 self.form = getMultiAdapter((self.context, self.request), 46 name='addform') 47 self.form.update_form() 48 49 def render(self): 50 return self.form.render() -
waeup/branches/hraban/src/waeup/basecontainer_templates/edit_form.pt
r3557 r3558 1 1 <form action="." tal:attributes="action request/URL" method="post" 2 2 class="edit-form" enctype="multipart/form-data"> 3 3 <!-- 4 4 <h2 i18n:translate="" 5 5 tal:condition="view/label" … … 20 20 </ul> 21 21 </div> 22 --> 22 23 23 24 <div class="form-fields"> -
waeup/branches/hraban/src/waeup/baseitem.py
r3557 r3558 1 # baseitem.py 2 import os 1 3 import grok 2 from waeup.viewlets import MainArea 4 from waeup.viewlets import MainArea, Edit 5 from waeup.interfaces import IBaseItem 6 from zope.component import getMultiAdapter 3 7 4 8 class BaseItem(grok.Model): … … 6 10 Base item 7 11 """ 8 9 class Edit(grok.EditForm): 12 grok.implements(IBaseItem) 10 13 11 def update(self):12 self.form_fields = grok.AutoFields(self.context.__class__)13 grok.EditForm.update(self)14 15 14 class Content(grok.Viewlet): 16 15 grok.viewletmanager(MainArea) 17 #grok.context(grok.interfaces.IContainer)16 grok.context(IBaseItem) 18 17 18 19 #class Edit(grok.EditForm): 20 # 21 # def update(self): 22 # self.form_fields = grok.AutoFields(self.context.__class__) 23 # grok.EditForm.update(self) 24 25 26 class AddForm(grok.AddForm): 27 #grok.template('edit_form') 28 template = grok.PageTemplate(filename=os.path.join('baseitem_templates', 'edit_form.pt')) 29 30 def update(self): 31 self.form_fields = grok.AutoFields(self.context.childClass) 32 grok.AddForm.update(self) 33 34 @grok.action('Add item') 35 def add(self, **data): 36 obj = self.context.childClass(**data) 37 name = data['name'].lower().replace(' ', '_') 38 self.context[name] = obj 39 40 class Add(grok.Viewlet): 41 grok.viewletmanager(MainArea) 42 #grok.template('edit_form') 43 grok.context(IBaseItem) 44 grok.view(Edit) 45 46 def update(self): 47 self.form = getMultiAdapter((self.context, self.request), 48 name='addform') 49 self.form.update_form() 50 51 def render(self): 52 return self.form.render() -
waeup/branches/hraban/src/waeup/baseitem_templates/content.pt
r3545 r3558 1 <h1>Object <span tal:replace="context/name"></span></h1> 2 <a href="" tal:attributes="href python:view.url(context.__parent__)">Up</a> 3 <a href="" tal:attributes="href python:view.url(context, 'edit')">Edit</a> 1 <div class="menubar"> 2 <ul> 3 <li><a href="" tal:attributes="href python:view.url(context.__parent__)">Up</a></li> 4 <li><a href="" tal:attributes="href python:view.url(context, 'edit')">Edit</a></li> 5 </ul> 6 </div> 7 <h2>Object <span tal:replace="context/name"></span></h2> -
waeup/branches/hraban/src/waeup/docs/faq-staff-de.rst
r3556 r3558 57 57 Hochschulen selbst ausgeführt werden. 58 58 59 Zielgruppe des Portals 60 ---------------------- 61 62 Es gibt in Nigeria über 350 Hochschulen, für die das Portal geeignet 63 wäre, davon ca. 200 "Fachhochschulen" mit 3000-10.000 Studenten und 64 150 Universitäten mit 20.000-70.000 Studenten. 65 66 Im Prinzip lässt sich das System auch in allen anderen Ländern einsetzen, 67 wo es das Bachelor-/Master-Studiensystem gibt. Hierfür müssten allerdings 68 die Workflows und Zahlungsmodalitäten angepasst werden. 69 59 70 Geschäftsmodell 60 71 --------------- … … 62 73 WAeUP bekommt einen Anteil an allen Zahlungen, die über das Portal 63 74 abgewickelt werden, etwa 1,20 € pro Student und Jahr. 64 Es gibt in Nigeria über 350 Hochschulen, für die das Portal geeignet65 wäre, davon ca. 200 "Fachhochschulen" mit 3000-10.000 Studenten und66 150 Universitäten mit 20.000-70.000 Studenten.67 75 68 76 Was ist der derzeitige Status? -
waeup/branches/hraban/src/waeup/interfaces.py
r3557 r3558 4 4 #from zope.interface import Interface 5 5 from zope import schema 6 7 class IUniversity(grok.interfaces.IContainer):8 """Representation of a university.9 """10 name = schema.TextLine(11 title = u'Name of University',12 default = u'Unnamed',13 required = True,14 )15 6 16 7 class IBaseContainer(grok.interfaces.IContainer): … … 21 12 ) 22 13 14 15 class IBaseItem(IBaseContainer): 16 pass 17 18 class IUniversity(IBaseContainer): 19 """Representation of a university. 20 """ 21 name = schema.TextLine( 22 title = u'Name of University', 23 default = u'Unnamed', 24 required = True, 25 ) -
waeup/branches/hraban/src/waeup/static/app.css
r3530 r3558 99 99 border: 1px solid #005500; 100 100 border-bottom: none; 101 margin-left: 0.5em; 101 102 } 102 103 … … 108 109 color: black; 109 110 text-decoration: none; 111 } 112 113 .menubar ul li a:active { 114 font-weight: bold; 110 115 } 111 116 -
waeup/branches/hraban/src/waeup/students/interfaces.py
r3557 r3558 3 3 import grok 4 4 from zope import schema 5 from waeup.interfaces import IBaseItem 5 6 6 class IStudent( grok.interfaces.IContainer):7 class IStudent(IBaseItem): 7 8 """Representation of a student. 8 9 """ -
waeup/branches/hraban/src/waeup/viewlets.py
r3557 r3558 14 14 def __init__(self, context, request):# 15 15 super(Index, self).__init__(context, request) 16 17 def getSite(self): 18 return grok.getSite() 19 20 class Edit(Index): 21 pass 16 22 17 23 class Head(grok.ViewletManager): … … 41 47 grok.viewletmanager(Header) 42 48 grok.order(2) 43 44 def getSite(self):45 return grok.getSite()46 49 47 50 class LeftSidebar(grok.ViewletManager): -
waeup/branches/hraban/src/waeup/viewlets_templates/logo.pt
r3557 r3558 1 <div id="logo" >1 <div id="logo" tal:define="app view/getSite"> 2 2 <img tal:attributes="src static/logo_waeup.gif" alt="WAeUp logo" /> 3 <h1 tal:content=" context/name">Sample University</h1>3 <h1 tal:content="app/name">Sample University</h1> 4 4 </div> -
waeup/branches/hraban/src/waeup/viewlets_templates/navigationbar.pt
r3530 r3558 1 1 <div id="adminbar" class="menubar" 2 tal:define="app view let/getSite">2 tal:define="app view/getSite"> 3 3 <!-- <ul> 4 4 <tal:block tal:repeat="menuitem view/menuitems">
Note: See TracChangeset for help on using the changeset viewer.