{{define "notifications/fragments/item"}}
{{ template "notificationIcon" . }}
{{ template "notificationHeader" . }} {{ template "repo/fragments/shortTime" .Created }}
{{ 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 "issue_reopen" }} reopened 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 "pull_reopen" }} reopened a pull request {{ else if eq .Type "followed" }} followed you {{ else if eq .Type "user_mentioned" }} mentioned 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 "notificationUrl" }} {{ $url := "" }} {{ if eq .Type "repo_starred" }} {{$url = printf "/%s/%s" (resolve .Repo.Did) .Repo.Name}} {{ else if .Issue }} {{$url = printf "/%s/%s/issues/%d" (resolve .Repo.Did) .Repo.Name .Issue.IssueId}} {{ else if .Pull }} {{$url = printf "/%s/%s/pulls/%d" (resolve .Repo.Did) .Repo.Name .Pull.PullId}} {{ else if eq .Type "followed" }} {{$url = printf "/%s" (resolve .ActorDid)}} {{ else }} {{ end }} {{ $url }} {{ end }}