mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 11:32:38 +02:00
wip: add link to open template in a new window
This commit is contained in:
parent
9f2d78caeb
commit
2c8022b422
2 changed files with 8 additions and 2 deletions
|
@ -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} <a href="${template.url}" target="_blank">${translate('Open')}</a></dd>
|
||||
</dl>`
|
||||
)
|
||||
body.appendChild(item)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue