File tree 1 file changed +10
-5
lines changed
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 1
- {{if and .Issue.IsPull .IsIssuePoster (not .Issue.IsClosed) .Issue.PullRequest.HeadRepo}}
2
- {{if and (not (eq .Issue.PullRequest.HeadRepo.FullName .Issue.PullRequest.BaseRepo.FullName)) .CanWriteToHeadRepo}}
1
+ {{- $isHeadForkedRepo := and .Issue.PullRequest .Issue.PullRequest.HeadRepo (ne .Issue.PullRequest.HeadRepo.FullName .Issue.PullRequest.BaseRepo.FullName) -}}
2
+ {{if $isHeadForkedRepo}}
3
+ {{- $isPullPoster := and .Issue.IsPull .IsIssuePoster -}}
4
+ {{- $isPullEditable := and .Issue.PullRequest (not .Issue.IsClosed) (not .Repository.IsArchived) -}}
5
+ {{- $allowToChange := and $isPullPoster $isPullEditable -}}
3
6
<div class="divider"></div>
4
- <div class="ui checkbox loading-icon-2px" id="allow-edits-from-maintainers"
7
+ <div class="ui checkbox {{if not $allowToChange}}disabled{{end}} loading-icon-2px"
8
+ {{if $allowToChange}}
9
+ id="allow-edits-from-maintainers"
5
10
data-url="{{.Issue.Link}}"
6
11
data-tooltip-content="{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers_desc"}}"
7
12
data-prompt-error="{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers_err"}}"
13
+ {{end}}
8
14
>
9
15
<label><strong>{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers"}}</strong></label>
10
- <input type="checkbox" {{if .Issue.PullRequest.AllowMaintainerEdit}}checked{{end}}>
16
+ <input type="checkbox" {{if .Issue.PullRequest.AllowMaintainerEdit}}checked{{end}} {{if not $allowToChange}}disabled{{end}} >
11
17
</div>
12
- {{end}}
13
18
{{end}}
You can’t perform that action at this time.
0 commit comments