]> source.dussan.org Git - gitea.git/commitdiff
Fix Bug in Issue/pulls list (#32081)
authorcloudchamb3r <jizon0123@protonmail.com>
Mon, 23 Sep 2024 17:09:57 +0000 (02:09 +0900)
committerGitHub <noreply@github.com>
Mon, 23 Sep 2024 17:09:57 +0000 (01:09 +0800)
fix #32080

## After
### for opened issues
<img width="1199" alt="Screenshot 2024-09-19 at 6 29 31 PM"
src="https://github.com/user-attachments/assets/86cf48ad-5e4b-4dcb-8abe-4d7fd74e0aec">

### for closed issues
<img width="1208" alt="Screenshot 2024-09-19 at 6 29 37 PM"
src="https://github.com/user-attachments/assets/a16bc545-bfcf-49a4-be52-3e7334910482">

### for all issues
<img width="1340" alt="Screenshot 2024-09-20 at 12 07 12 PM"
src="https://github.com/user-attachments/assets/b2309c8f-e59d-44e9-ae3b-bf54e1196169">

routers/web/repo/issue.go
templates/repo/issue/filter_actions.tmpl

index 596abb4b9ca5bd5503f0b5ecc485a12bf0e21bb6..507b5af9d904a6590854ac9be4393cc06c297685 100644 (file)
@@ -467,6 +467,7 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption opt
        ctx.Data["AssigneeID"] = assigneeID
        ctx.Data["PosterID"] = posterID
        ctx.Data["Keyword"] = keyword
+       ctx.Data["IsShowClosed"] = isShowClosed
        switch {
        case isShowClosed.Value():
                ctx.Data["State"] = "closed"
index 88d0653f7db17f9aa97b29498dbe6d18f27e3eb4..831ab17bea2c6faae55126cafbc56f7a7113a3b3 100644 (file)
@@ -1,9 +1,9 @@
 <div class="ui secondary filter menu">
        {{if not .Repository.IsArchived}}
                <!-- Action Button -->
-               {{if .IsShowClosed}}
+               {{if and .IsShowClosed.Has .IsShowClosed.Value}}
                        <button class="ui primary basic button issue-action" data-action="open" data-url="{{$.RepoLink}}/issues/status">{{ctx.Locale.Tr "repo.issues.action_open"}}</button>
-               {{else}}
+               {{else if and .IsShowClosed.Has (not .IsShowClosed.Value)}}
                        <button class="ui red basic button issue-action" data-action="close" data-url="{{$.RepoLink}}/issues/status">{{ctx.Locale.Tr "repo.issues.action_close"}}</button>
                {{end}}
                {{if $.IsRepoAdmin}}