From d9f4d31063bad838855bafe1296790a13c242009 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Tue, 1 Oct 2024 22:31:32 +0100 Subject: [PATCH] Pass with_forms to leaflet_draw_i18n template --- leaflet/templatetags/leaflet_tags.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/leaflet/templatetags/leaflet_tags.py b/leaflet/templatetags/leaflet_tags.py index ff94ed1a..8270000c 100644 --- a/leaflet/templatetags/leaflet_tags.py +++ b/leaflet/templatetags/leaflet_tags.py @@ -116,11 +116,11 @@ def leaflet_map(name, callback=None, fitextent=True, creatediv=True, } -@register.inclusion_tag('leaflet/leaflet_draw_i18n.html') -def leaflet_draw_i18n(): +@register.inclusion_tag('leaflet/leaflet_draw_i18n.html', takes_context=True) +def leaflet_draw_i18n(context): return { "Control_ResetView_TITLE": _("Reset view"), - # with_forms + "with_forms": context.get("with_forms", False), "draw_toolbar_actions_title": _("Cancel drawing"), "draw_toolbar_actions_text": _("Cancel"), "draw_toolbar_undo_title": _("Delete last point drawn"),