misc: add context elements to have navigation/footer in mellon pages (#19515)

This commit is contained in:
Frédéric Péters 2019-12-15 16:11:50 +01:00
parent 499093ca7d
commit 904655c293
5 changed files with 18 additions and 8 deletions

View File

@ -1,11 +1,7 @@
{% extends "combo/page_template.html" %}
{% block menu %}{% endblock %}
{% block combo-content %}
{% block mellon_content %}
{% endblock %}
{% endblock %}
{% block footer %}
{% endblock %}

View File

@ -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()]

View File

@ -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()

2
debian/control vendored
View File

@ -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

View File

@ -23,7 +23,7 @@ deps =
pylint-django<0.8.1
django-webtest<1.9.3
psycopg2
django-mellon
django-mellon>=1.12
py2: django-jsonfield<1.3
py2: quixote<3.0
py2: vobject