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=()): |