From d32b264d7610de513489163986fa50358f89e5a1 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 16 Mar 2025 13:30:52 +0000 Subject: [PATCH] styles for round-based reviews --- appview/pages/templates/repo/pulls/pull.html | 92 ++++++++++++++----- appview/pages/templates/repo/pulls/pulls.html | 5 +- appview/state/router.go | 1 + 3 files changed, 74 insertions(+), 24 deletions(-) diff --git a/appview/pages/templates/repo/pulls/pull.html b/appview/pages/templates/repo/pulls/pull.html index 87b4f0f1..65c8b85f 100644 --- a/appview/pages/templates/repo/pulls/pull.html +++ b/appview/pages/templates/repo/pulls/pull.html @@ -42,7 +42,11 @@ - + targeting branch + + {{ .Pull.TargetBranch }} + + @@ -56,8 +60,10 @@ {{ end }} {{ define "repoAfter" }} -
- {{ block "submissions" . }} {{ end }} +
+
+ {{ block "submissions" . }} {{ end }} +
{{ $isPullAuthor := and .LoggedInUser (eq .LoggedInUser.Did .Pull.OwnerDid) }} @@ -107,20 +113,54 @@ {{ $lastIdx := sub (len .Pull.Submissions) 1 }} {{ range $idx, $item := .Pull.Submissions }} {{ with $item }} + {{ $oneIndexedRound := add .RoundNumber 1 }}
- round #{{ .RoundNumber }}, {{ .Created | timeFmt }}, received {{ len .Comments }} comments -
-

patch submitted by {{index $.DidHandleMap $.Pull.OwnerDid}}

-
{{- .Patch -}}
+ +
+
+ #{{ $oneIndexedRound }} +
+
+ + {{ $owner := index $.DidHandleMap $.Pull.OwnerDid }} + submitted by {{ $owner }} + + view patch + + + + {{ $s := "s" }} + {{ if eq (len .Comments) 1 }} + {{ $s = "" }} + {{ end }} + {{ len .Comments }} comment{{$s}} + +
+
+
+
+ {{ range .Comments }} -
- {{ index $.DidHandleMap .OwnerDid }} commented {{ .Created | timeFmt }}: {{ .Body }} +
+
+
+ {{ $owner := index $.DidHandleMap .OwnerDid }} + {{$owner}} + + +
+
+ {{ .Body }} +
{{ end }} {{ block "newComment" (list $ .ID) }} {{ end }}
+
{{ end }} {{ end }} {{ end }} @@ -131,22 +171,28 @@ {{ with $rootObj }} {{ if .LoggedInUser }} -
+
+
+
+ {{ index .DidHandleMap .LoggedInUser.Did }} +
+ - + class="w-full border-0 h-8 focus:outline-none focus:ring-0 px-0 py-1" + placeholder="Add to the discussion..." /> +
+ +
- - {{ else }} -
- login to join the discussion + + {{ else }} +
+ login to join the discussion +
{{ end }} {{ end }} @@ -231,10 +277,10 @@ pull request can be merged safely.
-
+
{{ if $isPushAllowed }}
diff --git a/appview/state/router.go b/appview/state/router.go index 149ae1f5..694c672e 100644 --- a/appview/state/router.go +++ b/appview/state/router.go @@ -66,6 +66,7 @@ func (s *State) UserRouter() http.Handler { r.Route("/{pull}", func(r chi.Router) { r.Use(ResolvePull(s)) r.Get("/", s.RepoSinglePull) + r.Get("/patch", s.RepoSinglePull) // authorized requests below this point r.Group(func(r chi.Router) { -- 2.51.2