Changeset 4411 for waeup/branches
- Timestamp:
- 21 Jul 2009, 14:57:16 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/viewlets.py
r4380 r4411 2 2 import grok 3 3 import zope.interface 4 from grok.interfaces import IGrokSecurityView 5 from hurry import yui 4 6 from zope.component import getMultiAdapter 5 7 from zope.location.interfaces import ISite 6 8 from waeup.interfaces import (IUniversity, IWAeUPObject, IWAeUPXMLExporter, 7 IWAeUPXMLImporter) 9 IWAeUPXMLImporter, IFacultyContainer, IFaculty, 10 IDepartment) 8 11 from waeup.utils.helpers import getInnerHTMLPart 9 12 … … 77 80 grok.viewletmanager(Head) 78 81 79 class AppCSS(grok.Viewlet): 82 class HeadIncludes(grok.Viewlet): 83 """Register CSS and JavaScripts. 84 """ 80 85 grok.viewletmanager(Head) 86 87 def update(self): 88 yui.reset_fonts_grids.need() 89 yui.sam.need() 90 yui.tabview.need() 91 yui.layout.need() 92 yui.animation.need() 93 yui.resize.need() 94 81 95 82 96 class Header(grok.ViewletManager): … … 160 174 class Copyright(grok.Viewlet): 161 175 grok.viewletmanager(Footer) 176 177 178 class ActionBar(grok.ViewletManager): 179 grok.name('actionbar') 180 pass 181 182 183 class AddAction(grok.Viewlet): 184 grok.viewletmanager(ActionBar) 185 grok.view(Index) 186 grok.context(IFaculty) 187 grok.order(4) 188 grok.template('addaction') 189 grok.require('waeup.manageUniversity') 190 191 addview_name = 'add' 192 addlink_text = 'Add department' 193 194 def getTargetURL(self): 195 return '%s/@@%s' % (self.view.url(self.view.context), self.addview_name) 196 197 class AddFacultyAction(AddAction): 198 grok.context(IFacultyContainer) 199 grok.template('addaction') 200 201 addview_name = 'add' 202 addlink_text = 'Add faculty' 203 204 205 class ManageUniversityAction(grok.Viewlet): 206 grok.viewletmanager(ActionBar) 207 grok.context(IUniversity) 208 grok.view(Index) 209 grok.require('waeup.manageUniversity') 210 grok.order(2) 211 grok.template('manageaction') 212 213 class ManageFacultiesAction(ManageUniversityAction): 214 grok.context(IFacultyContainer) 215 216 class ManageFacultyAction(ManageUniversityAction): 217 grok.context(IFaculty) 218 219 class ManageDepartmentAction(ManageUniversityAction): 220 grok.context(IDepartment) 221 222 class ExportXMLAction(grok.Viewlet): 223 grok.viewletmanager(ActionBar) 224 grok.view(Index) 225 grok.order(98) 226 grok.require('waeup.manageUniversity') 227 162 228 163 229 class FormWrapMixin(object):
Note: See TracChangeset for help on using the changeset viewer.