Mirror of @tangled.org/core. Running on a Raspberry Pi Zero 2 (Please be gentle).
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

styles for round-based reviews

Akshay d32b264d 54d19f66

+74 -24
+69 -23
appview/pages/templates/repo/pulls/pull.html
··· 42 42 <span class="select-none before:content-['\00B7']"></span> 43 43 <time>{{ .Pull.Created | timeFmt }}</time> 44 44 <span class="select-none before:content-['\00B7']"></span> 45 - <time>targeting branch {{ .Pull.TargetBranch }}</time> 45 + <span>targeting branch 46 + <span class="text-xs rounded bg-gray-100 text-black font-mono px-2 mx-1/2 inline-flex items-center"> 47 + {{ .Pull.TargetBranch }} 48 + </span> 49 + </span> 46 50 </span> 47 51 </div> 48 52 ··· 60 56 {{ end }} 61 57 62 58 {{ define "repoAfter" }} 63 - <section id="submissions"> 64 - {{ block "submissions" . }} {{ end }} 59 + <section id="submissions" class="mt-4"> 60 + <div class="flex flex-col gap-4"> 61 + {{ block "submissions" . }} {{ end }} 62 + </div> 65 63 </section> 66 64 67 65 {{ $isPullAuthor := and .LoggedInUser (eq .LoggedInUser.Did .Pull.OwnerDid) }} ··· 113 107 {{ $lastIdx := sub (len .Pull.Submissions) 1 }} 114 108 {{ range $idx, $item := .Pull.Submissions }} 115 109 {{ with $item }} 110 + {{ $oneIndexedRound := add .RoundNumber 1 }} 116 111 <details {{ if eq $idx $lastIdx }}open{{ end }}> 117 - <summary>round #{{ .RoundNumber }}, {{ .Created | timeFmt }}, received {{ len .Comments }} comments</summary> 118 - <div> 119 - <h2>patch submitted by {{index $.DidHandleMap $.Pull.OwnerDid}}</h2> 120 - <pre><code>{{- .Patch -}}</code></pre> 112 + <summary id="round-#{{ $oneIndexedRound }}" class="list-none cursor-pointer text-sm"> 113 + <div class="flex gap-2 items-center"> 114 + <div class="rounded bg-white drop-shadow-sm p-3"> 115 + #{{ $oneIndexedRound }} 116 + </div> 117 + <div class="rounded drop-shadow-sm bg-white p-3 text-gray-500"> 118 + <span> 119 + {{ $owner := index $.DidHandleMap $.Pull.OwnerDid }} 120 + submitted by <a href="/{{ $owner }}">{{ $owner }}</a> 121 + <span class="before:content-['·']"></span> 122 + <a href="/{{ $.RepoInfo.FullName }}/pulls/{{ $.Pull.PullId }}/patch">view patch</a> 123 + <span class="select-none before:content-['\00B7']"></span> 124 + <time>{{ .Created | timeFmt }}</time> 125 + <span class="select-none before:content-['·']"></span> 126 + {{ $s := "s" }} 127 + {{ if eq (len .Comments) 1 }} 128 + {{ $s = "" }} 129 + {{ end }} 130 + {{ len .Comments }} comment{{$s}} 131 + </span> 132 + </div> 133 + </div> 134 + </summary> 135 + <div class="pl-12 flex flex-col gap-2 mt-2 relative"> 136 + <!--div class="bg-white rounded drop-shadow-sm p-4"> 137 + <pre class="overflow-auto"><code>{{- .Patch -}}</code></pre> 138 + </div--> 121 139 122 140 {{ range .Comments }} 123 - <div id="comment-{{.ID}}"> 124 - {{ index $.DidHandleMap .OwnerDid }} commented {{ .Created | timeFmt }}: {{ .Body }} 141 + <div id="comment-{{.ID}}" class="bg-white rounded drop-shadow-sm py-2 px-4 relative w-fit"> 142 + <div class="absolute left-8 -top-2 w-px h-2 bg-gray-300"></div> 143 + <div class="text-sm text-gray-500"> 144 + {{ $owner := index $.DidHandleMap .OwnerDid }} 145 + <a href="/{{$owner}}">{{$owner}}</a> 146 + <span class="before:content-['·']"></span> 147 + <time>{{ .Created | timeFmt }}</time> 148 + </div> 149 + <div class="prose"> 150 + {{ .Body }} 151 + </div> 125 152 </div> 126 153 {{ end }} 127 154 {{ block "newComment" (list $ .ID) }} {{ end }} 128 155 </div> 129 156 </details> 157 + <hr /> 130 158 {{ end }} 131 159 {{ end }} 132 160 {{ end }} ··· 171 131 172 132 {{ with $rootObj }} 173 133 {{ if .LoggedInUser }} 174 - <form 175 - hx-post="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/comment" 176 - class="mt-8" 177 - hx-swap="none"> 134 + <div class="bg-white rounded drop-shadow-sm py-2 px-4 relative w-full md:w-96"> 135 + <div class="absolute left-8 -top-2 w-px h-2 bg-gray-300"></div> 136 + <div class="text-sm text-gray-500"> 137 + {{ index .DidHandleMap .LoggedInUser.Did }} 138 + </div> 139 + <form 140 + hx-post="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/comment" 141 + hx-swap="none"> 178 142 <input type="hidden" name="submissionId" value="{{ $submissionId }}"> 179 143 <textarea 180 144 name="body" 181 - class="w-full p-2 rounded border border-gray-200" 182 - placeholder="Add to the discussion..." 183 - ></textarea> 184 - <button type="submit" class="btn mt-2">comment</button> 145 + class="w-full border-0 h-8 focus:outline-none focus:ring-0 px-0 py-1" 146 + placeholder="Add to the discussion..." /></textarea> 147 + <div class="flex justify-end"> 148 + <button type="submit" class="btn text-sm mt-2">comment</button> 149 + </div> 185 150 <div id="pull-comment"></div> 186 - </form> 187 - {{ else }} 188 - <div class="bg-white rounded drop-shadow-sm px-6 py-4 mt-8"> 189 - <a href="/login" class="underline">login</a> to join the discussion 151 + </form> 152 + {{ else }} 153 + <div class="bg-white rounded drop-shadow-sm px-6 py-4 mt-8"> 154 + <a href="/login" class="underline">login</a> to join the discussion 155 + </div> 190 156 </div> 191 157 {{ end }} 192 158 {{ end }} ··· 277 231 pull request can be merged safely. 278 232 </div> 279 233 280 - <div class="mt-4 flex items-center gap-2"> 234 + <div class="flex items-center gap-2"> 281 235 {{ if $isPushAllowed }} 282 236 <button 283 - class="btn flex items-center gap-2" 237 + class="btn mt-4 flex items-center gap-2" 284 238 hx-post="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/merge" 285 239 hx-swap="none" 286 240 {{ if or .Pull.State.IsClosed .MergeCheck.IsConflicted }}
+4 -1
appview/pages/templates/repo/pulls/pulls.html
··· 76 76 </span> 77 77 78 78 <span class="before:content-['·']"> 79 - targeting branch <code>{{ .TargetBranch }}</code> 79 + targeting branch 80 + <span class="text-xs rounded bg-gray-100 text-black font-mono px-2 mx-1/2 inline-flex items-center"> 81 + {{ .TargetBranch }} 82 + </span> 80 83 </span> 81 84 </p> 82 85 </div>
+1
appview/state/router.go
··· 66 66 r.Route("/{pull}", func(r chi.Router) { 67 67 r.Use(ResolvePull(s)) 68 68 r.Get("/", s.RepoSinglePull) 69 + r.Get("/patch", s.RepoSinglePull) 69 70 70 71 // authorized requests below this point 71 72 r.Group(func(r chi.Router) {