Changeset 3557 for waeup/branches/hraban/src
- Timestamp:
- 2 Jul 2008, 11:16:58 (16 years ago)
- Location:
- waeup/branches/hraban/src/waeup
- Files:
-
- 2 added
- 1 deleted
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/hraban/src/waeup/app.py
r3530 r3557 1 1 import grok 2 from grok import index 3 from zope.interface import Interface 4 from interfaces import IUniversity 2 #from zope.interface import Interface 3 from waeup.interfaces import IUniversity 5 4 from setup import app_setup 6 from viewlets import MainArea5 from waeup.viewlets import MainArea 7 6 8 7 class University(grok.Application, grok.Container): -
waeup/branches/hraban/src/waeup/basecontainer.py
r3530 r3557 1 1 import grok 2 from baseitem import BaseItem 2 from waeup.interfaces import IBaseContainer 3 from waeup.baseitem import BaseItem 3 4 from waeup.viewlets import MainArea 4 5 … … 8 9 base methods and templates attached to it 9 10 """ 10 11 grok.implements(IBaseContainer) 11 12 name = u"BaseContainer" 12 13 childClass = None … … 14 15 15 16 class Content(grok.Viewlet): 16 grok.viewletmanager(MainArea)17 17 """ 18 18 Base viewlet 19 19 """ 20 grok.viewletmanager(MainArea) 21 #grok.context(grok.interfaces.IContainer) 20 22 21 23 class Add(grok.AddForm): -
waeup/branches/hraban/src/waeup/basecontainer_templates/content.pt
r3530 r3557 1 <h1 tal:content="context/name"></h1> 2 <a href="" tal:attributes="href python:view.url(context.__parent__)">Up</a> 3 <table> 4 <tr> 5 <th>Name</th> 6 </tr> 7 <tr tal:repeat="item context/values"> 8 <td><a href="" tal:content="item/name" 9 tal:attributes="href python:view.url(item)"></a></td> 10 </tr> 11 </table> 12 <a href="" tal:attributes="href python:view.url(context, 'add')">Add</a> 13 <a href="" 14 tal:repeat="action context/specialActions" 15 tal:attributes="href python:view.url(context, action)" 16 tal:content="action">Add</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, 'add')">Add</a> 5 <li tal:repeat="action context/specialActions"> 6 <a href="" tal:attributes="href python:view.url(context, action)" 7 tal:content="action">Add</a> 8 </li> 9 </ul> 10 </div> 11 12 <h2 tal:content="context/name"></h2> 13 <table class="datatable"> 14 <tr> 15 <th>Name</th> 16 </tr> 17 <tr tal:repeat="item context/values"> 18 <td tal:repeat="prop item/items"> 19 <a href="" tal:content="prop" 20 tal:attributes="href python:view.url(item)"></a> 21 </td> 22 <!-- 23 <td><a href="" tal:content="item/name" 24 tal:attributes="href python:view.url(item)"></a></td> 25 --> 26 </tr> 27 </table> -
waeup/branches/hraban/src/waeup/baseitem.py
r3545 r3557 15 15 class Content(grok.Viewlet): 16 16 grok.viewletmanager(MainArea) 17 #grok.context(grok.interfaces.IContainer) 17 18 -
waeup/branches/hraban/src/waeup/catalog.py
r3527 r3557 4 4 from datetime import datetime 5 5 import os 6 import grok 7 from grok import index 6 import grok, grok.index 8 7 from hurry.query.query import Query, Text 9 8 from hurry.query import Eq 10 from app import University 11 from students.interfaces import IStudent 12 from students.student import Student 9 from waeup.app import University 10 from waeup.students.interfaces import IStudent 11 from waeup.students.student import Student 12 from waeup.viewlets import MainArea, LeftSidebar 13 13 14 14 class StudentIndexes(grok.Indexes): … … 17 17 grok.context(IStudent) 18 18 19 name = index.Field(attribute='name')19 name = grok.index.Field(attribute='name') 20 20 21 21 22 class StudentSearch(grok.View): 23 grok.context(University) 22 class StudentSearch(grok.Viewlet): 23 grok.context(IStudent) 24 grok.viewletmanager(LeftSidebar) 25 #grok.view(Student) 24 26 25 27 def update(self, query=None): -
waeup/branches/hraban/src/waeup/catalog_templates/studentsearch.pt
r3521 r3557 1 <html> 2 <body> 1 <div class="portlet"> 3 2 <form> 4 3 <div> … … 11 10 tal:content="item/name" > 12 11 </div> 13 </body> 14 </html> 12 </div> -
waeup/branches/hraban/src/waeup/hostel/hostel.py
r3531 r3557 1 1 import grok 2 2 from waeup.baseitem import BaseItem 3 from interfaces import IHostel3 from waeup.hostel.interfaces import IHostel 4 4 5 5 -
waeup/branches/hraban/src/waeup/hostel/interfaces.py
r3531 r3557 1 1 ## 2 2 ## interfaces.py 3 from zope.interface import Interface 3 import grok 4 4 from zope import schema 5 5 6 class IHostel( Interface):7 """Representation of a student.6 class IHostel(grok.interfaces.IContainer): 7 """Representation of a hostel (AKA hall). 8 8 """ 9 9 name = schema.TextLine( 10 10 title = u'Name of Hostel', 11 default = u' Nobody',11 default = u'Unnamed', 12 12 required = True, 13 13 ) -
waeup/branches/hraban/src/waeup/interfaces.py
r3526 r3557 1 1 ## 2 2 ## interfaces.py 3 from zope.interface import Interface 3 import grok 4 #from zope.interface import Interface 4 5 from zope import schema 5 6 6 class IUniversity( Interface):7 class IUniversity(grok.interfaces.IContainer): 7 8 """Representation of a university. 8 9 """ … … 12 13 required = True, 13 14 ) 15 16 class IBaseContainer(grok.interfaces.IContainer): 17 name = schema.TextLine( 18 title = u'Name of Container', 19 default = u'Unnamed Container', 20 required = True 21 ) 22 -
waeup/branches/hraban/src/waeup/students/interfaces.py
r3526 r3557 1 1 ## 2 2 ## interfaces.py 3 from zope.interface import Interface 3 import grok 4 4 from zope import schema 5 5 6 class IStudent( Interface):6 class IStudent(grok.interfaces.IContainer): 7 7 """Representation of a student. 8 8 """ -
waeup/branches/hraban/src/waeup/students/student.py
r3529 r3557 1 1 import grok 2 from grok import index3 2 from interfaces import IStudent 4 5 3 from waeup.baseitem import BaseItem 6 4 … … 8 6 #Factory method 9 7 student = Student("Dummy") 10 student.entry_mode, student.end_level, student.name, student.jamb_reg_no, student.level, student.id, student.lga, student.entry_session, student.matric_no, student.sex, student.phone, student.session, student.course, student.mode, student.faculty, student.department, student.verdict, student.review_state, student.perm_address, student.email = a 8 student.entry_mode, student.end_level, student.name, \ 9 student.jamb_reg_no, student.level, student.id, \ 10 student.lga, student.entry_session, student.matric_no, \ 11 student.sex, student.phone, student.session, \ 12 student.course, student.mode, student.faculty, \ 13 student.department, student.verdict, student.review_state, \ 14 student.perm_address, student.email = a 11 15 return student 12 16 -
waeup/branches/hraban/src/waeup/students/studentcontainer.py
r3551 r3557 1 1 import grok 2 2 import os 3 4 3 from waeup.basecontainer import BaseContainer 5 4 from student import Student, fromCsv -
waeup/branches/hraban/src/waeup/university/faculty.py
r3529 r3557 1 1 import grok 2 2 from waeup.basecontainer import BaseContainer 3 from interfaces import IFaculty3 from waeup.university.interfaces import IFaculty 4 4 5 5 class Faculty(BaseContainer): -
waeup/branches/hraban/src/waeup/university/facultycontainer.py
r3527 r3557 1 1 import grok 2 2 from waeup.basecontainer import BaseContainer 3 from interfaces import IFaculty4 from faculty import Faculty3 from waeup.university.interfaces import IFaculty 4 from waeup.university.faculty import Faculty 5 5 6 6 class FacultyContainer(BaseContainer): 7 7 #grok.implements(grok.interfaces.IContainer) 8 8 name = u'Faculties' 9 9 childClass = Faculty -
waeup/branches/hraban/src/waeup/university/interfaces.py
r3526 r3557 1 from zope.interface import Interface 1 import grok 2 2 from zope import schema 3 3 4 class IFaculty( Interface):4 class IFaculty(grok.interfaces.IContainer): 5 5 """Representation of a university faculty. 6 6 """ -
waeup/branches/hraban/src/waeup/viewlets.py
r3530 r3557 1 1 # -*- coding: utf-8 -*- 2 # viewlets.py 2 3 import grok 3 import zope.interface 4 from grok.interfaces import IContainer 5 from zope.interface import Interface 4 6 from interfaces import IUniversity 5 7 6 grok.context( zope.interface.Interface)8 grok.context(Interface) 7 9 8 10 class Index(grok.View): … … 14 16 15 17 class Head(grok.ViewletManager): 16 """ additions to HTML head"""18 """viewlet manager for the HTML head area""" 17 19 grok.name('head') 18 20 19 21 class Title(grok.Viewlet): 22 """defines html/head/title""" 20 23 grok.viewletmanager(Head) 21 24 22 25 class AppCSS(grok.Viewlet): 26 """loads the default application CSS (static/app.css)""" 23 27 grok.viewletmanager(Head) 24 28 25 29 class Header(grok.ViewletManager): 30 """viewlet manager for the head area of the page""" 26 31 grok.name('header') 27 32 28 33 class Logo(grok.Viewlet): 34 """display the logo""" 29 35 grok.viewletmanager(Header) 30 36 grok.order(1) 31 37 32 38 class NavigationBar(grok.Viewlet): 39 """display the menu bar 40 (at the moment uses objects of the site as menu items)""" 33 41 grok.viewletmanager(Header) 34 42 grok.order(2) … … 38 46 39 47 class LeftSidebar(grok.ViewletManager): 48 """viewlet manager for the lefthand side bar 49 that will contain some essential information 50 about the displayed item""" 40 51 grok.name('left') 41 52 42 53 class AuthUser(grok.Viewlet): 54 """display the current user's name""" 43 55 grok.viewletmanager(LeftSidebar) 44 56 grok.view(Index) … … 46 58 47 59 class Login(grok.Viewlet): 60 """display an useless login form""" 48 61 grok.viewletmanager(LeftSidebar) 49 62 grok.context(IUniversity) … … 52 65 53 66 class MainArea(grok.ViewletManager): 67 """viewlet manager for the main content area""" 54 68 grok.name('main') 55 69 #grok.context(IContainer) 56 70 57 71 class Footer(grok.ViewletManager): 72 """viewlet manager for the foot bar""" 58 73 grok.name('footer') 59 74 60 75 class Copyright(grok.Viewlet): 76 """display a copyright notice""" 61 77 grok.viewletmanager(Footer) -
waeup/branches/hraban/src/waeup/viewlets_templates/logo.pt
r3530 r3557 1 1 <div id="logo"> 2 2 <img tal:attributes="src static/logo_waeup.gif" alt="WAeUp logo" /> 3 <h1 >Sample University</h1>3 <h1 tal:content="context/name">Sample University</h1> 4 4 </div>
Note: See TracChangeset for help on using the changeset viewer.