web/views/basetemplates.py
branchstable
changeset 6109 47d9c0e0f7b7
parent 6091 560df423149a
child 6140 65a619eb31c4
child 6178 9b596b11e375
equal deleted inserted replaced
6108:c459ffa5fa6f 6109:47d9c0e0f7b7
   203     def content_footer(self, view=None):
   203     def content_footer(self, view=None):
   204         self.wview('contentfooter', rset=self.cw_rset, view=view)
   204         self.wview('contentfooter', rset=self.cw_rset, view=view)
   205 
   205 
   206 
   206 
   207 class ErrorTemplate(TheMainTemplate):
   207 class ErrorTemplate(TheMainTemplate):
   208     """fallback template if an internal error occured during displaying the main
   208     """fallback template if an internal error occurred during displaying the main
   209     template. This template may be called for authentication error, which means
   209     template. This template may be called for authentication error, which means
   210     that req.cnx and req.user may not be set.
   210     that req.cnx and req.user may not be set.
   211     """
   211     """
   212     __regid__ = 'error-template'
   212     __regid__ = 'error-template'
   213 
   213 
   214     def call(self):
   214     def call(self):
   215         """display an unexpected error"""
   215         """display an unexpected error"""
   216         self.set_request_content_type()
   216         self.set_request_content_type()
   217         self._cw.reset_headers()
   217         self._cw.reset_headers()
   218         view = self._cw.vreg['views'].select('error', self._cw, rset=self.cw_rset)
   218         view = self._cw.vreg['views'].select('error', self._cw, rset=self.cw_rset)
   219         self.template_header(self.content_type, view, self._cw._('an error occured'),
   219         self.template_header(self.content_type, view, self._cw._('an error occurred'),
   220                              [NOINDEX, NOFOLLOW])
   220                              [NOINDEX, NOFOLLOW])
   221         view.render(w=self.w)
   221         view.render(w=self.w)
   222         self.template_footer(view)
   222         self.template_footer(view)
   223 
   223 
   224     def template_header(self, content_type, view=None, page_title='', additional_headers=()):
   224     def template_header(self, content_type, view=None, page_title='', additional_headers=()):