- Timestamp:
- 31 Mar 2010, 16:41:11 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/browser.py
r5088 r5104 5 5 from waeup.sirp.browser import WAeUPPage, WAeUPAddFormPage 6 6 from waeup.sirp.browser.breadcrumbs import Breadcrumb 7 from waeup.sirp.browser.viewlets import AdminTask, AddActionButton 8 from waeup.sirp.interfaces import IWAeUPObject 7 from waeup.sirp.browser.pages import UniversityPage 8 from waeup.sirp.browser.viewlets import AdminTask, AddActionButton, LeftSidebar 9 from waeup.sirp.interfaces import IWAeUPObject, IUniversity 9 10 10 11 from waeup.sirp.accesscodes.accesscodes import AccessCodeBatch 12 from waeup.sirp.accesscodes.catalog import invalidated_num 11 13 from waeup.sirp.accesscodes.interfaces import ( 12 14 IAccessCodeBatchContainer, IAccessCodeBatch, … … 19 21 grok.context(IAccessCodeBatchContainer) 20 22 grok.template('batchcontainer') 23 grok.require('waeup.manageACBatches') 21 24 22 25 title = 'Access Code Batches' 23 26 pnav = 0 24 27 28 def invalidated(self, batch): 29 return invalidated_num(batch.prefix, batch.num) 30 31 25 32 class AddBatchPage(WAeUPAddFormPage): 26 33 grok.name('add') 27 34 grok.context(IAccessCodeBatchContainer) 35 grok.require('waeup.manageACBatches') 28 36 29 37 title = label = 'Create a WAeUP Scratch Card Batch' … … 34 42 35 43 @grok.action('Cancel') 36 def cancel(self ):44 def cancel(self, *args, **kw): 37 45 self.flash('Batch creation cancelled.') 38 46 self.redirect(self.url(self.context)) … … 51 59 class BatchContainerBreadcrumb(Breadcrumb): 52 60 """A breadcrumb for ac batch containers. 53 """ 61 """ 62 grok.require('waeup.manageACBatches') 54 63 grok.context(IAccessCodeBatchContainer) 55 64 title = u'Access Code Batches' … … 60 69 """ 61 70 grok.order(5) 62 grok.require('waeup.manage University')71 grok.require('waeup.manageACBatches') 63 72 grok.template('admintaskacbatches') 64 73 … … 71 80 grok.context(IAccessCodeBatchContainer) 72 81 grok.view(BatchContainerPage) 73 grok.require('waeup.manage University')82 grok.require('waeup.manageACBatches') 74 83 text = 'Add Scratch Card Batch' 84 85 class ManageAccessCodes(grok.Viewlet): 86 """Link on front page to access code management. 87 """ 88 grok.viewletmanager(LeftSidebar) 89 grok.context(IUniversity) 90 grok.view(UniversityPage) 91 grok.order(6) 92 grok.require('waeup.manageACBatches') 93 94 def render(self): 95 return u'<div class="portlet"><a href="accesscodes">Manage access-codes</a></div>'
Note: See TracChangeset for help on using the changeset viewer.