feature/Re-brand API Manager - fonts

This commit is contained in:
Marko Milić 2021-07-30 12:53:17 +02:00
parent 8445f9a8ec
commit e53e8930de
5 changed files with 10 additions and 1 deletions

View File

@ -107,7 +107,8 @@ TEMPLATES = [
'base.context_processors.api_user_id',
'base.context_processors.api_tester_url',
'base.context_processors.portal_page',
'base.context_processors.logo_url'
'base.context_processors.logo_url',
'base.context_processors.override_css_url'
],
},
},
@ -268,6 +269,7 @@ EXCLUDE_URL_PATTERN = []
API_EXPLORER_APP_NAME = 'API Explorer'
LOGO_URL = 'https://static.openbankproject.com/images/OBP/favicon.png'
OVERRIDE_CSS_URL = None
# Local settings can override anything in here
try:

View File

@ -28,6 +28,11 @@ def logo_url(request):
return {'logo_url': settings.LOGO_URL}
def override_css_url(request):
"""Returns the configured OVERRIDE_CSS_URL"""
return {'override_css_url': settings.OVERRIDE_CSS_URL}
def api_username(request):
"""Returns the API username/email of the logged-in user"""
nametodisplay = 'not authenticated'

View File

View File

@ -13,6 +13,7 @@
<link href="{% static 'css/base.css' %}" rel="stylesheet">
<link href="{% static 'css/jsoneditor.min.css' %}" rel="stylesheet">
<link href="{% static 'css/obpjsoneditor.css' %}" rel="stylesheet">
<link href="{{ override_css_url }}" rel="stylesheet">
{% block extracss %}{% endblock extracss %}
</head>
<body>

View File

@ -18,6 +18,7 @@ class HomeView(TemplateView):
context.update({
'API_HOST': settings.API_HOST,
'logo_url': settings.LOGO_URL,
'override_css_url': settings.OVERRIDE_CSS_URL,
'directlogin_form': DirectLoginForm(),
'gatewaylogin_form': GatewayLoginForm(),
})