diff --git a/app/stiftung/templatetags/help_tags.py b/app/stiftung/templatetags/help_tags.py index 74661a3..83ef04a 100644 --- a/app/stiftung/templatetags/help_tags.py +++ b/app/stiftung/templatetags/help_tags.py @@ -34,6 +34,17 @@ def help_box_exists(page_key): return HelpBox.get_help_for_page(page_key) is not None +@register.filter +def get_item(dictionary, key): + """Lookup a key in a dictionary, trying int conversion for numeric keys.""" + if dictionary is None: + return None + result = dictionary.get(key) + if result is None and isinstance(key, str) and key.isdigit(): + result = dictionary.get(int(key)) + return result + + @register.filter def markdown_to_html(text): """Konvertiere Markdown-Text zu HTML""" diff --git a/app/templates/stiftung/nachweis_board.html b/app/templates/stiftung/nachweis_board.html index 6de8cba..4ee5651 100644 --- a/app/templates/stiftung/nachweis_board.html +++ b/app/templates/stiftung/nachweis_board.html @@ -1,5 +1,5 @@ {% extends 'base.html' %} -{% load static %} +{% load static help_tags %} {% block title %}Nachweis-Board – Stiftungsverwaltung{% endblock %}