Skip to content
Snippets Groups Projects
Verified Commit 6c37b9d2 authored by morre's avatar morre
Browse files

Add banner to services overview

parent 308071ac
No related branches found
No related tags found
No related merge requests found
...@@ -122,6 +122,13 @@ SERVICES=[ ...@@ -122,6 +122,13 @@ SERVICES=[
# ] # ]
# }, # },
] ]
# A banner text that will be displayed above the services list
SERVICES_BANNER=''
# If the banner should be shown to users who are not logged in
SERVICES_BANNER_PUBLIC=True
# Enable the service overview page for users who are not logged in # Enable the service overview page for users who are not logged in
SERVICES_PUBLIC=True SERVICES_PUBLIC=True
......
...@@ -8,6 +8,14 @@ ...@@ -8,6 +8,14 @@
<div class="alert alert-warning" role="alert">Some services may not be publicly listed! Log in to see all services you have access to.</div> <div class="alert alert-warning" role="alert">Some services may not be publicly listed! Log in to see all services you have access to.</div>
{% endif %} {% endif %}
{% if banner %}
<div class="card">
<div class="card-body">
{{ banner|safe }}
</div>
</div>
{% endif %}
{% macro service_card(service) %} {% macro service_card(service) %}
<div class="col mb-4"> <div class="col mb-4">
<div class="card h-100 {{ 'text-muted' if not service.has_access }}"> <div class="card h-100 {{ 'text-muted' if not service.has_access }}">
......
...@@ -83,4 +83,11 @@ def index(): ...@@ -83,4 +83,11 @@ def index():
services = get_services(user) services = get_services(user)
if not current_app.config['SERVICES']: if not current_app.config['SERVICES']:
abort(404) abort(404)
return render_template('overview.html', user=user, services=services)
banner = current_app.config.get('SERVICES_BANNER')
# Set the banner to None if it is not public and no user is logged in
if not (current_app.config["SERVICES_BANNER_PUBLIC"] or user):
banner = None
return render_template('overview.html', user=user, services=services, banner=banner)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment