{{ define "user/fragments/vouchPopover" }} {{ $vr := index . "VouchRelationship" }} {{ $ev := index . "Evidences" }} {{ $isVouched := false }} {{ $isDenounced := false }} {{ $isUndecided := false }} {{ if $vr }} {{ if $vr.IsDirectVouch }} {{ $isVouched = true }} {{ else if $vr.IsDirectDenounce }} {{ $isDenounced = true }} {{ else }} {{ $isUndecided = true }} {{ end }} {{ else }} {{ $isUndecided = true }} {{ end }} {{ $userIdent := "" }} {{ $userDid := "" }} {{ with $vr }} {{ $userDid = .SubjectDid.String }} {{ $userIdent = resolve .SubjectDid.String }} {{ end }} {{ $popoverId := index . "PopoverId" }} {{ if not $popoverId }}{{ $popoverId = printf "vouch-modal-%s" (normalizeForHtmlId $userDid) }}{{ end }}

Vouch for {{ $userIdent }}

{{ with $vr }} {{ with .GetDirectVouch }} You {{if $isVouched}}vouched{{else}}denounced{{end}} {{ $userIdent }} {{ relTimeFmt .CreatedAt }}. You can change your decision below. {{ else }} Vouching builds a web-of-trust across Tangled. Vouch for users you have had positive interactions with. Read more {{ i "arrow-right" "size-3" }} {{ end }} {{ end }}

{{ if $vr }} {{ if $vr.IndirectVouches }}

From your network:

{{ template "user/fragments/networkVouches" $vr }}
{{ end }} {{ end }} {{ range $ev }} {{ end }} {{ $labelClass := "grid grid-cols-[auto_1fr_auto] items-center gap-2 rounded p-2 py- ring-1 ring-gray-200 dark:ring-gray-700 cursor-pointer" }}
{{ end }}