##// END OF EJS Templates
error-document: make sure the error document has registered helpers,...
marcink -
r1748:0fcdd9e3 default
parent child Browse files
Show More
@@ -23,6 +23,10 b' from rhodecode.config import routing_lin'
23 def includeme(config):
23 def includeme(config):
24
24
25 config.add_route(
25 config.add_route(
26 name='home',
27 pattern='/')
28
29 config.add_route(
26 name='user_autocomplete_data',
30 name='user_autocomplete_data',
27 pattern='/_users')
31 pattern='/_users')
28
32
@@ -38,7 +42,7 b' def includeme(config):'
38 name='goto_switcher_data',
42 name='goto_switcher_data',
39 pattern='/_goto_data')
43 pattern='/_goto_data')
40
44
41 # register our static links via redirection mechanismy
45 # register our static links via redirection mechanism
42 routing_links.connect_redirection_links(config)
46 routing_links.connect_redirection_links(config)
43
47
44 # Scan module for configuration decorators.
48 # Scan module for configuration decorators.
@@ -222,6 +222,7 b' def add_pylons_compat_data(registry, glo'
222 def error_handler(exception, request):
222 def error_handler(exception, request):
223 import rhodecode
223 import rhodecode
224 from rhodecode.lib.utils2 import AttributeDict
224 from rhodecode.lib.utils2 import AttributeDict
225 from rhodecode.lib import helpers
225
226
226 rhodecode_title = rhodecode.CONFIG.get('rhodecode_title') or 'RhodeCode'
227 rhodecode_title = rhodecode.CONFIG.get('rhodecode_title') or 'RhodeCode'
227
228
@@ -255,9 +256,9 b' def error_handler(exception, request):'
255 c.causes = []
256 c.causes = []
256 if hasattr(base_response, 'causes'):
257 if hasattr(base_response, 'causes'):
257 c.causes = base_response.causes
258 c.causes = base_response.causes
258
259 c.messages = helpers.flash.pop_messages()
259 response = render_to_response(
260 response = render_to_response(
260 '/errors/error_document.mako', {'c': c}, request=request,
261 '/errors/error_document.mako', {'c': c, 'h': helpers}, request=request,
261 response=base_response)
262 response=base_response)
262
263
263 return response
264 return response
@@ -24,11 +24,10 b''
24 <script type="text/javascript" src="${h.asset('js/scripts.js', ver=c.rhodecode_version_hash)}"></script>
24 <script type="text/javascript" src="${h.asset('js/scripts.js', ver=c.rhodecode_version_hash)}"></script>
25 </head>
25 </head>
26 <body>
26 <body>
27 <% messages = h.flash.pop_messages() %>
28
27
29 <div class="wrapper error_page">
28 <div class="wrapper error_page">
30 <div class="sidebar">
29 <div class="sidebar">
31 <a href="${h.url('home')}"><img class="error-page-logo" src="${h.asset('images/RhodeCode_Logo_Black.png')}" alt="RhodeCode"/></a>
30 <a href="${h.route_path('home')}"><img class="error-page-logo" src="${h.asset('images/RhodeCode_Logo_Black.png')}" alt="RhodeCode"/></a>
32 </div>
31 </div>
33 <div class="main-content">
32 <div class="main-content">
34 <h1>
33 <h1>
@@ -37,8 +36,8 b''
37 </span><br/>
36 </span><br/>
38 ${c.error_message} | <span class="error_message">${c.error_explanation}</span>
37 ${c.error_message} | <span class="error_message">${c.error_explanation}</span>
39 </h1>
38 </h1>
40 % if messages:
39 % if c.messages:
41 % for message in messages:
40 % for message in c.messages:
42 <div class="alert alert-${message.category}">${message}</div>
41 <div class="alert alert-${message.category}">${message}</div>
43 % endfor
42 % endfor
44 % endif
43 % endif
General Comments 0
You need to be logged in to leave comments. Login now