0001-misc-add-context-elements-to-have-navigation-footer-.patch
combo/public/templates/mellon/base.html → combo/public/templates/combo/mellon_base_template.html | ||
---|---|---|
1 | 1 |
{% extends "combo/page_template.html" %} |
2 | 2 | |
3 |
{% block menu %}{% endblock %} |
|
4 | ||
5 | 3 |
{% block combo-content %} |
6 | 4 |
{% block mellon_content %} |
7 | 5 |
{% endblock %} |
8 | 6 |
{% endblock %} |
9 | 7 | |
10 |
{% block footer %} |
|
11 |
{% endblock %} |
combo/public/views.py | ||
---|---|---|
527 | 527 |
template_name = 'combo/404.html' |
528 | 528 |
return publish_page(request, page, status=404, template_name=template_name) |
529 | 529 | |
530 |
def mellon_page_hook(context): |
|
531 |
page = Page() |
|
532 |
page.title = 'Hello' |
|
533 |
page.template_name = 'standard' |
|
534 |
context['page'] = page |
|
535 |
home = Page.objects.filter(slug='index', parent=None).first() |
|
536 |
if home: |
|
537 |
context['page_cells'] = CellBase.get_cells(page=home) |
|
538 | ||
530 | 539 |
def menu_badges(request): |
531 | 540 |
context = {'request': request} |
532 | 541 |
page_ids = [x for x in request.GET.getlist('page[]') if x.isdigit()] |
combo/urls.py | ||
---|---|---|
23 | 23 | |
24 | 24 |
from .urls_utils import decorated_includes, manager_required |
25 | 25 | |
26 |
from .public.views import login, logout, error404 |
|
26 |
from .public.views import login, logout, error404, mellon_page_hook
|
|
27 | 27 |
from .manager.urls import urlpatterns as combo_manager_urls |
28 | 28 | |
29 | 29 |
from . import plugins |
... | ... | |
41 | 41 |
handler404 = error404 |
42 | 42 | |
43 | 43 |
if 'mellon' in settings.INSTALLED_APPS: |
44 |
urlpatterns.append(url(r'^accounts/mellon/', include('mellon.urls'))) |
|
44 |
urlpatterns.append(url(r'^accounts/mellon/', include('mellon.urls'), |
|
45 |
kwargs={ |
|
46 |
'template_base': 'combo/mellon_base_template.html', |
|
47 |
'context_hook': mellon_page_hook, |
|
48 |
}) |
|
49 |
) |
|
45 | 50 | |
46 | 51 |
# static and media files |
47 | 52 |
urlpatterns += staticfiles_urlpatterns() |
48 |
- |