misc: add context elements to have navigation/footer in mellon pages (#19515)
This commit is contained in:
parent
499093ca7d
commit
904655c293
|
@ -1,11 +1,7 @@
|
|||
{% extends "combo/page_template.html" %}
|
||||
|
||||
{% block menu %}{% endblock %}
|
||||
|
||||
{% block combo-content %}
|
||||
{% block mellon_content %}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}
|
||||
{% endblock %}
|
|
@ -524,6 +524,15 @@ def error404(request, *args, **kwargs):
|
|||
template_name = 'combo/404.html'
|
||||
return publish_page(request, page, status=404, template_name=template_name)
|
||||
|
||||
def mellon_page_hook(context):
|
||||
page = Page()
|
||||
page.title = 'Hello'
|
||||
page.template_name = 'standard'
|
||||
context['page'] = page
|
||||
home = Page.objects.filter(slug='index', parent=None).first()
|
||||
if home:
|
||||
context['page_cells'] = CellBase.get_cells(page=home)
|
||||
|
||||
def menu_badges(request):
|
||||
context = {'request': request}
|
||||
page_ids = [x for x in request.GET.getlist('page[]') if x.isdigit()]
|
||||
|
|
|
@ -23,7 +23,7 @@ from django.views.i18n import javascript_catalog
|
|||
|
||||
from .urls_utils import decorated_includes, manager_required
|
||||
|
||||
from .public.views import login, logout, error404
|
||||
from .public.views import login, logout, error404, mellon_page_hook
|
||||
from .manager.urls import urlpatterns as combo_manager_urls
|
||||
|
||||
from . import plugins
|
||||
|
@ -41,7 +41,12 @@ urlpatterns = [
|
|||
handler404 = error404
|
||||
|
||||
if 'mellon' in settings.INSTALLED_APPS:
|
||||
urlpatterns.append(url(r'^accounts/mellon/', include('mellon.urls')))
|
||||
urlpatterns.append(url(r'^accounts/mellon/', include('mellon.urls'),
|
||||
kwargs={
|
||||
'template_base': 'combo/mellon_base_template.html',
|
||||
'context_hook': mellon_page_hook,
|
||||
})
|
||||
)
|
||||
|
||||
# static and media files
|
||||
urlpatterns += staticfiles_urlpatterns()
|
||||
|
|
|
@ -39,7 +39,7 @@ Depends: ${misc:Depends},
|
|||
python3-hobo (>= 1.34),
|
||||
python3-django-tenant-schemas,
|
||||
python3-psycopg2,
|
||||
python3-django-mellon,
|
||||
python3-django-mellon (>= 1.12),
|
||||
uwsgi,
|
||||
uwsgi-plugin-python3
|
||||
Recommends: nginx
|
||||
|
|
Loading…
Reference in New Issue