2024-08-22 10:13:16 +02:00
|
|
|
{{define "item:add_relation"}}
|
|
|
|
{{ $relation_name := printf "%s%v" "ItemRelation-New-" .relatedItem.Id }}
|
|
|
|
<tr id="{{$relation_name}}-Row">
|
|
|
|
<td class="no-label"><i class="{{.relatedItem.Type_icon}}"></i> {{.relatedItem.Type_title}} :
|
2024-12-27 17:33:16 +01:00
|
|
|
<a href="/item/view/{{.relatedItem.Id}}" hx-get="/item/view/{{.relatedItem.Id}}" hx-target="body" hx-swap="beforeend">{{.relatedItem.Title}}</a>
|
2024-08-22 10:13:16 +02:00
|
|
|
</td>
|
|
|
|
<td class="no-label">
|
|
|
|
{{ if gt (len .relatedItem.Categories) 0 }}
|
2024-11-10 20:52:32 +01:00
|
|
|
<i class="hide-medium hide-large bi bi-bookmark-star-fill"></i>
|
2024-08-22 10:13:16 +02:00
|
|
|
{{ range (stringToArray .relatedItem.Categories "|")}}
|
|
|
|
{{ $category_name := index $.categoriesMap .}}
|
|
|
|
<div class="tag" style="padding: 3px">
|
|
|
|
{{ $category_name }}
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
</td>
|
|
|
|
<td class="no-label">
|
|
|
|
{{ if gt (len .relatedItem.Tags) 0 }}
|
2024-11-10 20:52:32 +01:00
|
|
|
<i class="hide-medium hide-large bi bi-tags-fill"></i>
|
2024-08-22 10:13:16 +02:00
|
|
|
{{ range (stringToArray .relatedItem.Tags ",")}}
|
|
|
|
<div class="tag" style="padding: 3px">
|
|
|
|
{{ . }}
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
</td>
|
2024-12-27 17:33:16 +01:00
|
|
|
<td class="no-label">{{ widget_relation_type $relation_name "Link" `id="$relation_name"` }}</td>
|
2024-08-22 10:13:16 +02:00
|
|
|
<td class="no-label">
|
2024-12-27 17:33:16 +01:00
|
|
|
<a class="button delete" href="#" onclick="document.getElementById('{{$relation_name}}-Row').remove()"><i class="bi bi-link-45deg" title="Remove relation"></i><span> Remove</span></a>
|
2024-08-22 10:13:16 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{ end }}
|