{{define "notifications/fragments/item"}}
{{if .Issue}} {{template "issueNotification" .}} {{else if .Pull}} {{template "pullNotification" .}} {{else if .Repo}} {{template "repoNotification" .}} {{else if eq .Type "followed"}} {{template "followNotification" .}} {{else}} {{template "genericNotification" .}} {{end}}
{{end}} {{define "issueNotification"}} {{$url := printf "/%s/%s/issues/%d" (resolve .Repo.Did) .Repo.Name .Issue.IssueId}}
{{if eq .Type "issue_created"}} {{ i "circle-dot" "w-4 h-4" }} {{else if eq .Type "issue_commented"}} {{ i "message-circle" "w-4 h-4" }} {{else if eq .Type "issue_closed"}} {{ i "ban" "w-4 h-4" }} {{end}} {{template "user/fragments/picHandle" (resolve .ActorDid)}} {{if eq .Type "issue_created"}} opened issue {{else if eq .Type "issue_commented"}} commented on issue {{else if eq .Type "issue_closed"}} closed issue {{end}} {{if not .Read}}
{{end}}
#{{.Issue.IssueId}} {{.Issue.Title}} on {{resolve .Repo.Did}}/{{.Repo.Name}}
{{ template "repo/fragments/time" .Created }}
{{end}} {{define "pullNotification"}} {{$url := printf "/%s/%s/pulls/%d" (resolve .Repo.Did) .Repo.Name .Pull.PullId}}
{{if eq .Type "pull_created"}} {{ i "git-pull-request-create" "w-4 h-4" }} {{else if eq .Type "pull_commented"}} {{ i "message-circle" "w-4 h-4" }} {{else if eq .Type "pull_merged"}} {{ i "git-merge" "w-4 h-4" }} {{else if eq .Type "pull_closed"}} {{ i "git-pull-request-closed" "w-4 h-4" }} {{end}} {{template "user/fragments/picHandle" (resolve .ActorDid)}} {{if eq .Type "pull_created"}} opened pull request {{else if eq .Type "pull_commented"}} commented on pull request {{else if eq .Type "pull_merged"}} merged pull request {{else if eq .Type "pull_closed"}} closed pull request {{end}} {{if not .Read}}
{{end}}
#{{.Pull.PullId}} {{.Pull.Title}} on {{resolve .Repo.Did}}/{{.Repo.Name}}
{{ template "repo/fragments/time" .Created }}
{{end}} {{define "repoNotification"}} {{$url := printf "/%s/%s" (resolve .Repo.Did) .Repo.Name}}
{{ i "star" "w-4 h-4" }}
{{template "user/fragments/picHandle" (resolve .ActorDid)}} starred {{resolve .Repo.Did}}/{{.Repo.Name}} {{if not .Read}}
{{end}}
{{ template "repo/fragments/time" .Created }}
{{end}} {{define "followNotification"}} {{$url := printf "/%s" (resolve .ActorDid)}}
{{ i "user-plus" "w-4 h-4" }}
{{template "user/fragments/picHandle" (resolve .ActorDid)}} followed you {{if not .Read}}
{{end}}
{{ template "repo/fragments/time" .Created }}
{{end}} {{define "genericNotification"}}
{{ i "bell" "w-4 h-4" }}
New notification {{if not .Read}}
{{end}}
{{ template "repo/fragments/time" .Created }}
{{end}}