{{define "notifications/fragments/item"}}
{{ template "notificationIcon" . }}
{{ template "notificationHeader" . }} {{ template "notificationSummary" . }}
{{end}} {{ define "notificationIcon" }}
{{ i .Icon "size-3 text-black dark:text-white" }}
{{ end }} {{ define "notificationHeader" }} {{ $actor := resolve .ActorDid }} {{ $actor }} {{ if eq .Type "repo_starred" }} starred {{ resolve .Repo.Did }}/{{ .Repo.Name }} {{ else if eq .Type "issue_created" }} opened an issue {{ else if eq .Type "issue_commented" }} commented on an issue {{ else if eq .Type "issue_closed" }} closed an issue {{ else if eq .Type "pull_created" }} created a pull request {{ else if eq .Type "pull_commented" }} commented on a pull request {{ else if eq .Type "pull_merged" }} merged a pull request {{ else if eq .Type "pull_closed" }} closed a pull request {{ else if eq .Type "followed" }} followed you {{ else }} {{ end }} {{ end }} {{ define "notificationSummary" }} {{ if eq .Type "repo_starred" }} {{ else if .Issue }} #{{.Issue.IssueId}} {{.Issue.Title}} on {{resolve .Repo.Did}}/{{.Repo.Name}} {{ else if .Pull }} #{{.Pull.PullId}} {{.Pull.Title}} on {{resolve .Repo.Did}}/{{.Repo.Name}} {{ else if eq .Type "followed" }} {{ else }} {{ 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" .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}}