{{ define "title" }}{{ or .Card.UserHandle .Card.UserDid }}{{ end }} {{ define "extrameta" }} {{ end }} {{ define "content" }}
{{ template "user/fragments/profileCard" .Card }}
{{ block "ownRepos" . }}{{ end }} {{ block "collaboratingRepos" . }}{{ end }}
{{ block "profileTimeline" . }}{{ end }}
{{ end }} {{ define "profileTimeline" }}

ACTIVITY

{{ with .ProfileTimeline }} {{ range $idx, $byMonth := .ByMonth }} {{ with $byMonth }}
{{ if eq $idx 0 }} {{ else }} {{ $s := "s" }} {{ if eq $idx 1 }} {{ $s = "" }} {{ end }}

{{$idx}} month{{$s}} ago

{{ end }} {{ if .IsEmpty }}
No activity for this month
{{ else }}
{{ block "repoEvents" (list .RepoEvents $.DidHandleMap) }} {{ end }} {{ block "issueEvents" (list .IssueEvents $.DidHandleMap) }} {{ end }} {{ block "pullEvents" (list .PullEvents $.DidHandleMap) }} {{ end }}
{{ end }}
{{ end }} {{ else }}

This user does not have any activity yet.

{{ end }} {{ end }}
{{ end }} {{ define "repoEvents" }} {{ $items := index . 0 }} {{ $handleMap := index . 1 }} {{ if gt (len $items) 0 }}
{{ i "book-plus" "w-4 h-4" }} created {{ len $items }} {{if eq (len $items) 1 }}repository{{else}}repositories{{end}}
{{ range $items }}
{{ if .Source }} {{ i "git-fork" "w-4 h-4" }} {{ else }} {{ i "book-plus" "w-4 h-4" }} {{ end }} {{- .Repo.Name -}}
{{ end }}
{{ end }} {{ end }} {{ define "issueEvents" }} {{ $i := index . 0 }} {{ $items := $i.Items }} {{ $stats := $i.Stats }} {{ $handleMap := index . 1 }} {{ if gt (len $items) 0 }}
{{ i "circle-dot" "w-4 h-4" }}
created {{ len $items }} {{if eq (len $items) 1 }}issue{{else}}issues{{end}}
{{ if gt $stats.Open 0 }} {{$stats.Open}} open {{ end }} {{ if gt $stats.Closed 0 }} {{$stats.Closed}} closed {{ end }}
{{ range $items }} {{ $repoOwner := index $handleMap .Metadata.Repo.Did }} {{ $repoName := .Metadata.Repo.Name }} {{ $repoUrl := printf "%s/%s" $repoOwner $repoName }}
{{ if .Open }} {{ i "circle-dot" "w-4 h-4" }} {{ else }} {{ i "ban" "w-4 h-4" }} {{ end }}
#{{ .IssueId }}
{{ end }}
{{ end }} {{ end }} {{ define "pullEvents" }} {{ $i := index . 0 }} {{ $items := $i.Items }} {{ $stats := $i.Stats }} {{ $handleMap := index . 1 }} {{ if gt (len $items) 0 }}
{{ i "git-pull-request" "w-4 h-4" }}
created {{ len $items }} {{if eq (len $items) 1 }}pull request{{else}}pull requests{{end}}
{{ if gt $stats.Open 0 }} {{$stats.Open}} open {{ end }} {{ if gt $stats.Merged 0 }} {{$stats.Merged}} merged {{ end }} {{ if gt $stats.Closed 0 }} {{$stats.Closed}} closed {{ end }}
{{ range $items }} {{ $repoOwner := index $handleMap .Repo.Did }} {{ $repoName := .Repo.Name }} {{ $repoUrl := printf "%s/%s" $repoOwner $repoName }}
{{ if .State.IsOpen }} {{ i "git-pull-request" "w-4 h-4" }} {{ else if .State.IsMerged }} {{ i "git-merge" "w-4 h-4" }} {{ else }} {{ i "git-pull-request-closed" "w-4 h-4" }} {{ end }}
#{{ .PullId }}
{{ end }}
{{ end }} {{ end }} {{ define "ownRepos" }}
PINNED REPOS view all {{ i "chevron-right" "w-4 h-4" }} {{ if and .LoggedInUser (eq .LoggedInUser.Did .Card.UserDid) }} {{ end }}
{{ range .Repos }}
{{ if .Description }}
{{ .Description }}
{{ end }}
{{ if .RepoStats.StarCount }}
{{ i "star" "w-3 h-3 fill-current" }} {{ .RepoStats.StarCount }}
{{ end }}
{{ else }}

This user does not have any repos yet.

{{ end }}
{{ end }} {{ define "collaboratingRepos" }} {{ if gt (len .CollaboratingRepos) 0 }}

COLLABORATING ON

{{ range .CollaboratingRepos }}
{{ if .Description }}
{{ .Description }}
{{ end }}
{{ if .RepoStats.StarCount }}
{{ i "star" "w-3 h-3 fill-current" }} {{ .RepoStats.StarCount }}
{{ end }}
{{ else }}

This user is not collaborating.

{{ end }}
{{ end }} {{ end }}