Mercurial > piecrust2
comparison piecrust/admin/views/__init__.py @ 888:2b0fa2e4c12f
admin: Make the admin panel work under a non-rooted URL.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 02 Jul 2017 22:14:51 -0700 |
parents | 5e91bc0e3b4d |
children | 5b4c02ed9bb2 |
comparison
equal
deleted
inserted
replaced
887:c0cbcd4752f0 | 888:2b0fa2e4c12f |
---|---|
1 from flask import render_template | 1 from flask import render_template, current_app |
2 from flask.views import View | 2 from flask.views import View |
3 from .menu import get_menu_context | 3 from .menu import get_menu_context |
4 | 4 |
5 | 5 |
6 class FoodTruckView(View): | 6 class FoodTruckView(View): |
22 | 22 |
23 def with_menu_context(context=None): | 23 def with_menu_context(context=None): |
24 if context is None: | 24 if context is None: |
25 context = {} | 25 context = {} |
26 context['menu'] = get_menu_context() | 26 context['menu'] = get_menu_context() |
27 context['base_url'] = current_app.config['FOODTRUCK_URL_PREFIX'] | |
27 return context | 28 return context |
28 | 29 |