mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 20:02:09 +00:00
Finish close and reopen issue, install page, ready going to test stage of v0.2.0
This commit is contained in:
parent
1f671e5d29
commit
107a1eadac
15 changed files with 315 additions and 161 deletions
|
@ -120,7 +120,7 @@ func SignIn(ctx *middleware.Context, form auth.LogInForm) {
|
|||
return
|
||||
}
|
||||
|
||||
if hasErr, ok := ctx.Data["HasError"]; ok && hasErr.(bool) {
|
||||
if ctx.HasError() {
|
||||
ctx.HTML(200, "user/signin")
|
||||
return
|
||||
}
|
||||
|
@ -308,17 +308,19 @@ func Issues(ctx *middleware.Context) {
|
|||
|
||||
showRepos := make([]models.Repository, 0, len(repos))
|
||||
|
||||
var closedIssueCount, createdByCount int
|
||||
isShowClosed := ctx.Query("state") == "closed"
|
||||
var closedIssueCount, createdByCount, allIssueCount int
|
||||
|
||||
// Get all issues.
|
||||
allIssues := make([]models.Issue, 0, 5*len(repos))
|
||||
for i, repo := range repos {
|
||||
issues, err := models.GetIssues(0, repo.Id, posterId, 0, page, false, false, "", "")
|
||||
issues, err := models.GetIssues(0, repo.Id, posterId, 0, page, isShowClosed, false, "", "")
|
||||
if err != nil {
|
||||
ctx.Handle(200, "user.Issues(get issues)", err)
|
||||
return
|
||||
}
|
||||
|
||||
allIssueCount += repo.NumIssues
|
||||
closedIssueCount += repo.NumClosedIssues
|
||||
|
||||
// Set repository information to issues.
|
||||
|
@ -330,12 +332,10 @@ func Issues(ctx *middleware.Context) {
|
|||
repos[i].NumOpenIssues = repo.NumIssues - repo.NumClosedIssues
|
||||
if repos[i].NumOpenIssues > 0 {
|
||||
showRepos = append(showRepos, repos[i])
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
showIssues := make([]models.Issue, 0, len(allIssues))
|
||||
isShowClosed := ctx.Query("state") == "closed"
|
||||
ctx.Data["IsShowClosed"] = isShowClosed
|
||||
|
||||
// Get posters and filter issues.
|
||||
|
@ -361,9 +361,9 @@ func Issues(ctx *middleware.Context) {
|
|||
|
||||
ctx.Data["Repos"] = showRepos
|
||||
ctx.Data["Issues"] = showIssues
|
||||
ctx.Data["AllIssueCount"] = len(allIssues)
|
||||
ctx.Data["AllIssueCount"] = allIssueCount
|
||||
ctx.Data["ClosedIssueCount"] = closedIssueCount
|
||||
ctx.Data["OpenIssueCount"] = len(allIssues) - closedIssueCount
|
||||
ctx.Data["OpenIssueCount"] = allIssueCount - closedIssueCount
|
||||
ctx.Data["CreatedByCount"] = createdByCount
|
||||
ctx.HTML(200, "issue/user")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue