From 25be5fc61a5cf75a9b0fee82230bc829ca2f08d1 Mon Sep 17 00:00:00 2001 From: Morre <morre@cccv.de> Date: Sat, 3 Apr 2021 15:12:54 +0200 Subject: [PATCH] Add configurable button text for modals --- uffd/default_config.cfg | 7 ++++++- uffd/services/templates/overview.html | 2 +- uffd/services/views.py | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/uffd/default_config.cfg b/uffd/default_config.cfg index 727cb849..33653bcd 100644 --- a/uffd/default_config.cfg +++ b/uffd/default_config.cfg @@ -109,7 +109,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': [ diff --git a/uffd/services/templates/overview.html b/uffd/services/templates/overview.html index 7027676c..c81b8266 100644 --- a/uffd/services/templates/overview.html +++ b/uffd/services/templates/overview.html @@ -41,7 +41,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> diff --git a/uffd/services/views.py b/uffd/services/views.py index 4868eafc..7d9f03de 100644 --- a/uffd/services/views.py +++ b/uffd/services/views.py @@ -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'])), } -- GitLab