From d5d9c56ac26e2b88db40ce516151c63495bc3e77 Mon Sep 17 00:00:00 2001 From: Bartlomiej Komendarczuk <bkomendarczuk@gmail.com> Date: Mon, 3 Apr 2023 00:40:43 +0200 Subject: [PATCH] Added close/open button to details page of milestone (#23877) Depending on the current state, a close or open button appears. Close https://github.com/go-gitea/gitea/issues/19083 ---   --- templates/repo/issue/milestone_issues.tmpl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/templates/repo/issue/milestone_issues.tmpl b/templates/repo/issue/milestone_issues.tmpl index cb20fb0c568e..2ca2fa2bce70 100644 --- a/templates/repo/issue/milestone_issues.tmpl +++ b/templates/repo/issue/milestone_issues.tmpl @@ -9,6 +9,13 @@ {{if not .Repository.IsArchived}} <div class="column right aligned"> {{if or .CanWriteIssues .CanWritePulls}} + {{if .Milestone.IsClosed}} + <a class="ui green basic button link-action" href data-url="{{$.RepoLink}}/milestones/{{.MilestoneID}}/open">{{$.locale.Tr "repo.milestones.open"}} + </a> + {{else}} + <a class="ui red basic button link-action" href data-url="{{$.RepoLink}}/milestones/{{.MilestoneID}}/close">{{$.locale.Tr "repo.milestones.close"}} + </a> + {{end}} <a class="ui button" href="{{.RepoLink}}/milestones/{{.MilestoneID}}/edit">{{.locale.Tr "repo.milestones.edit"}}</a> {{end}} <a class="ui primary button" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}?milestone={{.MilestoneID}}">{{.locale.Tr "repo.issues.new"}}</a>