2024-08-22 10:13:16 +02:00
|
|
|
{{define "item:relations_view"}}
|
|
|
|
{{ if (gt (len .relations) 0) }}
|
|
|
|
<fieldset class="w3-round-large" style="margin-bottom: 40px">
|
|
|
|
<legend>Relations</legend>
|
2024-11-17 20:12:20 +01:00
|
|
|
<ul>
|
2024-08-22 10:13:16 +02:00
|
|
|
{{
|
|
|
|
range.relations
|
|
|
|
}}
|
|
|
|
{{ $target_id := .Related_item_id}}
|
|
|
|
{{ $relation_type := .Relation_type }}
|
|
|
|
{{ if eq .Related_item_id $.item.Id }}
|
|
|
|
{{ $target_id = .Item_id}}
|
|
|
|
{{ if eq "Parent" .Relation_type}}
|
|
|
|
{{ $relation_type = "Child" }}
|
|
|
|
{{ else if eq "Child" .Relation_type}}
|
|
|
|
{{ $relation_type = "Parent" }}
|
|
|
|
{{
|
|
|
|
end
|
|
|
|
}}
|
|
|
|
{{
|
|
|
|
end
|
|
|
|
}}
|
|
|
|
<li>
|
|
|
|
<a
|
|
|
|
href="/item/view/{{ $target_id }}"
|
|
|
|
hx-get="/item/view/{{ $target_id }}"
|
|
|
|
hx-target="#modal-container"
|
|
|
|
>
|
|
|
|
<i class="{{.Type_icon}}" title="{{.Type_title}}"></i> {{.Title}}</a>
|
|
|
|
</li>
|
|
|
|
{{
|
|
|
|
end
|
|
|
|
}}
|
|
|
|
</ul>
|
|
|
|
</fieldset>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|