summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2019-12-15 15:11:50 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2019-12-17 10:34:50 (GMT)
commit904655c2932024e9eb71351ca436244eef468b38 (patch)
tree8d9e26d0a23c20a13e1a26d49942493d991aa3a7
parent499093ca7da6f64468637e77dddb9ba82c5f4289 (diff)
downloadcombo-904655c2932024e9eb71351ca436244eef468b38.zip
combo-904655c2932024e9eb71351ca436244eef468b38.tar.gz
combo-904655c2932024e9eb71351ca436244eef468b38.tar.bz2
misc: add context elements to have navigation/footer in mellon pages (#19515)
-rw-r--r--combo/public/templates/combo/mellon_base_template.html (renamed from combo/public/templates/mellon/base.html)4
-rw-r--r--combo/public/views.py9
-rw-r--r--combo/urls.py9
-rw-r--r--debian/control2
-rw-r--r--tox.ini2
5 files changed, 18 insertions, 8 deletions
diff --git a/combo/public/templates/mellon/base.html b/combo/public/templates/combo/mellon_base_template.html
index 7e615a5..78ab189 100644
--- a/combo/public/templates/mellon/base.html
+++ b/combo/public/templates/combo/mellon_base_template.html
@@ -1,11 +1,7 @@
{% extends "combo/page_template.html" %}
-{% block menu %}{% endblock %}
-
{% block combo-content %}
{% block mellon_content %}
{% endblock %}
{% endblock %}
-{% block footer %}
-{% endblock %}
diff --git a/combo/public/views.py b/combo/public/views.py
index e607a82..db6a028 100644
--- a/combo/public/views.py
+++ b/combo/public/views.py
@@ -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()]
diff --git a/combo/urls.py b/combo/urls.py
index 634b648..f085dbc 100644
--- a/combo/urls.py
+++ b/combo/urls.py
@@ -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()
diff --git a/debian/control b/debian/control
index 12da38f..bd4df54 100644
--- a/debian/control
+++ b/debian/control
@@ -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
diff --git a/tox.ini b/tox.ini
index 31c313e..173e37d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -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