Show More
@@ -19,7 +19,6 b'' | |||||
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |
20 |
|
20 | |||
21 |
|
21 | |||
22 | from rhodecode.apps.admin.navigation import NavigationRegistry |
|
|||
23 | from rhodecode.apps._base import ADMIN_PREFIX |
|
22 | from rhodecode.apps._base import ADMIN_PREFIX | |
24 | from rhodecode.lib.utils2 import str2bool |
|
23 | from rhodecode.lib.utils2 import str2bool | |
25 |
|
24 | |||
@@ -310,12 +309,10 b' def admin_routes(config):' | |||||
310 |
|
309 | |||
311 |
|
310 | |||
312 | def includeme(config): |
|
311 | def includeme(config): | |
313 | settings = config.get_settings() |
|
312 | from rhodecode.apps.admin.navigation import includeme as nav_includeme | |
314 |
|
313 | |||
315 | # Create admin navigation registry and add it to the pyramid registry. |
|
314 | # Create admin navigation registry and add it to the pyramid registry. | |
316 | labs_active = str2bool(settings.get('labs_settings_active', False)) |
|
315 | nav_includeme(config) | |
317 | navigation_registry = NavigationRegistry(labs_active=labs_active) |
|
|||
318 | config.registry.registerUtility(navigation_registry) |
|
|||
319 |
|
316 | |||
320 | # main admin routes |
|
317 | # main admin routes | |
321 | config.add_route(name='admin_home', pattern=ADMIN_PREFIX) |
|
318 | config.add_route(name='admin_home', pattern=ADMIN_PREFIX) |
@@ -26,6 +26,7 b' from zope.interface import implementer' | |||||
26 |
|
26 | |||
27 | from rhodecode.apps.admin.interfaces import IAdminNavigationRegistry |
|
27 | from rhodecode.apps.admin.interfaces import IAdminNavigationRegistry | |
28 | from rhodecode.lib.utils import get_registry |
|
28 | from rhodecode.lib.utils import get_registry | |
|
29 | from rhodecode.lib.utils2 import str2bool | |||
29 | from rhodecode.translation import _ |
|
30 | from rhodecode.translation import _ | |
30 |
|
31 | |||
31 |
|
32 | |||
@@ -137,3 +138,11 b' def navigation_list(request):' | |||||
137 | Helper that returns the admin navigation as list of NavListEntry objects. |
|
138 | Helper that returns the admin navigation as list of NavListEntry objects. | |
138 | """ |
|
139 | """ | |
139 | return navigation_registry(request).get_navlist(request) |
|
140 | return navigation_registry(request).get_navlist(request) | |
|
141 | ||||
|
142 | ||||
|
143 | def includeme(config): | |||
|
144 | # Create admin navigation registry and add it to the pyramid registry. | |||
|
145 | settings = config.get_settings() | |||
|
146 | labs_active = str2bool(settings.get('labs_settings_active', False)) | |||
|
147 | navigation_registry = NavigationRegistry(labs_active=labs_active) | |||
|
148 | config.registry.registerUtility(navigation_registry) No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now