{{ define "title" }}Vouches · {{ resolve .Card.UserDid }} · Tangled{{ end }} {{ define "profileContent" }} {{ $isSelf := and .LoggedInUser (eq .LoggedInUser.Did .Card.UserDid) }}
{{ if $isSelf }}{{ template "vouchSuggestions" . }}{{ end }} {{ block "vouchTimeline" . }}{{ end }} {{ if gt .VouchCount .Page.Limit }} {{ $handle := resolve .Card.UserDid }} {{ template "fragments/pagination" (dict "Page" .Page "TotalCount" .VouchCount "BasePath" (printf "/%s" $handle) "QueryParams" (queryParams "tab" "vouches") ) }} {{ end }}
{{ end }} {{ define "vouchTimeline" }} {{ $isSelf := and .LoggedInUser (eq .LoggedInUser.Did .Card.UserDid) }} {{ if not .LoggedInUser }}
You need to log in to view vouches.
{{ else if not .Vouches }} {{ if not (and $isSelf .Suggestions) }}
No vouches in your network yet.
{{ end }} {{ else }}
{{ range .Vouches }} {{ template "vouchTimelineItem" (list $.Card.UserDid $.LoggedInUser.Did . $.EvidencePulls $.EvidenceIssues) }} {{ end }}
{{ end }} {{ end }} {{ define "vouchSuggestions" }} {{ if .Suggestions }}
{{ range .Suggestions }}
{{ template "user/fragments/vouch" (dict "VouchRelationship" .VouchRelationship) }}
{{ end }}
{{ end }} {{ end }} {{ define "vouchTimelineItem" }} {{ $profileDid := index . 0 }} {{ $viewerDid := index . 1 }} {{ $v := index . 2 }} {{ $evidencePulls := index . 3 }} {{ $evidenceIssues := index . 4 }} {{ $isOutgoing := eq $v.Did $profileDid }} {{ $isVouch := $v.IsVouch }} {{ $isSelf := eq $profileDid $viewerDid }}
{{ if $isVouch }} {{ if $isOutgoing }} {{ i "arrow-up-right" "size-5 text-green-500 dark:text-green-400" }} {{ else }} {{ i "arrow-down-left" "size-5 text-green-500 dark:text-green-400" }} {{ end }} {{ else }} {{ if $isOutgoing }} {{ i "arrow-up-right" "size-5 text-red-500 dark:text-red-400" }} {{ else }} {{ i "arrow-down-left" "size-5 text-red-500 dark:text-red-400" }} {{ end }} {{ end }}
{{ if and $isSelf $isOutgoing }} you {{ else }} {{ resolve $v.Did.String }} {{ end }} {{ if $isVouch }}vouched for{{ else }}denounced{{ end }} {{ if and $isSelf (not $isOutgoing) }} you {{ else }} {{ resolve $v.SubjectDid.String }} {{ end }} {{ relTimeFmt $v.CreatedAt }}
{{ with $v.Reason }}

{{ . }}

{{ end }} {{ if $v.Evidences }}
{{ range $v.Evidences }} {{ $pull := index $evidencePulls . }} {{ $issue := index $evidenceIssues . }} {{ if $pull }} {{ template "user/fragments/pullEvent" $pull }} {{ else if $issue }} {{ template "user/fragments/issueEvent" $issue }} {{ end }} {{ end }}
{{ end }}
{{ end }}