From 66b22c58187649c4fc03dfff2c90d6a8de790465 Mon Sep 17 00:00:00 2001 From: Otto Richter Date: Thu, 25 Apr 2024 15:01:16 +0200 Subject: [PATCH] Unify allow edits logic --- .../repo/issue/view_content/sidebar.tmpl | 10 ++++++++- .../sidebar/pull_maintainer_edits.tmpl | 21 ++++++++----------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 5740b79ad..ba1553984 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -52,7 +52,15 @@ {{template "repo/issue/view_content/sidebar/actions" .}} {{end}} - {{if and .Issue.IsPull .IsIssuePoster (not .Issue.IsClosed) .Issue.PullRequest.HeadRepo}} + {{if and + .Issue.IsPull + .IsIssuePoster + (not .Issue.IsClosed) + .Issue.PullRequest.HeadRepo + (not (eq .Issue.PullRequest.HeadRepo.FullName .Issue.PullRequest.BaseRepo.FullName)) + .CanWriteToHeadRepo + }} +
{{template "repo/issue/view_content/sidebar/pull_maintainer_edits" .}} {{end}} diff --git a/templates/repo/issue/view_content/sidebar/pull_maintainer_edits.tmpl b/templates/repo/issue/view_content/sidebar/pull_maintainer_edits.tmpl index c6a87adde..6ec5c05fd 100644 --- a/templates/repo/issue/view_content/sidebar/pull_maintainer_edits.tmpl +++ b/templates/repo/issue/view_content/sidebar/pull_maintainer_edits.tmpl @@ -1,13 +1,10 @@ -{{if and (not (eq .Issue.PullRequest.HeadRepo.FullName .Issue.PullRequest.BaseRepo.FullName)) .CanWriteToHeadRepo}} -
-
-
- - -
+
+
+ +
-{{end}} +