{{define "tags.html"}} {{template "layout_head" .}} {{$prefix := .Prefix}} {{$sort := .Sort}} {{$order := .Order}} {{$catID := .CategoryID}} {{$origin := .Origin}} {{$type := .Type}} {{$created := .CreatedAfter}} {{$conflicts := ""}}{{if .Conflicts}}{{$conflicts = "1"}}{{end}} {{$zero := "0"}}{{if .ZeroOnly}}{{$zero = "only"}}{{else if .ShowZero}}{{$zero = "1"}}{{end}} {{template "layout_mid" .}}

Tags {{.Total}}

{{$nameOrder := "asc"}}{{if and (eq $sort "name") (eq $order "asc")}}{{$nameOrder = "desc"}}{{end}} {{$usageOrder := "desc"}}{{if and (eq $sort "usage") (eq $order "desc")}}{{$usageOrder = "asc"}}{{end}} {{$createdOrder := "desc"}}{{if and (eq $sort "created") (eq $order "desc")}}{{$createdOrder = "asc"}}{{end}} {{$lastOrder := "desc"}}{{if and (eq $sort "last_used") (eq $order "desc")}}{{$lastOrder = "asc"}}{{end}} {{$csrf := .CSRFToken}} {{$cats := .Categories}} {{$imps := .Implications}} {{range .Tags}} {{$tag := .}} {{else}} {{end}}
Name{{if eq $sort "name"}}{{if eq $order "asc"}}▲{{else}}▼{{end}}{{end}} Implied Category Usage{{if eq $sort "usage"}}{{if eq $order "asc"}}▲{{else}}▼{{end}}{{end}} Origin Created{{if eq $sort "created"}}{{if eq $order "asc"}}▲{{else}}▼{{end}}{{end}} Last used{{if eq $sort "last_used"}}{{if eq $order "asc"}}▲{{else}}▼{{end}}{{end}} Action
{{if .IsAlias}} {{.Name}} {{.CanonicalName}} alias {{else}} {{.Name}} {{if eq .CategoryName "rating"}}(built-in){{end}} {{end}} {{with index $imps .ID}} {{$n := len .}} {{range $i, $im := .}}{{if lt $i 5}}{{if $i}} {{end}}{{$im.ImpliedName}}{{end}}{{end}} {{if gt $n 5}} +{{sub $n 5}}{{end}} {{end}} {{if eq .CategoryName "rating"}} {{.CategoryName}} {{else}} {{end}} {{.UsageCount}} {{if .Origin}} {{$kind := index $.OriginKinds .Origin}} {{if eq $kind "user"}}user {{else}}{{.Origin}}{{end}} {{else}}{{end}} {{.CreatedAt.Format "2006-01-02"}} {{if .LastUsedAt.IsZero}}{{else}}{{.LastUsedAt.Format "2006-01-02"}}{{end}}
See detail {{if ne .CategoryName "rating"}} {{else}} {{end}}
No tags found.
{{$page := .Page}} {{$tagsBase := printf "/tags?q=%s&sort=%s&order=%s&cat=%s&origin=%s&type=%s&created_after=%s&conflicts=%s&show_zero=%s&page=" .Prefix .Sort .Order .CategoryID .Origin .Type .CreatedAfter $conflicts $zero}}
{{template "partials/pagination.html" (dict "Base" $tagsBase "Page" $page "Total" .TotalPages)}}

Rename

{{template "tag_suggest_input" dict "Name" "canonical_id" "InputID" "batch-alias-canon" "SuggestID" "batch-alias-suggest"}}

Each tag's images move onto the canonical and its implications go with it; the name stays as a zero-usage alias. This cannot be undone.

The canonical is created if it doesn't exist yet.

Which tag do the others merge into?

The other tags' images move onto the chosen tag and their names stay as zero-usage aliases. This cannot be undone.

{{template "tag_suggest_input" dict "Name" "target" "InputID" "batch-imply-target" "SuggestID" "batch-imply-suggest"}}

Add also applies the implication to images already carrying each tag; Remove sweeps implied rows the edge no longer justifies. Cycles and aliases are skipped and reported.

Create a new tag.

Create an alias resolving to another tag.
The canonical tag is created if it doesn't exist yet.

{{template "tag_suggest_input" dict "Name" "canonical_id" "InputID" "alias-create-canon" "SuggestID" "alias-create-suggest" "Required" true}}

Tags are removed from every image they touch. This cannot be undone. Built-in rating tags are usage-stripped (the catalog row stays).

{{if and .MonloaderPaired .MonloaderPTR}}

Aliases and implications the Public Tag Repository declares are added to the catalog.

{{end}} {{template "layout_end" .}} {{end}}