gitea源码

allow_maintainer_edit.tmpl 1.0KB

12345678910111213141516171819
  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 -}}
  6. <div class="divider"></div>
  7. <div class="ui checkbox {{if not $allowToChange}}disabled{{end}} loading-icon-2px"
  8. {{if $allowToChange}}
  9. id="allow-edits-from-maintainers"
  10. data-url="{{.Issue.Link}}"
  11. data-tooltip-content="{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers_desc"}}"
  12. data-prompt-error="{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers_err"}}"
  13. {{end}}
  14. >
  15. <label><strong>{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers"}}</strong></label>
  16. <input type="checkbox" {{if .Issue.PullRequest.AllowMaintainerEdit}}checked{{end}} {{if not $allowToChange}}disabled{{end}}>
  17. </div>
  18. {{end}}