Changeset 6918
- Timestamp:
- 21 Oct 2011, 10:26:08 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/breadcrumbs.py
r6907 r6918 6 6 from zope.publisher.browser import TestRequest 7 7 8 from waeup.sirp.interfaces import IConfigurationContainer 8 from waeup.sirp.interfaces import ( 9 IConfigurationContainer, ISessionConfiguration) 9 10 from waeup.sirp.browser import interfaces 10 from waeup.sirp.browser.interfaces import (IBreadcrumb, IBreadcrumbIgnorable,11 11 from waeup.sirp.browser.interfaces import (IBreadcrumb, 12 IBreadcrumbIgnorable, IBreadcrumbContainer) 12 13 13 14 class Breadcrumb(grok.Adapter): … … 108 109 parent_viewname = 'administration' 109 110 111 class SessionConfigurationBreadcrumb(Breadcrumb): 112 """A breadcrumb for the configuration container. 113 """ 114 grok.context(ISessionConfiguration) 115 title = u'Portal Session Configuration' 116 117 @property 118 def title(self): 119 session_string = self.context.getSessionString() 120 return 'Session %s' % session_string 121 110 122 class UserContainerBreadcrumb(Breadcrumb): 111 123 """A breadcrumb for user containers. -
main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
r6917 r6918 489 489 for key, val in self.context.items(): 490 490 url = self.url(val) 491 session_string = academic_sessions_vocab.getTermByToken(key).title492 title = 'Session %s Configuration Data' % session_string491 session_string = val.getSessionString() 492 title = 'Session %s Configuration' % session_string 493 493 yield(dict(url=url, name=key, title=title)) 494 494 … … 531 531 def cancel(self): 532 532 self.redirect(self.url(self.context, '@@index')+'#tab-2') 533 return 534 535 class SessionConfigurationManageFormPage(WAeUPEditFormPage): 536 """Manage session configuration object. 537 """ 538 grok.context(ISessionConfiguration) 539 grok.name('index') 540 grok.require('waeup.managePortalConfiguration') 541 form_fields = grok.AutoFields(ISessionConfiguration) 542 pnav = 0 543 544 @property 545 def title(self): 546 session_string = self.context.getSessionString() 547 return 'Academic Session %s Configuration' % session_string 548 549 @property 550 def label(self): 551 session_string = self.context.getSessionString() 552 return 'Edit academic session %s configuration' % session_string 553 554 @grok.action('Save') 555 def save(self, **data): 556 self.applyData(self.context, **data) 557 self.flash('Settings have been saved.') 558 self.redirect(self.url(self.context.__parent__, '@@index')+'#tab-2') 559 return 560 561 @grok.action('Cancel', validator=NullValidator) 562 def cancel(self): 563 self.redirect(self.url(self.context.__parent__, '@@index')+'#tab-2') 533 564 return 534 565 -
main/waeup.sirp/trunk/src/waeup/sirp/configuration.py
r6916 r6918 20 20 from zope.component.interfaces import IFactory 21 21 from waeup.sirp.interfaces import ( 22 ISessionConfiguration, IConfigurationContainer, ISessionConfigurationAdd) 22 ISessionConfiguration, IConfigurationContainer, ISessionConfigurationAdd, 23 academic_sessions_vocab) 23 24 from waeup.sirp.utils.helpers import attrs_to_fields 24 25 … … 49 50 grok.implements(ISessionConfiguration, ISessionConfigurationAdd) 50 51 52 def getSessionString(self): 53 return academic_sessions_vocab.getTerm(self.academic_session).title 54 51 55 SessionConfiguration = attrs_to_fields(SessionConfiguration) 52 56 -
main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py
r6916 r6918 249 249 ) 250 250 251 def getSessionString(): 252 """Returns the session string from the vocabulary. 253 """ 254 255 251 256 class ISessionConfigurationAdd(ISessionConfiguration): 252 257 """A session configuration object in add mode.
Note: See TracChangeset for help on using the changeset viewer.