Monorepo for Tangled tangled.org

appview: pull: show resubmit status to all users

any viewer should be able to tell if a PR is outdated.

Signed-off-by: oppiliappan <me@oppi.li>

Changed files
+4 -11
appview
pages
templates
repo
pulls
pulls
+2 -1
appview/pages/templates/repo/pulls/pull.html
··· 250 250 {{ end }} 251 251 252 252 {{ define "resubmitStatus" }} 253 + {{ $isAuthor := and .LoggedInUser (eq .LoggedInUser.Did .Pull.OwnerDid) }} 253 254 {{ if .ResubmitCheck.Yes }} 254 255 <div class="bg-amber-50 dark:bg-amber-900 border border-amber-500 rounded drop-shadow-sm px-6 py-2 relative w-fit"> 255 256 <div class="flex items-center gap-2 text-amber-500 dark:text-amber-300"> 256 257 {{ i "triangle-alert" "w-4 h-4" }} 257 - <span class="font-medium">this branch has been updated, consider resubmitting</span> 258 + <span class="font-medium">this branch has been updated<span class="{{if not $isAuthor}}hidden{{end}}">, consider resubmitting<span></span> 258 259 </div> 259 260 </div> 260 261 {{ end }}
+2 -10
appview/pulls/pulls.go
··· 95 95 } 96 96 97 97 mergeCheckResponse := s.mergeCheck(f, pull, stack) 98 - resubmitResult := pages.Unknown 99 - if user.Did == pull.OwnerDid { 100 - resubmitResult = s.resubmitCheck(f, pull, stack) 101 - } 98 + resubmitResult := s.resubmitCheck(f, pull, stack) 102 99 103 100 s.pages.PullActionsFragment(w, pages.PullActionsParams{ 104 101 LoggedInUser: user, ··· 160 157 } 161 158 162 159 mergeCheckResponse := s.mergeCheck(f, pull, stack) 163 - resubmitResult := pages.Unknown 164 - if user != nil && user.Did == pull.OwnerDid { 165 - resubmitResult = s.resubmitCheck(f, pull, stack) 166 - } 160 + resubmitResult := s.resubmitCheck(f, pull, stack) 167 161 168 162 s.pages.RepoSinglePull(w, pages.RepoSinglePullParams{ 169 163 LoggedInUser: user, ··· 290 284 top := stack[0] 291 285 latestSourceRev = top.Submissions[top.LastRoundNumber()].SourceRev 292 286 } 293 - 294 - log.Println(latestSourceRev, result.Branch.Hash) 295 287 296 288 if latestSourceRev != result.Branch.Hash { 297 289 return pages.ShouldResubmit