appview: Update New PR Page #490

The compare forks option dropdown now shows repos in which you are a collaborator on instead of just repos you own.

Changed files
+9 -6
appview
db
pages
templates
repo
pulls
+8 -5
appview/db/repos.go
···
var repos []Repo
rows, err := e.Query(
-
`select did, name, knot, rkey, description, created, at_uri, source
-
from repos
-
where did = ? and source is not null and source != ''
-
order by created desc`,
-
did,
+
`select distinct r.did, r.name, r.knot, r.rkey, r.description, r.created, r.at_uri, r.source
+
from repos r
+
left join collaborators c on r.at_uri = c.repo_at
+
where (r.did = ? or c.subject_did = ?)
+
and r.source is not null
+
and r.source != ''
+
order by r.created desc`,
+
did, did,
)
if err != nil {
return nil, err
+1 -1
appview/pages/templates/repo/pulls/fragments/pullCompareForks.html
···
<option disabled selected>select a fork</option>
{{ range .Forks }}
<option value="{{ .Name }}" {{ if eq .Name $.Selected }}selected{{ end }} class="py-1">
-
{{ .Name }}
+
{{ .Did | resolve }}/{{ .Name }}
</option>
{{ end }}
</select>