diff piecrust/admin/views/__init__.py @ 961:b1a00c2c0c7f

admin: Use URL routes for static assets. This removes the need for `base_url` and other workarounds for when the admin panel is under a sub-folder.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 07 Oct 2017 12:16:04 -0700
parents 7ecb946bfafd
children
line wrap: on
line diff
--- a/piecrust/admin/views/__init__.py	Sat Oct 07 12:13:57 2017 -0700
+++ b/piecrust/admin/views/__init__.py	Sat Oct 07 12:16:04 2017 -0700
@@ -24,14 +24,4 @@
     if context is None:
         context = {}
     context['menu'] = get_menu_context()
-    with_base_data(context)
     return context
-
-
-def with_base_data(context=None):
-    if context is None:
-        context = {}
-
-    script_root = request.script_root or ''
-    root_url = current_app.config.get('FOODTRUCK_ROOT_URL') or ''
-    context['base_url'] = script_root + root_url