Skip to content
Snippets Groups Projects
Verified Commit 8a6518ab authored by sistason's avatar sistason
Browse files

Merge remote-tracking branch 'remotes/origin/master' into ldap_user_conn

parents 89d106f6 6a832095
No related branches found
No related tags found
No related merge requests found
......@@ -148,6 +148,7 @@ disable=missing-module-docstring,
bad-continuation,
too-many-ancestors,
no-self-use,
duplicate-code,
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
......
......@@ -36,3 +36,4 @@ attrs==18.2.0
more-itertools==4.2.0
pluggy==0.8.0
py==1.7.0
pyOpenSSL==19.0.0
......@@ -113,7 +113,12 @@ SERVICES=[
# # Infos are small/medium amounts of information displayed in a modal
# # dialog. All matching items are visible.
# 'infos': [
# {'title': 'Documentation', 'html': '<p>Some information about the service as html</p>', 'required_group': 'users'},
# {
# 'title': 'uffd',
# 'button_text': 'Documentation', # Defaults to the title if not set
# 'html': '<p>Some information about the service as html</p>',
# 'required_group': 'users',
# },
# ],
# # Links to external sites, all matching items are visible
# 'links': [
......@@ -121,6 +126,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
SERVICES_PUBLIC=True
......
......@@ -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>
{% endif %}
{% if banner %}
<div class="card">
<div class="card-body">
{{ banner|safe }}
</div>
</div>
{% endif %}
{% macro service_card(service) %}
<div class="col mb-4">
<div class="card h-100 {{ 'text-muted' if not service.has_access }}">
......@@ -41,7 +49,7 @@
<div class="list-group-item"><i class="fas fa-users" {{ iconstyle }}></i> {{ group.name }}</div>
{% endfor %}
{% for info in service.infos %}
<a href="#" class="list-group-item list-group-item-action" data-toggle="modal" data-target="#info-modal-{{ info.id }}"><i class="fas fa-info-circle" {{ iconstyle }}></i> {{ info.title }}</a>
<a href="#" class="list-group-item list-group-item-action" data-toggle="modal" data-target="#info-modal-{{ info.id }}"><i class="fas fa-info-circle" {{ iconstyle }}></i> {{ info.button_text }}</a>
{% endfor %}
{% for link in service.links %}
<a href="{{ link.url }}" class="list-group-item list-group-item-action"><i class="fas fa-external-link-alt" {{ iconstyle }}></i> {{ link.title }}</a>
......
......@@ -53,6 +53,7 @@ def get_services(user=None):
continue
info = {
'title': info_data['title'],
'button_text': info_data.get('button_text', info_data['title']),
'html': info_data['html'],
'id': '%d-%d'%(len(services), len(service['infos'])),
}
......@@ -82,4 +83,11 @@ def index():
services = get_services(user)
if not current_app.config['SERVICES']:
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.
Please register or to comment