diff options
| author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2025-01-26 14:53:14 +0100 | 
|---|---|---|
| committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2025-01-26 14:54:52 +0100 | 
| commit | cb9036aab96895ddf03cab68f75d3356f5227968 (patch) | |
| tree | bc97024b0e947a0624579552955ce7c1ea47c572 /pkg/handler/git | |
| parent | f128f0a029430cb5ab4f89733d8297666a6b2fdf (diff) | |
| download | cerrado-c51e2ae8af53a544cb6aa0bdc4713cb9571ba304.tar.gz cerrado-c51e2ae8af53a544cb6aa0bdc4713cb9571ba304.tar.bz2 cerrado-c51e2ae8af53a544cb6aa0bdc4713cb9571ba304.zip  | |
feat: Add log paginationv0.0.19
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/git')
| -rw-r--r-- | pkg/handler/git/handler.go | 6 | 
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())  | 
