- Timestamp:
- 25 Mar 2010, 16:05:49 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/browser.py
r5082 r5084 2 2 """ 3 3 import grok 4 from waeup.sirp.browser import WAeUPPage 4 from waeup.sirp.browser import WAeUPPage, WAeUPAddFormPage 5 5 from waeup.sirp.browser.breadcrumbs import Breadcrumb 6 from waeup.sirp.browser.viewlets import AdminTask 6 from waeup.sirp.browser.viewlets import AdminTask, AddActionButton 7 7 from waeup.sirp.interfaces import IWAeUPObject 8 8 … … 18 18 title = 'Access Code Batches' 19 19 pnav = 0 20 21 class AddBatchPage(WAeUPAddFormPage): 22 grok.name('add') 23 grok.context(IAccessCodeBatchContainer) 24 25 title = label = 'Create a WAeUP Scratch Card Batch' 26 pnav = 0 27 28 @grok.action('Create batch') 29 def createBatch(self, **data): 30 self.flash('Batch created') 31 self.redirect(self.url(self.context)) 20 32 21 33 class BatchContainerBreadcrumb(Breadcrumb): … … 35 47 link_title = 'Manage access-code batches' 36 48 target_viewname = 'accesscodes' 49 50 class CreateBatchButton(AddActionButton): 51 """Action button on batch container page which links to batch creation. 52 """ 53 grok.context(IAccessCodeBatchContainer) 54 grok.view(BatchContainerPage) 55 grok.require('waeup.manageUniversity') 56 text = 'Add Scratch Card Batch'
Note: See TracChangeset for help on using the changeset viewer.