Changeset 4775 for waeup/branches
- Timestamp:
- 9 Jan 2010, 18:42:25 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-layout/src/waeup/viewlets.py
r4772 r4775 13 13 from waeup.utils.helpers import getInnerHTMLPart 14 14 15 master_template_path = os.path.join(16 os.path.dirname(__file__), 'viewlets_templates', 'master.pt')17 18 15 grok.context(zope.interface.Interface) 19 20 class Index(grok.View):21 """main structure for all pages"""22 grok.template('master')23 24 class Manage(grok.View):25 """Admin view for waeup objects.26 """27 grok.context(IWAeUPObject)28 grok.template('master')29 30 class Add(grok.View):31 """Admin add form wrapper for waeup objects.32 """33 grok.context(IWAeUPObject)34 grok.template('master')35 36 class AddCourse(grok.View):37 """Admin add form wrapper for waeup objects.38 39 We need different named add views for departments as there are40 different things to add.41 """42 grok.context(IWAeUPObject)43 grok.template('master')44 45 class AddCertificate(grok.View):46 """Admin add form wrapper for waeup objects.47 48 We need different named add views for departments as there are49 different things to add.50 """51 grok.context(IWAeUPObject)52 grok.template('master')53 54 class AddCertificateCourse(grok.View):55 """Admin add form wrapper for waeup objects.56 57 We need different named add views for departments as there are58 different things to add.59 """60 grok.context(IWAeUPObject)61 grok.template('master')62 16 63 17 class ExportXML(grok.View): … … 149 103 def getSite(self): 150 104 return grok.getSite() 151 152 class LeftSidebar(grok.ViewletManager):153 grok.name('left')154 155 class ExportLink(grok.Viewlet):156 grok.viewletmanager(LeftSidebar)157 grok.view(Index)158 grok.order(99)159 grok.require('waeup.manageUniversity')160 161 def render(self):162 return '<div class="portlet"><a href="export.xml">%s</a></div>' % (163 'Export as XML',)164 165 class ImportLink(grok.Viewlet):166 grok.viewletmanager(LeftSidebar)167 grok.view(Index)168 grok.order(99)169 grok.require('waeup.manageUniversity')170 171 def render(self):172 if ISite.providedBy(self.context):173 # We cannot simply replace local sites.174 return ''175 return '<div class="portlet"><a href="importxml">%s</a></div>' % (176 'Import from XML',)177 178 class MainArea(grok.ViewletManager):179 grok.name('main')180 181 class ImportXMLViewlet(grok.Viewlet):182 grok.viewletmanager(MainArea)183 grok.view(ImportXML)
Note: See TracChangeset for help on using the changeset viewer.