From 136cbae11bfee75cd70fd80096c394c6a0cd2074 Mon Sep 17 00:00:00 2001 From: Nicola Tarocco Date: Wed, 11 Sep 2024 22:56:35 +0200 Subject: [PATCH] feat: display packages versions in the side bar * display configured packages version at the bottom of the side bar * closes inveniosoftware/invenio-app-rdm#2838 --- invenio_administration/config.py | 7 +++++++ .../semantic-ui/invenio_administration/base.html | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/invenio_administration/config.py b/invenio_administration/config.py index 8276d86..978acbf 100644 --- a/invenio_administration/config.py +++ b/invenio_administration/config.py @@ -22,3 +22,10 @@ ADMINISTRATION_THEME_BASE_TEMPLATE = "invenio_theme/page.html" """Administration base template.""" + +ADMINISTRATION_DISPLAY_VERSIONS = [] +"""Display packages versions in the admin panel side bar. + +Accepts a list of tuples in the format (package name, version). +Example: [("my-app", "v1.3.2")] +""" diff --git a/invenio_administration/templates/semantic-ui/invenio_administration/base.html b/invenio_administration/templates/semantic-ui/invenio_administration/base.html index 6f19c9a..a4e003a 100644 --- a/invenio_administration/templates/semantic-ui/invenio_administration/base.html +++ b/invenio_administration/templates/semantic-ui/invenio_administration/base.html @@ -28,6 +28,22 @@ {% block admin_sidenav_menu %} {% include "invenio_administration/sidebar/sidenav.html" %} {% endblock %} + + + + {% if config.ADMINISTRATION_DISPLAY_VERSIONS %} +
+ {% for package_name, package_version in config.ADMINISTRATION_DISPLAY_VERSIONS %} + + {% endfor %} +
+ {% endif %} + {% endblock admin_sidenav %}