add home link to portal page

This commit is contained in:
tawoe 2021-06-30 10:55:27 +02:00
parent 7acfc14129
commit 3e747842b3
3 changed files with 13 additions and 0 deletions

View File

@ -106,6 +106,7 @@ TEMPLATES = [
'base.context_processors.api_username',
'base.context_processors.api_user_id',
'base.context_processors.api_tester_url',
'base.context_processors.portal_page'
],
},
},
@ -224,6 +225,8 @@ API_MANAGER_DATE_FORMAT= '%Y-%m-%d'
API_HOST = 'http://127.0.0.1:8080'
# Only override this if you have a separate portal instance
API_PORTAL = None
API_BASE_PATH = '/obp/v'
API_VERSION = '4.0.0'

View File

@ -9,11 +9,20 @@ from django.contrib import messages
from obp.api import API, APIError, LOGGER
from django.core.cache import cache
def api_root(request):
"""Returns the configured API_ROOT"""
return {'API_ROOT': settings.API_ROOT}
def portal_page(request):
"""Returns the configured API_PORTAL"""
if settings.API_PORTAL is None:
return {'API_PORTAL': settings.API_HOST}
else:
return {'API_PORTAL': settings.API_PORTAL}
def api_username(request):
"""Returns the API username/email of the logged-in user"""
nametodisplay = 'not authenticated'

View File

@ -29,6 +29,7 @@
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="{{ API_PORTAL }}" >Home</a></li>
{% url "consumers-index" as consumers_index_url %}
<li{% if consumers_index_url in request.path %} class="active"{% endif %}><a href="{{ consumers_index_url }}">Consumers</a></li>
{% url "entitlementrequests-index" as entitlementrequests_index_url %}