{{define "item:relations"}}
Item | Categories | Tags | Relation type | |
---|---|---|---|---|
{{ $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 }} {{.Title}} |
{{ if gt (len .Categories) 0 }}
{{ range (stringToArray .Categories "|")}}
{{ $category_name := index $.categoriesMap .}}
{{ $category_name }}
{{ end }}
{{ end }}
|
{{ if gt (len .Tags) 0 }}
{{ range (stringToArray .Tags ",")}}
{{ . }}
{{ end }}
{{ end }}
|
{{ widget_relation_type $relation_name $relation_type `id="$relation_name" class="w3-input w3-border"` }} |