diff --git a/appview/pages/templates/notifications/fragments/item.html b/appview/pages/templates/notifications/fragments/item.html index 708e2b3d..1ce43fb9 100644 --- a/appview/pages/templates/notifications/fragments/item.html +++ b/appview/pages/templates/notifications/fragments/item.html @@ -1,19 +1,19 @@ {{define "notifications/fragments/item"}} -
+ +
+ {{ template "notificationIcon" . }} +
+ {{ template "notificationHeader" . }} + {{ template "notificationSummary" . }} +
- {{ template "notificationIcon" . }} -
- {{ template "notificationHeader" . }} - {{ template "notificationSummary" . }}
- -
+
{{end}} {{ define "notificationIcon" }} @@ -64,199 +64,18 @@ {{ 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}} -
-
-
+{{ 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 }} -
- {{ template "repo/fragments/time" .Created }} -
-
-
-{{end}} + {{ $url }} +{{ end }}