Changeset 6201 for main/waeup.sirp/trunk/src/waeup/sirp
- Timestamp:
- 26 May 2011, 22:56:39 (14 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/browser
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/exceptions.py
r6199 r6201 22 22 import grok 23 23 import zope.errorview.browser 24 from megrok.layout import Page25 24 from zope.interface.common.interfaces import IException 25 from zope.errorview.http import SystemErrorViewMixin 26 26 from zope.publisher.interfaces import INotFound 27 27 from zope.security.interfaces import IUnauthorized 28 from waeup.sirp.browser.layout import SiteLayout, WAeUPPage 29 from waeup.sirp.interfaces import IWAeUPObject 28 from waeup.sirp.browser.layout import WAeUPPage 30 29 31 30 grok.templatedir('templates') 32 31 33 class ExceptionLayout(SiteLayout): 34 """ The general site layout. 32 class ExceptionView(grok.View, zope.errorview.browser.ExceptionView, 33 SystemErrorViewMixin): 34 """Base class for rendering views for uncaught exceptions that occur during 35 the application run-time and are not otherwise rendered. 36 37 Backport from Grok 1.6. 38 39 XXX: This view is shared for all apps and objects in the ZODB root. 35 40 """ 36 41 grok.context(IException) 37 grok.template('sitelayout') 42 grok.name('index.html') 43 grok.template('exception') 38 44 39 40 #class ExceptionPage(WAeUPPage): 41 # grok.context(IException) 42 # grok.name('index.html') 43 # grok.template('exception') 44 # 45 # title = u'System Error' 46 # pnav = 0 47 # 48 # def update(self): 49 # # XXX: That's merely bullshit. We cannot trust to have anything 50 # # ready/setup if some arbitrary exception happens. Maybe we're 51 # # better off with views instead pages here? 52 # self.message = self.context.message 53 # self.args = self.context.args 54 # self.error_context = self.context 55 # if not IWAeUPObject.providedBy(self.context): 56 # self.context = self.context = getattr( 57 # self.context, '__parent__', self.context) 58 # self.context = self.context.context 59 # return 45 def update(self): 46 return zope.errorview.browser.ExceptionView.update(self) 60 47 61 48 class UnauthorizedView(grok.View, zope.errorview.browser.UnauthorizedView): … … 79 66 80 67 class NotFoundPage(WAeUPPage): 68 """A page rendered when an object cannot be found. 69 70 XXX: This page won't work for objects above a w.s.University. 71 """ 81 72 grok.context(INotFound) 82 73 grok.name('index.html') -
main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/unauthorized.pt
r6191 r6201 1 <div class="warning"> 2 <b>You are not authorized to access this resource.</b> 3 </div> 1 <html xmlns="http://www.w3.org/1999/xhtml"> 2 <head> 3 <title>Not Authorized</title> 4 </head> 5 <body> 6 <div class="warning"> 7 <b>You are not authorized to access this resource.</b> 8 </div> 9 </body> 10 </html>
Note: See TracChangeset for help on using the changeset viewer.