Skip to content

Commit f01c87b

Browse files
committed
make it handle optional IsShowClosed in issues/pulls list in filter_actions template
1 parent d0a3438 commit f01c87b

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

routers/web/repo/issue.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,8 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption opt
467467
ctx.Data["AssigneeID"] = assigneeID
468468
ctx.Data["PosterID"] = posterID
469469
ctx.Data["Keyword"] = keyword
470-
if isShowClosed.Has() {
471-
ctx.Data["IsShowClosed"] = isShowClosed.Value()
472-
}
470+
ctx.Data["IsShowClosed"] = isShowClosed
471+
473472
switch {
474473
case isShowClosed.Value():
475474
ctx.Data["State"] = "closed"

templates/repo/issue/filter_actions.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<div class="ui secondary filter menu">
22
{{if not .Repository.IsArchived}}
33
<!-- Action Button -->
4-
{{if .IsShowClosed}}
5-
<button class="ui primary basic button issue-action" data-action="open" data-url="{{$.RepoLink}}/issues/status">{{ctx.Locale.Tr "repo.issues.action_open"}}</button>
6-
{{else}}
4+
{{if and .IsShowClosed.Has .IsShowClosed.Value}}
5+
<button class="ui primary basic button issue-action" data-action="open" data-url="{{$.RepoLink}}/issues/status">{{ctx.Locale.Tr "repo.issues.action_open"}}</button>
6+
{{else if and .IsShowClosed.Has (not .IsShowClosed.Value)}}
77
<button class="ui red basic button issue-action" data-action="close" data-url="{{$.RepoLink}}/issues/status">{{ctx.Locale.Tr "repo.issues.action_close"}}</button>
88
{{end}}
99
{{if $.IsRepoAdmin}}

0 commit comments

Comments
 (0)