|
|
@ -7,6 +7,7 @@ package repo |
|
|
|
import ( |
|
|
|
"fmt" |
|
|
|
|
|
|
|
"github.com/Unknwon/paginater" |
|
|
|
"github.com/go-gitea/gitea/models" |
|
|
|
"github.com/go-gitea/gitea/modules/auth" |
|
|
|
"github.com/go-gitea/gitea/modules/base" |
|
|
@ -58,7 +59,11 @@ func Releases(ctx *context.Context) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
releases, err := models.GetReleasesByRepoID(ctx.Repo.Repository.ID) |
|
|
|
page := ctx.QueryInt("page") |
|
|
|
if page <= 1 { |
|
|
|
page = 1 |
|
|
|
} |
|
|
|
releases, err := models.GetReleasesByRepoID(ctx.Repo.Repository.ID, page, 10) |
|
|
|
if err != nil { |
|
|
|
ctx.Handle(500, "GetReleasesByRepoID", err) |
|
|
|
return |
|
|
@ -141,6 +146,8 @@ func Releases(ctx *context.Context) { |
|
|
|
r.Note = markdown.RenderString(r.Note, ctx.Repo.RepoLink, ctx.Repo.Repository.ComposeMetas()) |
|
|
|
tags = append(tags, r) |
|
|
|
} |
|
|
|
pager := paginater.New(ctx.Repo.Repository.NumTags, 10, page, 5) |
|
|
|
ctx.Data["Page"] = pager |
|
|
|
models.SortReleases(tags) |
|
|
|
ctx.Data["Releases"] = tags |
|
|
|
ctx.HTML(200, RELEASES) |
|
|
|