Add customized links to page footer (#2685)

Co-authored-by: Richard Schreiber <wiffbi@gmail.com>
This commit is contained in:
Raphael Michel
2022-06-16 11:21:11 +02:00
committed by GitHub
parent 54a4631e22
commit 75c069111e
11 changed files with 336 additions and 21 deletions

View File

@@ -118,6 +118,10 @@ def _default_context(request):
_footer += response
else:
_footer.append(response)
_footer += request.event.cache.get_or_set('footer_links', lambda: [
{'url': fl.url, 'label': fl.label}
for fl in request.event.footer_links.all()
], timeout=300)
if request.event.settings.presale_css_file:
ctx['css_file'] = default_storage.url(request.event.settings.presale_css_file)
@@ -158,6 +162,10 @@ def _default_context(request):
ctx['organizer_logo'] = request.organizer.settings.get('organizer_logo_image', as_type=str, default='')[7:]
ctx['organizer_homepage_text'] = request.organizer.settings.get('organizer_homepage_text', as_type=LazyI18nString)
ctx['organizer'] = request.organizer
_footer += request.organizer.cache.get_or_set('footer_links', lambda: [
{'url': fl.url, 'label': fl.label}
for fl in request.organizer.footer_links.all()
], timeout=300)
ctx['html_head'] = "".join(h for h in _html_head if h)
ctx['html_foot'] = "".join(h for h in _html_foot if h)