gitea源码

upstream_diverging_info.tmpl 1.4KB

123456789101112131415161718192021222324
  1. {{if and .UpstreamDivergingInfo .UpstreamDivergingInfo.BaseBranchHasNewCommits}}
  2. <div class="ui message flex-text-block">
  3. <div class="tw-flex-1">
  4. {{$upstreamLink := printf "%s/src/branch/%s" .Repository.BaseRepo.Link (.UpstreamDivergingInfo.BaseBranchName|PathEscapeSegments)}}
  5. {{$upstreamRepoBranchDisplay := HTMLFormat "%s:%s" .Repository.BaseRepo.FullName .UpstreamDivergingInfo.BaseBranchName}}
  6. {{$thisRepoBranchDisplay := HTMLFormat "%s:%s" .Repository.FullName .BranchName}}
  7. {{$upstreamHtml := HTMLFormat `<a href="%s">%s</a>` $upstreamLink $upstreamRepoBranchDisplay}}
  8. {{if .UpstreamDivergingInfo.HeadBranchCommitsBehind}}
  9. {{ctx.Locale.TrN .UpstreamDivergingInfo.HeadBranchCommitsBehind "repo.pulls.upstream_diverging_prompt_behind_1" "repo.pulls.upstream_diverging_prompt_behind_n" .UpstreamDivergingInfo.HeadBranchCommitsBehind $upstreamHtml}}
  10. {{else}}
  11. {{ctx.Locale.Tr "repo.pulls.upstream_diverging_prompt_base_newer" $upstreamHtml}}
  12. {{end}}
  13. </div>
  14. {{if .CanWriteCode}}
  15. <button class="ui compact primary button tw-m-0 link-action"
  16. data-modal-confirm-header="{{ctx.Locale.Tr "repo.pulls.upstream_diverging_merge"}}"
  17. data-modal-confirm-content="{{ctx.Locale.Tr "repo.pulls.upstream_diverging_merge_confirm" $upstreamRepoBranchDisplay $thisRepoBranchDisplay}}"
  18. data-url="{{.Repository.Link}}/branches/merge-upstream?branch={{.BranchName}}">
  19. {{ctx.Locale.Tr "repo.pulls.upstream_diverging_merge"}}
  20. </button>
  21. {{end}}
  22. </div>
  23. {{end}}