{{define "content"}} {{$csrf := .CSRF}}{{$kind := .Data.Kind}}{{$isBlack := .Data.IsBlacklist}}

{{.Title}}

{{if $isBlack}} Reusable sets of domains to block. One list can be attached to several policies. {{else}} Domains that must never be blocked. An allowlist match always beats a blacklist match. {{end}}

{{if .Data.Lists}}
{{range .Data.Lists}} {{end}}
ListDomainsUsed by UpdatedStatusActions
{{.Name}} {{if .Description}}
{{truncate 80 .Description}}
{{end}} {{if .SourceURL}}
{{truncate 60 .SourceURL}}
{{end}}
{{num .DomainCount}} {{if .UsedBy}}
{{range .UsedBy}}{{.}}{{end}}
{{else}} not used by any policy {{end}}
{{timeAgo .UpdatedAt}} {{statusWord .Enabled}}
{{template "postform" dict "Action" (printf "/policies/lists/%d/toggle" .ID) "CSRF" $csrf "ReturnTo" (printf "/policies/%ss" $kind) "Fields" (dict "enabled" (boolstr (not .Enabled))) "Icon" (toggleIcon .Enabled) "Class" "btn btn-sm btn-outline-secondary" "Title" (printf "%s this list" (toggleVerb .Enabled))}} {{template "confirmform" dict "Action" (printf "/policies/lists/%d/delete" .ID) "CSRF" $csrf "Icon" "bi-trash" "Message" (printf "Delete %q and all %d of its domains? This cannot be undone." .Name .DomainCount)}}
{{else if .Data.Search}} {{template "empty" dict "Icon" "bi-search" "Title" "No lists match that search" "Message" "Try a different term, or clear the search box."}} {{else}} {{if $isBlack}} {{template "empty" dict "Icon" "bi-shield-slash" "Title" "No blacklists yet" "Message" "Create a list such as Malware, Advertising or Adult Content, then import domains into it from a plain list, a hosts file, or an Adblock-style rule set."}} {{else}} {{template "empty" dict "Icon" "bi-shield-check" "Title" "No allowlists yet" "Message" "An allowlist holds the domains that must always resolve, even when a blacklist covers them. Attach it to the same policy as the blacklist you want to override."}} {{end}}
{{end}}
{{end}}