Monorepo for Tangled tangled.org

appview/pulls: hyperlink to ids and better round #

anirudh.fi 6a1daebf 369dbb79

verified
Changed files
+49 -50
appview
pages
templates
repo
+12 -13
appview/pages/templates/repo/pulls/patch.html
··· 1 1 {{ define "title" }} 2 - viewing patch of {{ .Pull.Title }} &middot; pull #{{ .Pull.PullId }} &middot; {{ .RepoInfo.FullName }} 2 + {{ $oneIndexedRound := add .Round 1 }} 3 + patch of {{ .Pull.Title }} &middot; round #{{ $oneIndexedRound }} &middot; pull #{{ .Pull.PullId }} &middot; {{ .RepoInfo.FullName }} 3 4 {{ end }} 4 5 5 6 {{ define "content" }} 6 7 {{ $oneIndexedRound := add .Round 1 }} 7 8 {{ $stat := .Diff.Stat }} 8 - <div class="flex gap-2 items-center text-gray-500 mb-2 px-6"> 9 - <a href="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/" class="flex items-center gap-2"> 10 - <i data-lucide="arrow-left" class="w-4 h-4"></i> 11 - back 12 - </a> 13 - <span class="select-none before:content-['·']"></span> 14 - viewing round 15 - <span class="text-black">#{{ $oneIndexedRound }}</span> 16 - </div> 17 9 <div class="rounded drop-shadow-sm bg-white py-4 px-6"> 18 - <header class="pb-4"> 19 - <h1 class="text-2xl"> 10 + <header class="pb-2"> 11 + <div class="flex gap-3 items-center mb-3"> 12 + <a href="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/" class="flex items-center gap-2 font-medium"> 13 + <i data-lucide="arrow-left" class="w-5 h-5"></i> 14 + </a> 15 + <h2 class="text-lg">round <span class="font-medium">#{{ $oneIndexedRound }}</span></h2> 16 + </div> 17 + <div class="border-t border-gray-200 my-2"></div> 18 + <h1 class="text-2xl mt-3"> 20 19 {{ .Pull.Title }} 21 20 <span class="text-gray-500">#{{ .Pull.PullId }}</span> 22 21 </h1> ··· 83 82 {{ end }} 84 83 </div> 85 84 </div> 85 + 86 86 <section> 87 87 {{ template "fragments/diff" (list .RepoInfo.FullName .Diff) }} 88 88 </section> 89 89 {{ end }} 90 -
+37 -37
appview/pages/templates/repo/pulls/pull.html
··· 100 100 {{ with $item }} 101 101 {{ $oneIndexedRound := add .RoundNumber 1 }} 102 102 <details {{ if eq $idx $lastIdx }}open{{ end }}> 103 - <summary id="round-#{{ $oneIndexedRound }}" class="list-none cursor-pointer text-sm"> 104 - <div class="flex gap-2 items-center"> 105 - <div class="rounded bg-white drop-shadow-sm p-3"> 106 - #{{ $oneIndexedRound }} 107 - </div> 108 - <div class="rounded drop-shadow-sm bg-white p-3 text-gray-500"> 109 - <span> 110 - {{ $owner := index $.DidHandleMap $.Pull.OwnerDid }} 111 - submitted by <a href="/{{ $owner }}">{{ $owner }}</a> 112 - <span class="select-none before:content-['\00B7']"></span> 113 - <time>{{ .Created | timeFmt }}</time> 114 - <span class="select-none before:content-['·']"></span> 115 - {{ $s := "s" }} 116 - {{ if eq (len .Comments) 1 }} 117 - {{ $s = "" }} 118 - {{ end }} 119 - {{ len .Comments }} comment{{$s}} 120 - <span class="before:content-['·']"></span> 121 - <a href="/{{ $.RepoInfo.FullName }}/pulls/{{ $.Pull.PullId }}/round/{{.RoundNumber}}">view patch</a> 122 - </span> 123 - </div> 124 - </div> 125 - </summary> 126 - <div class="pl-12 flex flex-col gap-2 mt-2 relative"> 127 - {{ range .Comments }} 128 - <div id="comment-{{.ID}}" class="bg-white rounded drop-shadow-sm py-2 px-4 relative w-fit"> 129 - <div class="absolute left-8 -top-2 w-px h-2 bg-gray-300"></div> 130 - <div class="text-sm text-gray-500"> 131 - {{ $owner := index $.DidHandleMap .OwnerDid }} 132 - <a href="/{{$owner}}">{{$owner}}</a> 133 - <span class="before:content-['·']"></span> 134 - <time>{{ .Created | timeFmt }}</time> 103 + <summary id="round-#{{ $oneIndexedRound }}" class="list-none cursor-pointer text-sm"> 104 + <div class="flex gap-2 items-center"> 105 + <div class="rounded bg-white drop-shadow-sm p-3"> 106 + #{{ $oneIndexedRound }} 135 107 </div> 136 - <div class="prose"> 137 - {{ .Body }} 108 + <div class="rounded drop-shadow-sm bg-white p-3 text-gray-500"> 109 + <span> 110 + {{ $owner := index $.DidHandleMap $.Pull.OwnerDid }} 111 + submitted by <a href="/{{ $owner }}">{{ $owner }}</a> 112 + <span class="select-none before:content-['\00B7']"></span> 113 + <a href="#round-#{{ $oneIndexedRound }}"><time>{{ .Created | timeFmt }}</time></a> 114 + <span class="select-none before:content-['·']"></span> 115 + {{ $s := "s" }} 116 + {{ if eq (len .Comments) 1 }} 117 + {{ $s = "" }} 118 + {{ end }} 119 + {{ len .Comments }} comment{{$s}} 120 + <span class="before:content-['·']"></span> 121 + <a href="/{{ $.RepoInfo.FullName }}/pulls/{{ $.Pull.PullId }}/round/{{.RoundNumber}}">view patch</a> 122 + </span> 138 123 </div> 139 124 </div> 140 - {{ end }} 141 - {{ block "newComment" (list $ .ID) }} {{ end }} 142 - </div> 125 + </summary> 126 + <div class="pl-12 flex flex-col gap-2 mt-2 relative"> 127 + {{ range .Comments }} 128 + <div id="comment-{{.ID}}" class="bg-white rounded drop-shadow-sm py-2 px-4 relative w-fit"> 129 + <div class="absolute left-8 -top-2 w-px h-2 bg-gray-300"></div> 130 + <div class="text-sm text-gray-500"> 131 + {{ $owner := index $.DidHandleMap .OwnerDid }} 132 + <a href="/{{$owner}}">{{$owner}}</a> 133 + <span class="before:content-['·']"></span> 134 + <a href="#comment-{{.ID}}"><time>{{ .Created | timeFmt }}</time></a> 135 + </div> 136 + <div class="prose"> 137 + {{ .Body }} 138 + </div> 139 + </div> 140 + {{ end }} 141 + {{ block "newComment" (list $ .ID) }} {{ end }} 142 + </div> 143 143 </details> 144 144 <hr /> 145 145 {{ end }}