Changeset 6907 for main/waeup.sirp/trunk/src/waeup/sirp/browser
- Timestamp:
- 18 Oct 2011, 17:56:51 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/browser
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/breadcrumbs.py
r6008 r6907 6 6 from zope.publisher.browser import TestRequest 7 7 8 from waeup.sirp.interfaces import IConfigurationContainer 8 9 from waeup.sirp.browser import interfaces 9 10 from waeup.sirp.browser.interfaces import (IBreadcrumb, IBreadcrumbIgnorable, … … 100 101 viewname = 'administration' 101 102 103 class ConfigurationContainerBreadcrumb(Breadcrumb): 104 """A breadcrumb for the configuration container. 105 """ 106 grok.context(IConfigurationContainer) 107 title = u'Portal Configuration' 108 parent_viewname = 'administration' 109 102 110 class UserContainerBreadcrumb(Breadcrumb): 103 111 """A breadcrumb for user containers. -
main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt
r6734 r6907 62 62 >>> browser.handleErrors = False 63 63 64 We can then get an edit view of a university::65 66 >>> browser.open('http://localhost/myuniversity/ manage')67 >>> print browser.contents 68 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... 69 ...<form action="http://localhost/myuniversity/ manage"64 We can then get an edit view of the configuration container:: 65 66 >>> browser.open('http://localhost/myuniversity/configuration') 67 >>> print browser.contents 68 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... 69 ...<form action="http://localhost/myuniversity/configuration/@@index" 70 70 ... 71 71 … … 88 88 ... 89 89 90 >>> browser.getControl("Cancel").click() 91 >>> print browser.contents 92 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... 93 ...<li class="message">Action cancelled.</li> 94 ... 95 96 >>> browser.open('http://localhost/myuniversity/manage') 97 >>> browser.getControl("Save and return").click() 98 >>> print browser.contents 99 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... 100 ...<li class="message">Settings have been saved.</li> 101 ... 102 103 >>> browser.open('http://localhost/myuniversity/manage') 90 >>> browser.open('http://localhost/myuniversity/configuration') 104 91 >>> browser.getControl("Update plugins").click() 105 92 >>> print browser.contents -
main/waeup.sirp/trunk/src/waeup/sirp/browser/layout.py
r6818 r6907 133 133 134 134 def getAppTitle(self): 135 return getattr(grok.getSite() , 'name', u'Sample University')135 return getattr(grok.getSite()['configuration'], 'name', u'Sample University') 136 136 137 137 def isAuthenticated(self): … … 184 184 """ 185 185 mode('minified') 186 theme_name = getattr(grok.getSite() , 'skin', '')186 theme_name = getattr(grok.getSite()['configuration'], 'skin', '') 187 187 theme = queryUtility(ITheme, name=theme_name, 188 188 default=self.default_theme) -
main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
r6853 r6907 34 34 IWAeUPObject, IUserContainer, IUserAccount, IDataCenter, 35 35 IWAeUPXMLImporter, IWAeUPXMLExporter, IBatchProcessor, 36 ILocalRolesAssignable, DuplicationError )36 ILocalRolesAssignable, DuplicationError, IConfigurationContainer) 37 37 from waeup.sirp.permissions import get_users_with_local_roles, getRoles 38 38 from waeup.sirp.university.catalog import search … … 153 153 pnav = 0 154 154 155 form_fields = grok.AutoFields(IUniversity)156 form_fields['frontpage'].custom_widget = ReSTDisplayWidget157 158 155 @property 159 156 def title(self): … … 162 159 @property 163 160 def label(self): 164 return self.context.title 165 166 class UniversityManageFormPage(WAeUPEditFormPage): 167 """Manage the basic properties of a `University` instance. 168 """ 169 form_fields = grok.AutoFields(IUniversity) 170 grok.context(IUniversity) 171 grok.require('waeup.manageUniversity') 172 title = u'Edit portal settings' 173 pnav = 0 174 grok.name('manage') 175 176 @grok.action('Save') 177 def save(self, **data): 178 self.applyData(self.context, **data) 179 self.flash('Settings have been saved.') 180 return 181 182 @grok.action('Save and return') 183 def saveAndReturn(self, **data): 184 self.applyData(self.context, **data) 185 self.redirect(self.url(self.context)) 186 self.flash('Settings have been saved.') 187 return 188 @grok.action('Cancel', validator=NullValidator) 189 def cancel(self, **data): 190 self.flash('Action cancelled.') 191 self.redirect(self.url(self.context)) 192 return 193 194 @grok.action('Update plugins', validator=NullValidator) 195 def updatePlugins(self, **data): 196 self.context.updatePlugins() 197 self.flash('Plugins were updated. See log file for details.') 198 self.redirect(self.url(self.context)) 199 return 161 return self.context['configuration'].title 162 163 @property 164 def frontpage(self): 165 view = ConfigurationContainerDisplayFormPage( 166 self.context['configuration'],self.request) 167 view.setUpWidgets() 168 return view.widgets['frontpage']() 200 169 201 170 class AdministrationPage(WAeUPPage): … … 430 399 self.flash('Your message has been sent.') 431 400 return 401 402 403 # 404 # Configuration pages... 405 # 406 407 class ConfigurationContainerDisplayFormPage(WAeUPDisplayFormPage): 408 """View page of the configuration container. 409 """ 410 grok.require('waeup.managePortalConfiguration') 411 grok.name('view') 412 grok.context(IConfigurationContainer) 413 pnav = 0 414 label = u'View portal configuration' 415 title = u'Portal Configuration' 416 form_fields = grok.AutoFields(IConfigurationContainer) 417 form_fields['frontpage'].custom_widget = ReSTDisplayWidget 418 419 #def renderFrontpage(self): 420 # self.setUpWidgets() 421 # return widgets['frontpage'] 422 423 class ConfigurationContainerManageFormPage(WAeUPEditFormPage): 424 """Manage page of the configuration container. 425 """ 426 grok.require('waeup.managePortalConfiguration') 427 grok.name('index') 428 grok.context(IConfigurationContainer) 429 pnav = 0 430 label = u'Edit portal configuration' 431 title = u'Portal Configuration' 432 433 form_fields = grok.AutoFields(IConfigurationContainer) 434 435 @grok.action('Save') 436 def save(self, **data): 437 self.applyData(self.context, **data) 438 self.flash('Settings have been saved.') 439 return 440 441 @grok.action('Update plugins', validator=NullValidator) 442 def updatePlugins(self, **data): 443 grok.getSite().updatePlugins() 444 self.flash('Plugins were updated. See log file for details.') 445 return 446 432 447 433 448 # -
main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/administrationpage.pt
r5396 r6907 1 <h 3>Administration</h3>1 <h2>Administration</h2> 2 2 3 3 <p> -
main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/universitypage.pt
r6065 r6907 1 1 <h2 tal:content="view/label">Title</h2> 2 2 3 <span tal:replace="structure view/ widgets/frontpage">Frontpage</span>3 <span tal:replace="structure view/frontpage">Frontpage</span> -
main/waeup.sirp/trunk/src/waeup/sirp/browser/viewlets.py
r6685 r6907 301 301 # This link is only displayed, if the user is 302 302 # allowed to use it! 303 grok.require('waeup.managePortal Settings')304 305 link = ' @@manage'306 text = u'Portal Settings'303 grok.require('waeup.managePortalConfiguration') 304 305 link = 'configuration' 306 text = u'Portal Configuration' 307 307 308 308 def render(self): … … 332 332 # Manage ("Edit settings") actions... 333 333 # 334 class ManageUniversityActionButton(ManageActionButton):335 """ 'Edit' button for University instances.336 """337 grok.context(IUniversity)338 grok.view(UniversityPage)339 text = 'Edit portal settings'334 #class ManageUniversityActionButton(ManageActionButton): 335 # """ 'Edit' button for University instances. 336 # """ 337 # grok.context(IUniversity) 338 # grok.view(UniversityPage) 339 # text = 'Edit portal settings' 340 340 341 341 #class ManageFacultiesActionButton(ManageActionButton): … … 618 618 return self.view.url(self.context[self.target_viewname]) 619 619 620 class AdminTaskPortal Settings(AdminTask):620 class AdminTaskPortalConfiguration(AdminTask): 621 621 """Entry on administration page that link to portal settings. 622 622 """ 623 623 grok.order(1) 624 grok.require('waeup.managePortal Settings')625 626 link_title = 'Portal Settings'624 grok.require('waeup.managePortalConfiguration') 625 626 link_title = 'Portal Configuration' 627 627 def link_target(self): 628 return self.view.url(self.view.context, ' @@manage')628 return self.view.url(self.view.context, 'configuration') 629 629 630 630 class AdminTaskUsers(AdminTask):
Note: See TracChangeset for help on using the changeset viewer.