{{define "relations_image.html"}} {{template "layout_head" .}} {{template "layout_mid" .}}
‹ Image / image {{.Image.ID}}
{{if and (not .Relations.HasAny) (not .Collection)}}

This image has no declared relations. {{if .Image.Phash}} Find similar images via phash. {{else}} (no phash computed)

{{end}}

{{end}} {{if .Collection}}

Same collection

{{end}} {{if .Relations.DupGroup}}

Same image as {{if eq .Relations.DupGroup.Original .Self}}this image{{else}}image {{.Relations.DupGroup.Original}}{{end}}

{{end}} {{if .Relations.AltGroupMembers}}

Variants

{{end}} {{if .VersionChainGens}}

Revision history

{{range $g, $gen := .VersionChainGens}} {{if $g}}{{end}} {{range $id := $gen}} {{$action := index $.VersionActions $id}}
image {{$id}} Version · #{{$id}} {{if eq $action "this"}} ^ This image {{else if eq $action "earlier"}} {{template "partials/relation_unlink_form.html" (dict "CSRFToken" $.CSRFToken "Type" "version" "A" $id "B" $.Image.ID "Label" "[unlink earlier revision]" "ExtraClass" "relations-inline-action")}} {{else if eq $action "newer"}} {{template "partials/relation_unlink_form.html" (dict "CSRFToken" $.CSRFToken "Type" "version" "A" $.Image.ID "B" $id "Label" "[unlink newer revision]" "ExtraClass" "relations-inline-action")}} {{end}}
{{end}} {{end}}
{{end}} {{if .DerivativeTreeRows}}

Image based on {{if .Relations.DerivativeSource}}image {{deref64 .Relations.DerivativeSource}}{{else}}this image{{end}}

{{range .DerivativeTreeRows}} {{$row := .}} {{$action := index $.DerivativeActions .ID}}
{{if .Trunks}} {{end}} image {{.ID}} {{if eq .Depth 0}}Source · {{else}}Derivative · {{end}}#{{.ID}} {{if eq $action "this"}} <- This image {{else if eq $action "source"}} {{template "partials/relation_unlink_form.html" (dict "CSRFToken" $.CSRFToken "Type" "derivative" "A" .ID "B" $.Image.ID "Label" (printf "[unlink source #%d]" .ID) "ExtraClass" "relations-inline-action")}} {{else if eq $action "derivative"}} {{template "partials/relation_unlink_form.html" (dict "CSRFToken" $.CSRFToken "Type" "derivative" "A" $.Image.ID "B" .ID "Label" (printf "[unlink derivative #%d]" .ID) "ExtraClass" "relations-inline-action")}} {{end}}
{{end}}
{{end}}
{{template "layout_end" .}} {{end}}