Compare commits

...

2 commits

Author SHA1 Message Date
Yohan Boniface
d5571457cd
Merge 2c8022b422 into 162473da9d 2025-04-19 12:53:37 +00:00
Yohan Boniface
2c8022b422 wip: add link to open template in a new window 2025-04-19 14:52:52 +02:00
2 changed files with 8 additions and 2 deletions

View file

@ -48,7 +48,7 @@ export class Importer {
const item = Utils.loadTemplate(
`<dl>
<dt><label><input type="radio" value="${template.id}" name="template" />${template.name}</label></dt>
<dd>${template.description}</dd>
<dd>${template.description}&nbsp;<a href="${template.url}" target="_blank">${translate('Open')}</a></dd>
</dl>`
)
body.appendChild(item)

View file

@ -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)