aboutsummaryrefslogtreecommitdiff
path: root/pkg/handler
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2025-01-26 14:53:14 +0100
committerGabriel A. Giovanini <mail@gabrielgio.me>2025-01-26 14:54:52 +0100
commitcb9036aab96895ddf03cab68f75d3356f5227968 (patch)
treebc97024b0e947a0624579552955ce7c1ea47c572 /pkg/handler
parentf128f0a029430cb5ab4f89733d8297666a6b2fdf (diff)
downloadcerrado-c51e2ae8af53a544cb6aa0bdc4713cb9571ba304.tar.gz
cerrado-c51e2ae8af53a544cb6aa0bdc4713cb9571ba304.tar.bz2
cerrado-c51e2ae8af53a544cb6aa0bdc4713cb9571ba304.zip
feat: Add log paginationHEADv0.0.19master
Now it is possible to navigate through all commit from a given repository. It implements a simple navigation which will plenty for now.
Diffstat (limited to 'pkg/handler')
-rw-r--r--pkg/handler/git/handler.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/handler/git/handler.go b/pkg/handler/git/handler.go
index 6225b1a..436d364 100644
--- a/pkg/handler/git/handler.go
+++ b/pkg/handler/git/handler.go
@@ -130,7 +130,7 @@ func (g *GitHandler) Summary(w http.ResponseWriter, r *http.Request) error {
return err
}
- commits, err := g.gitService.ListCommits(name, "", 10)
+ commits, _, err := g.gitService.ListCommits(name, "", "", 10)
if err != nil {
return err
}
@@ -324,8 +324,9 @@ func (g *GitHandler) Log(w http.ResponseWriter, r *http.Request) error {
ext.SetHTML(w)
name := r.PathValue("name")
ref := r.PathValue("ref")
+ from := r.URL.Query().Get("from")
- commits, err := g.gitService.ListCommits(name, ref, 1000)
+ commits, next, err := g.gitService.ListCommits(name, ref, from, 100)
if err != nil {
return err
}
@@ -335,6 +336,7 @@ func (g *GitHandler) Log(w http.ResponseWriter, r *http.Request) error {
Ref: ref,
GitItemBase: &templates.GitItemLogPage{
Commits: commits,
+ Next: next,
},
}
templates.WritePageTemplate(w, gitList, r.Context())