From 164b5a01bd4ac1b681751b4825d1f3b05e970b1a Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Sat, 19 Apr 2025 14:52:52 +0200 Subject: [PATCH] wip: add link to open template in a new window --- umap/static/umap/js/modules/importers/templates.js | 2 +- umap/views.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/umap/static/umap/js/modules/importers/templates.js b/umap/static/umap/js/modules/importers/templates.js index 1299284a..12bf0494 100644 --- a/umap/static/umap/js/modules/importers/templates.js +++ b/umap/static/umap/js/modules/importers/templates.js @@ -48,7 +48,7 @@ export class Importer { const item = Utils.loadTemplate( `
-
${template.description}
+
${template.description} ${translate('Open')}
` ) body.appendChild(item) diff --git a/umap/views.py b/umap/views.py index d2baacba..2d40fcd8 100644 --- a/umap/views.py +++ b/umap/views.py @@ -1465,6 +1465,12 @@ class TemplateList(ListView): elif source == "staff": qs = Map.public.starred_by_staff().filter(is_template=True) templates = [ - {"id": m.id, "name": m.name, "description": m.description} for m in qs + { + "id": m.id, + "name": m.name, + "description": m.description, + "url": m.get_absolute_url(), + } + for m in qs ] return simple_json_response(templates=templates)