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}} :
|
|
|
|
<a
|
|
|
|
href="/item/view/{{.relatedItem.Id}}"
|
|
|
|
hx-get="/item/view/{{.relatedItem.Id}}"
|
|
|
|
hx-target="#modal-container"
|
|
|
|
>{{.relatedItem.Title}}</a
|
|
|
|
>
|
|
|
|
</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>
|
|
|
|
<td class="no-label">{{ widget_relation_type $relation_name "Link" `id="$relation_name" class="w3-input w3-border"` }}</td>
|
|
|
|
<td class="no-label">
|
|
|
|
<div class="w3-bar">
|
|
|
|
<a
|
|
|
|
class="w3-right w3-btn w3-metro-dark-red w3-round-large"
|
|
|
|
href="#"
|
|
|
|
_="on click remove #{{$relation_name}}-Row"
|
2024-11-10 20:52:32 +01:00
|
|
|
><i class="bi bi-link-45deg" title="Remove relation"></i><span class="hide-small"> Remove</span></a
|
2024-08-22 10:13:16 +02:00
|
|
|
>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{ end }}
|