]> git.0d.be Git - panikweb.git/blob - panikweb/context_processors.py
templates: make onair.json a data parameter (and allow on-the-fly changes)
[panikweb.git] / panikweb / context_processors.py
1 from combo.apps.pwa.models import PwaSettings
2 from combo.data.models import Page
3 from combo.utils.cache import cache_during_request
4 from django.conf import settings
5
6
7 def panikweb(request):
8     d = {
9         'site_url': request.build_absolute_uri('/').strip('/'),
10         'radio_name': settings.RADIO_NAME,
11         'radio_long_name': settings.RADIO_LONG_NAME or settings.RADIO_NAME,
12         'radio_meta_description': settings.RADIO_META_DESCRIPTION or '',
13         'radio_meta_default_image_path': settings.RADIO_META_DEFAULT_IMAGE_PATH,
14         'pwa_settings': cache_during_request(PwaSettings.singleton),
15         'section': request.path.strip('/').split('/')[0],
16         'navigation_pages': Page.objects.filter(parent__isnull=True, exclude_from_navigation=False),
17     }
18     d.update(settings.TEMPLATE_VARS)
19     return d