2019-06-08 04:29:29 +08:00
|
|
|
{{template "base/head" .}}
|
2020-12-01 12:00:14 +08:00
|
|
|
<div class="page-content repository diff {{if .PageIsComparePull}}compare pull{{end}}">
|
2019-06-08 04:29:29 +08:00
|
|
|
{{template "repo/header" .}}
|
|
|
|
<div class="ui container {{if .IsSplitStyle}}fluid padded{{end}}">
|
|
|
|
|
2021-05-08 05:10:05 +08:00
|
|
|
<h2 class="ui header">
|
|
|
|
{{if and $.PageIsComparePull $.IsSigned (not .Repository.IsArchived)}}
|
|
|
|
{{.i18n.Tr "repo.pulls.compare_changes"}}
|
|
|
|
<div class="sub header">{{.i18n.Tr "repo.pulls.compare_changes_desc"}}</div>
|
|
|
|
{{ else }}
|
|
|
|
{{.i18n.Tr "action.compare_commits_general"}}
|
|
|
|
{{ end }}
|
|
|
|
</h2>
|
|
|
|
{{ $BaseCompareName := $.BaseName -}}
|
|
|
|
{{- $HeadCompareName := $.HeadRepo.OwnerName -}}
|
|
|
|
{{- if and (eq $.BaseName $.HeadRepo.OwnerName) (ne $.Repository.Name $.HeadRepo.Name) -}}
|
|
|
|
{{- $HeadCompareName = printf "%s/%s" $.HeadRepo.OwnerName $.HeadRepo.Name -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- $OwnForkCompareName := "" -}}
|
|
|
|
{{- if .OwnForkRepo -}}
|
|
|
|
{{- $OwnForkCompareName = .OwnForkRepo.OwnerName -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- $RootRepoCompareName := "" -}}
|
|
|
|
{{- if .RootRepo -}}
|
|
|
|
{{- $RootRepoCompareName = .RootRepo.OwnerName -}}
|
|
|
|
{{- if eq $.HeadRepo.OwnerName .RootRepo.OwnerName -}}
|
2021-03-16 09:36:34 +08:00
|
|
|
{{- $HeadCompareName = printf "%s/%s" $.HeadRepo.OwnerName $.HeadRepo.Name -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- if .OwnForkRepo -}}
|
2021-05-08 05:10:05 +08:00
|
|
|
{{- if eq $.OwnForkRepo.OwnerName .RootRepo.OwnerName -}}
|
|
|
|
{{- $OwnForkRepoCompareName = printf "%s/%s" $.OwnForkRepo.OwnerName $.OwnForkRepo.Name -}}
|
2021-03-16 09:36:34 +08:00
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
2021-05-08 05:10:05 +08:00
|
|
|
{{- end -}}
|
|
|
|
<div class="ui segment choose branch">
|
2021-11-17 02:18:25 +08:00
|
|
|
<a href="{{$.HeadRepo.Link}}/compare/{{PathEscapeSegments $.HeadBranch}}{{$.CompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.BaseName}}/{{PathEscape $.Repository.Name}}:{{end}}{{PathEscapeSegments $.BaseBranch}}" title="{{.i18n.Tr "repo.pulls.switch_head_and_base"}}">{{svg "octicon-git-compare"}}</a>
|
2021-05-08 05:10:05 +08:00
|
|
|
<div class="ui floating filter dropdown" data-no-results="{{.i18n.Tr "repo.pulls.no_results"}}">
|
|
|
|
<div class="ui basic small button">
|
|
|
|
<span class="text">{{if $.PageIsComparePull}}{{.i18n.Tr "repo.pulls.compare_base"}}{{else}}{{.i18n.Tr "repo.compare.compare_base"}}{{end}}: {{$BaseCompareName}}:{{$.BaseBranch}}</span>
|
|
|
|
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
|
|
|
</div>
|
|
|
|
<div class="menu">
|
|
|
|
<div class="ui icon search input">
|
|
|
|
<i class="icon df ac jc m-0">{{svg "octicon-filter" 16}}</i>
|
|
|
|
<input name="search" placeholder="{{.i18n.Tr "repo.filter_branch_and_tag"}}...">
|
2019-06-08 04:29:29 +08:00
|
|
|
</div>
|
2021-05-08 05:10:05 +08:00
|
|
|
<div class="header">
|
|
|
|
<div class="ui grid">
|
|
|
|
<div class="two column row">
|
|
|
|
<a class="reference column" href="#" data-target=".base-branch-list">
|
|
|
|
<span class="text black">
|
|
|
|
{{svg "octicon-git-branch" 16 "mr-2"}}{{.i18n.Tr "repo.branches"}}
|
|
|
|
</span>
|
|
|
|
</a>
|
|
|
|
<a class="reference column" href="#" data-target=".base-tag-list">
|
|
|
|
<span class="text black">
|
|
|
|
{{svg "octicon-tag" 16 "mr-2"}}{{.i18n.Tr "repo.tags"}}
|
|
|
|
</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
2019-06-08 04:29:29 +08:00
|
|
|
</div>
|
2021-05-08 05:10:05 +08:00
|
|
|
</div>
|
|
|
|
<div class="scrolling menu reference-list-menu base-branch-list">
|
|
|
|
{{range .Branches}}
|
2021-11-17 02:18:25 +08:00
|
|
|
<div class="item {{if eq $.BaseBranch .}}selected{{end}}" data-url="{{$.RepoLink}}/compare/{{PathEscapeSegments .}}{{$.CompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{end}}{{PathEscapeSegments $.HeadBranch}}">{{$BaseCompareName}}:{{.}}</div>
|
2021-05-08 05:10:05 +08:00
|
|
|
{{end}}
|
|
|
|
{{if not .PullRequestCtx.SameRepo}}
|
|
|
|
{{range .HeadBranches}}
|
2021-11-17 02:18:25 +08:00
|
|
|
<div class="item" data-url="{{$.HeadRepo.Link}}/compare/{{PathEscapeSegments .}}{{$.CompareSeparator}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{PathEscapeSegments $.HeadBranch}}">{{$HeadCompareName}}:{{.}}</div>
|
2019-06-08 04:29:29 +08:00
|
|
|
{{end}}
|
2021-05-08 05:10:05 +08:00
|
|
|
{{end}}
|
|
|
|
{{if .OwnForkRepo}}
|
|
|
|
{{range .OwnForkRepoBranches}}
|
2021-11-17 02:18:25 +08:00
|
|
|
<div class="item" data-url="{{$.OwnForkRepo.Link}}/compare/{{PathEscapeSegments .}}{{$.CompareSeparator}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{PathEscapeSegments $.HeadBranch}}">{{$OwnForkCompareName}}:{{.}}</div>
|
2020-05-12 13:52:46 +08:00
|
|
|
{{end}}
|
2021-05-08 05:10:05 +08:00
|
|
|
{{end}}
|
|
|
|
{{if .RootRepo}}
|
|
|
|
{{range .RootRepoBranches}}
|
2021-11-17 02:18:25 +08:00
|
|
|
<div class="item" data-url="{{$.RootRepo.Link}}/compare/{{PathEscapeSegments .}}{{$.CompareSeparator}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{PathEscapeSegments $.HeadBranch}}">{{$RootRepoCompareName}}:{{.}}</div>
|
2020-05-12 13:52:46 +08:00
|
|
|
{{end}}
|
2021-05-08 05:10:05 +08:00
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
<div class="scrolling menu reference-list-menu base-tag-list" style="display: none">
|
|
|
|
{{range .Tags}}
|
2021-11-17 02:18:25 +08:00
|
|
|
<div class="item {{if eq $.BaseBranch .}}selected{{end}}" data-url="{{$.RepoLink}}/compare/{{PathEscapeSegments .}}{{$.CompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{end}}{{PathEscapeSegments $.HeadBranch}}">{{$BaseCompareName}}:{{.}}</div>
|
2021-05-08 05:10:05 +08:00
|
|
|
{{end}}
|
|
|
|
{{if not .PullRequestCtx.SameRepo}}
|
|
|
|
{{range .HeadTags}}
|
2021-11-17 02:18:25 +08:00
|
|
|
<div class="item" data-url="{{$.HeadRepo.Link}}/compare/{{PathEscapeSegments .}}{{$.CompareSeparator}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{PathEscapeSegments $.HeadBranch}}">{{$HeadCompareName}}:{{.}}</div>
|
2019-10-30 13:58:18 +08:00
|
|
|
{{end}}
|
2021-05-08 05:10:05 +08:00
|
|
|
{{end}}
|
|
|
|
{{if .OwnForkRepo}}
|
|
|
|
{{range .OwnForkRepoTags}}
|
2021-11-17 02:18:25 +08:00
|
|
|
<div class="item" data-url="{{$.OwnForkRepo.Link}}/compare/{{PathEscapeSegments .}}{{$.CompareSeparator}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{PathEscapeSegments $.HeadBranch}}">{{$OwnForkCompareName}}:{{.}}</div>
|
2021-05-08 05:10:05 +08:00
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
{{if .RootRepo}}
|
|
|
|
{{range .RootRepoTags}}
|
2021-11-17 02:18:25 +08:00
|
|
|
<div class="item" data-url="{{$.RootRepo.Link}}/compare/{{PathEscapeSegments .}}{{$.CompareSeparator}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{PathEscapeSegments $.HeadBranch}}">{{$RootRepoCompareName}}:{{.}}</div>
|
2021-05-08 05:10:05 +08:00
|
|
|
{{end}}
|
|
|
|
{{end}}
|
2019-06-08 04:29:29 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-05-08 05:10:05 +08:00
|
|
|
</div>
|
2021-11-17 02:18:25 +08:00
|
|
|
<a href="{{.RepoLink}}/compare/{{PathEscapeSegments .BaseBranch}}{{.OtherCompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{end}}{{PathEscapeSegments $.HeadBranch}}" title="{{.i18n.Tr "repo.pulls.switch_comparison_type"}}">{{.CompareSeparator}}</a>
|
2021-05-08 05:10:05 +08:00
|
|
|
<div class="ui floating filter dropdown">
|
|
|
|
<div class="ui basic small button">
|
|
|
|
<span class="text">{{if $.PageIsComparePull}}{{.i18n.Tr "repo.pulls.compare_compare"}}{{else}}{{.i18n.Tr "repo.compare.compare_head"}}{{end}}: {{$HeadCompareName}}:{{$.HeadBranch}}</span>
|
|
|
|
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
|
|
|
</div>
|
|
|
|
<div class="menu">
|
|
|
|
<div class="ui icon search input">
|
|
|
|
<i class="icon df ac jc m-0">{{svg "octicon-filter" 16}}</i>
|
|
|
|
<input name="search" placeholder="{{.i18n.Tr "repo.filter_branch_and_tag"}}...">
|
2019-06-08 04:29:29 +08:00
|
|
|
</div>
|
2021-05-08 05:10:05 +08:00
|
|
|
<div class="header">
|
|
|
|
<div class="ui grid">
|
|
|
|
<div class="two column row">
|
|
|
|
<a class="reference column" href="#" data-target=".head-branch-list">
|
|
|
|
<span class="text black">
|
|
|
|
{{svg "octicon-git-branch" 16 "mr-2"}}{{.i18n.Tr "repo.branches"}}
|
|
|
|
</span>
|
|
|
|
</a>
|
|
|
|
<a class="reference column" href="#" data-target=".head-tag-list">
|
|
|
|
<span class="text black">
|
|
|
|
{{svg "octicon-tag" 16 "mr-2"}}{{.i18n.Tr "repo.tags"}}
|
|
|
|
</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
2019-06-08 04:29:29 +08:00
|
|
|
</div>
|
2021-05-08 05:10:05 +08:00
|
|
|
</div>
|
|
|
|
<div class="scrolling menu reference-list-menu head-branch-list">
|
|
|
|
{{range .HeadBranches}}
|
2021-11-17 02:18:25 +08:00
|
|
|
<div class="{{if eq $.HeadBranch .}}selected{{end}} item" data-url="{{$.RepoLink}}/compare/{{PathEscapeSegments $.BaseBranch}}{{$.CompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{end}}{{PathEscapeSegments .}}">{{$HeadCompareName}}:{{.}}</div>
|
2021-05-08 05:10:05 +08:00
|
|
|
{{end}}
|
|
|
|
{{if not .PullRequestCtx.SameRepo}}
|
|
|
|
{{range .Branches}}
|
2021-11-17 02:18:25 +08:00
|
|
|
<div class="item" data-url="{{$.RepoLink}}/compare/{{PathEscapeSegments $.BaseBranch}}{{$.CompareSeparator}}{{PathEscape $.BaseName}}/{{PathEscape $.Repository.Name}}:{{PathEscapeSegments .}}">{{$BaseCompareName}}:{{.}}</div>
|
2020-05-12 13:52:46 +08:00
|
|
|
{{end}}
|
2021-05-08 05:10:05 +08:00
|
|
|
{{end}}
|
|
|
|
{{if .OwnForkRepo}}
|
|
|
|
{{range .OwnForkRepoBranches}}
|
2021-11-17 02:18:25 +08:00
|
|
|
<div class="item" data-url="{{$.RepoLink}}/compare/{{PathEscapeSegments $.BaseBranch}}{{$.CompareSeparator}}{{PathEscape $.OwnForkRepo.OwnerName}}/{{PathEscape $.OwnForkRepo.Name}}:{{PathEscapeSegments .}}">{{$OwnForkCompareName}}:{{.}}</div>
|
2020-05-12 13:52:46 +08:00
|
|
|
{{end}}
|
2021-05-08 05:10:05 +08:00
|
|
|
{{end}}
|
|
|
|
{{if .RootRepo}}
|
|
|
|
{{range .RootRepoBranches}}
|
2021-11-17 02:18:25 +08:00
|
|
|
<div class="item" data-url="{{$.RepoLink}}/compare/{{PathEscapeSegments $.BaseBranch}}{{$.CompareSeparator}}{{PathEscape $.RootRepo.OwnerName}}/{{PathEscape $.RootRepo.Name}}:{{PathEscapeSegments .}}">{{$RootRepoCompareName}}:{{.}}</div>
|
2020-05-12 13:52:46 +08:00
|
|
|
{{end}}
|
2021-05-08 05:10:05 +08:00
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
<div class="scrolling menu reference-list-menu head-tag-list" style="display: none">
|
|
|
|
{{range .HeadTags}}
|
2021-11-17 02:18:25 +08:00
|
|
|
<div class="{{if eq $.HeadBranch .}}selected{{end}} item" data-url="{{$.RepoLink}}/compare/{{PathEscapeSegments $.BaseBranch}}{{$.CompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{end}}{{PathEscapeSegments .}}">{{$HeadCompareName}}:{{.}}</div>
|
2021-05-08 05:10:05 +08:00
|
|
|
{{end}}
|
|
|
|
{{if not .PullRequestCtx.SameRepo}}
|
|
|
|
{{range .Tags}}
|
2021-11-17 02:18:25 +08:00
|
|
|
<div class="item" data-url="{{$.RepoLink}}/compare/{{PathEscapeSegments $.BaseBranch}}{{$.CompareSeparator}}{{PathEscape $.BaseName}}/{{PathEscape $.Repository.Name}}:{{PathEscapeSegments .}}">{{$BaseCompareName}}:{{.}}</div>
|
2019-06-08 04:29:29 +08:00
|
|
|
{{end}}
|
2021-05-08 05:10:05 +08:00
|
|
|
{{end}}
|
|
|
|
{{if .OwnForkRepo}}
|
|
|
|
{{range .OwnForkRepoTags}}
|
2021-11-17 02:18:25 +08:00
|
|
|
<div class="item" data-url="{{$.RepoLink}}/compare/{{PathEscapeSegments $.BaseBranch}}{{$.CompareSeparator}}{{PathEscape $.OwnForkRepo.OwnerName}}/{{PathEscape $.OwnForkRepo.Name}}:{{PathEscapeSegments .}}">{{$OwnForkCompareName}}:{{.}}</div>
|
2021-05-08 05:10:05 +08:00
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
{{if .RootRepo}}
|
|
|
|
{{range .RootRepoTags}}
|
2021-11-17 02:18:25 +08:00
|
|
|
<div class="item" data-url="{{$.RepoLink}}/compare/{{PathEscapeSegments $.BaseBranch}}{{$.CompareSeparator}}{{PathEscape $.RootRepo.OwnerName}}/{{PathEscape $.RootRepo.Name}}:{{PathEscapeSegments .}}">{{$RootRepoCompareName}}:{{.}}</div>
|
2021-05-08 05:10:05 +08:00
|
|
|
{{end}}
|
|
|
|
{{end}}
|
2019-06-08 04:29:29 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-05-08 05:10:05 +08:00
|
|
|
</div>
|
2019-06-08 04:29:29 +08:00
|
|
|
|
|
|
|
{{if .IsNothingToCompare}}
|
2021-03-04 11:41:23 +08:00
|
|
|
{{if and $.IsSigned $.AllowEmptyPr (not .Repository.IsArchived) }}
|
|
|
|
<div class="ui segment">{{.i18n.Tr "repo.pulls.nothing_to_compare_and_allow_empty_pr"}}</div>
|
2021-07-25 10:59:27 +08:00
|
|
|
<div class="ui info message show-form-container" {{if .Flash}}style="display: none"{{end}}>
|
2021-03-04 11:41:23 +08:00
|
|
|
<button class="ui button green show-form">{{.i18n.Tr "repo.pulls.new"}}</button>
|
|
|
|
</div>
|
2021-07-25 10:59:27 +08:00
|
|
|
<div class="pullrequest-form" {{if not .Flash}}style="display: none"{{end}}>
|
2021-03-04 11:41:23 +08:00
|
|
|
{{template "repo/issue/new_form" .}}
|
|
|
|
</div>
|
|
|
|
{{else}}
|
|
|
|
<div class="ui segment">{{.i18n.Tr "repo.pulls.nothing_to_compare"}}</div>
|
|
|
|
{{end}}
|
2020-05-02 16:06:01 +08:00
|
|
|
{{else if and .PageIsComparePull (gt .CommitCount 0)}}
|
2019-06-08 04:29:29 +08:00
|
|
|
{{if .HasPullRequest}}
|
2021-12-24 20:14:42 +08:00
|
|
|
<div class="ui segment grid title">
|
|
|
|
<div class="twelve wide column issue-title">
|
|
|
|
{{.i18n.Tr "repo.pulls.has_pull_request" (Escape $.RepoLink) (Escape $.RepoRelPath) .PullRequest.Index | Safe}}
|
|
|
|
<h1>
|
|
|
|
<span id="issue-title">{{RenderIssueTitle .PullRequest.Issue.Title $.RepoLink $.Repository.ComposeMetas}}</span>
|
|
|
|
<span class="index">#{{.PullRequest.Issue.Index}}</span>
|
|
|
|
</h1>
|
|
|
|
</div>
|
|
|
|
<div class="four wide right middle aligned column">
|
|
|
|
{{- if .PullRequest.HasMerged -}}
|
|
|
|
<a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button purple show-form">{{svg "octicon-git-merge" 16}} {{.i18n.Tr "repo.pulls.view"}}</a>
|
|
|
|
{{else if .Issue.IsClosed}}
|
|
|
|
<a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button red show-form">{{svg "octicon-issue-closed" 16}} {{.i18n.Tr "repo.pulls.view"}}</a>
|
|
|
|
{{else}}
|
|
|
|
<a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button green show-form">{{svg "octicon-git-pull-request" 16}} {{.i18n.Tr "repo.pulls.view"}}</a>
|
|
|
|
{{end}}</div>
|
2021-04-11 11:46:37 +08:00
|
|
|
</div>
|
2020-05-05 06:44:30 +08:00
|
|
|
{{else}}
|
|
|
|
{{if and $.IsSigned (not .Repository.IsArchived)}}
|
2021-07-25 10:59:27 +08:00
|
|
|
<div class="ui info message show-form-container" {{if .Flash}}style="display: none"{{end}}>
|
2020-05-05 06:44:30 +08:00
|
|
|
<button class="ui button green show-form">{{.i18n.Tr "repo.pulls.new"}}</button>
|
|
|
|
</div>
|
|
|
|
{{else if .Repository.IsArchived}}
|
|
|
|
<div class="ui warning message">
|
|
|
|
{{.i18n.Tr "repo.archive.title"}}
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
{{if $.IsSigned}}
|
2021-07-25 10:59:27 +08:00
|
|
|
<div class="pullrequest-form" {{if not .Flash}}style="display: none"{{end}}>
|
2020-05-05 06:44:30 +08:00
|
|
|
{{template "repo/issue/new_form" .}}
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
{{template "repo/commits_table" .}}
|
|
|
|
{{template "repo/diff/box" .}}
|
|
|
|
{{end}}
|
2019-06-08 04:29:29 +08:00
|
|
|
{{else}}
|
|
|
|
{{template "repo/commits_table" .}}
|
|
|
|
{{template "repo/diff/box" .}}
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{template "base/footer" .}}
|