publik: use new flag to discover portal agent url/title (#11420)
This commit is contained in:
parent
8029e57324
commit
619632a123
|
@ -24,8 +24,13 @@ def services_js(request, *args, **kwargs):
|
|||
if not getattr(settings, 'KNOWN_SERVICES', None):
|
||||
raise Http404()
|
||||
services = []
|
||||
portal_agent_url = None
|
||||
portal_agent_title = None
|
||||
for service_id, services_dict in settings.KNOWN_SERVICES.items():
|
||||
for service_slug, service in services_dict.items():
|
||||
if service.get('is-portal-agent'):
|
||||
portal_agent_url = service['url']
|
||||
portal_agent_title = service['title']
|
||||
services.append({
|
||||
'title': service['title'],
|
||||
'slug': service_slug,
|
||||
|
@ -36,8 +41,8 @@ def services_js(request, *args, **kwargs):
|
|||
})
|
||||
response_vars = {
|
||||
'PUBLIK_ENVIRONMENT_LABEL': settings.TEMPLATE_VARS.get('environment_label'),
|
||||
'PUBLIK_PORTAL_AGENT_URL': request.build_absolute_uri('/'),
|
||||
'PUBLIK_PORTAL_AGENT_TITLE': settings.TEMPLATE_VARS.get('site_title') or _('Portal Agent'),
|
||||
'PUBLIK_PORTAL_AGENT_URL': portal_agent_url,
|
||||
'PUBLIK_PORTAL_AGENT_TITLE': portal_agent_title,
|
||||
'PUBLIK_PORTAL_AGENT_EXTRA_CSS': settings.TEMPLATE_VARS.get(
|
||||
'portal_agent_extra_css'),
|
||||
'COMBO_KNOWN_SERVICES': services,
|
||||
|
|
Loading…
Reference in New Issue