tangled
alpha
login
or
join now
veryroundbird.house
/
core
forked from
tangled.org/core
0
fork
atom
this repo has no description
0
fork
atom
overview
issues
pulls
pipelines
appview: add placeholder for pulls
anirudh.fi
1 year ago
1745b6a3
1e29cf55
verified
This commit was signed with the committer's
known signature
.
anirudh.fi
SSH Key Fingerprint:
SHA256:FQUiBXeyBQT4WKOm7EKh6hLkHjBh9MdfkV3my0dueGE=
+44
4 changed files
expand all
collapse all
unified
split
appview
pages
pages.go
templates
repo
pulls
pulls.html
state
repo.go
state.go
+11
appview/pages/pages.go
···
396
396
return p.executeRepo("repo/issues/new", w, params)
397
397
}
398
398
399
399
+
type RepoPullsParams struct {
400
400
+
LoggedInUser *auth.User
401
401
+
RepoInfo RepoInfo
402
402
+
Active string
403
403
+
}
404
404
+
405
405
+
func (p *Pages) RepoPulls(w io.Writer, params RepoPullsParams) error {
406
406
+
params.Active = "pulls"
407
407
+
return p.executeRepo("repo/pulls/pulls", w, params)
408
408
+
}
409
409
+
399
410
func (p *Pages) Static() http.Handler {
400
411
sub, err := fs.Sub(files, "static")
401
412
if err != nil {
+7
appview/pages/templates/repo/pulls/pulls.html
···
1
1
+
{{ define "title" }}pulls · {{ .RepoInfo.FullName }}{{ end }}
2
2
+
3
3
+
{{ define "repoContent" }}
4
4
+
<p class="text-gray-400">
5
5
+
Support for pull requests is actively being worked on. Stay tuned!
6
6
+
</p>
7
7
+
{{ end }}
+22
appview/state/repo.go
···
873
873
}
874
874
}
875
875
876
876
+
func (s *State) RepoPulls(w http.ResponseWriter, r *http.Request) {
877
877
+
user := s.auth.GetUser(r)
878
878
+
f, err := fullyResolvedRepo(r)
879
879
+
if err != nil {
880
880
+
log.Println("failed to get repo and knot", err)
881
881
+
return
882
882
+
}
883
883
+
884
884
+
switch r.Method {
885
885
+
case http.MethodGet:
886
886
+
s.pages.RepoPulls(w, pages.RepoPullsParams{
887
887
+
LoggedInUser: user,
888
888
+
RepoInfo: pages.RepoInfo{
889
889
+
Name: f.RepoName,
890
890
+
OwnerDid: f.OwnerDid(),
891
891
+
OwnerHandle: f.OwnerHandle(),
892
892
+
SettingsAllowed: settingsAllowed(s, user, f),
893
893
+
},
894
894
+
})
895
895
+
}
896
896
+
}
897
897
+
876
898
func fullyResolvedRepo(r *http.Request) (*FullyResolvedRepo, error) {
877
899
repoName := chi.URLParam(r, "repo")
878
900
knot, ok := r.Context().Value("knot").(string)
+4
appview/state/state.go
···
813
813
r.Post("/{issue}/reopen", s.ReopenIssue)
814
814
})
815
815
816
816
+
r.Route("/pulls", func(r chi.Router) {
817
817
+
r.Get("/", s.RepoPulls)
818
818
+
})
819
819
+
816
820
// These routes get proxied to the knot
817
821
r.Get("/info/refs", s.InfoRefs)
818
822
r.Post("/git-upload-pack", s.UploadPack)