forked from NYANDEV/forgejo
default show closed actions list if all actions was closed (#24234)
that's the same with issues and pull list
This commit is contained in:
parent
1ef43f9bfe
commit
74aa44625b
1 changed files with 7 additions and 1 deletions
|
@ -162,12 +162,18 @@ func List(ctx *context.Context) {
|
||||||
ctx.Data["NumClosedActionRuns"] = numClosedRuns
|
ctx.Data["NumClosedActionRuns"] = numClosedRuns
|
||||||
|
|
||||||
opts.IsClosed = util.OptionalBoolNone
|
opts.IsClosed = util.OptionalBoolNone
|
||||||
if ctx.FormString("state") == "closed" {
|
isShowClosed := ctx.FormString("state") == "closed"
|
||||||
|
if len(ctx.FormString("state")) == 0 && numOpenRuns == 0 && numClosedRuns != 0 {
|
||||||
|
isShowClosed = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if isShowClosed {
|
||||||
opts.IsClosed = util.OptionalBoolTrue
|
opts.IsClosed = util.OptionalBoolTrue
|
||||||
ctx.Data["IsShowClosed"] = true
|
ctx.Data["IsShowClosed"] = true
|
||||||
} else {
|
} else {
|
||||||
opts.IsClosed = util.OptionalBoolFalse
|
opts.IsClosed = util.OptionalBoolFalse
|
||||||
}
|
}
|
||||||
|
|
||||||
runs, total, err := actions_model.FindRuns(ctx, opts)
|
runs, total, err := actions_model.FindRuns(ctx, opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.Error(http.StatusInternalServerError, err.Error())
|
ctx.Error(http.StatusInternalServerError, err.Error())
|
||||||
|
|
Loading…
Reference in a new issue