2019-06-07 16:29:29 -04:00
|
|
|
{{template "base/head" .}}
|
2020-11-30 23:00:14 -05:00
|
|
|
<div class="page-content repository diff {{if .PageIsComparePull}}compare pull{{end}}">
|
2019-06-07 16:29:29 -04:00
|
|
|
{{template "repo/header" .}}
|
|
|
|
<div class="ui container {{if .IsSplitStyle}}fluid padded{{end}}">
|
|
|
|
|
|
|
|
{{if .PageIsComparePull}}
|
|
|
|
<h2 class="ui header">
|
2020-05-04 18:44:30 -04:00
|
|
|
{{if and $.IsSigned (not .Repository.IsArchived)}}
|
2019-07-08 15:18:09 -04:00
|
|
|
{{.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 }}
|
2019-06-07 16:29:29 -04:00
|
|
|
</h2>
|
2021-03-15 21:36:34 -04:00
|
|
|
{{ $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 -}}
|
|
|
|
{{- $HeadCompareName = printf "%s/%s" $.HeadRepo.OwnerName $.HeadRepo.Name -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- if .OwnForkRepo -}}
|
|
|
|
{{- if eq $.OwnForkRepo.OwnerName .RootRepo.OwnerName -}}
|
|
|
|
{{- $OwnForkRepoCompareName = printf "%s/%s" $.OwnForkRepo.OwnerName $.OwnForkRepo.Name -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
2019-06-07 16:29:29 -04:00
|
|
|
<div class="ui segment choose branch">
|
2020-09-11 16:19:00 -04:00
|
|
|
{{svg "octicon-git-compare"}}
|
2019-06-07 16:29:29 -04:00
|
|
|
<div class="ui floating filter dropdown" data-no-results="{{.i18n.Tr "repo.pulls.no_results"}}">
|
|
|
|
<div class="ui basic small button">
|
2021-03-15 21:36:34 -04:00
|
|
|
<span class="text">{{.i18n.Tr "repo.pulls.compare_base"}}: {{$BaseCompareName}}:{{$.BaseBranch}}</span>
|
2020-10-31 18:15:11 -04:00
|
|
|
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
2019-06-07 16:29:29 -04:00
|
|
|
</div>
|
|
|
|
<div class="menu">
|
|
|
|
<div class="ui icon search input">
|
2020-11-09 13:21:47 -05:00
|
|
|
<i class="icon df ac jc m-0">{{svg "octicon-filter" 16}}</i>
|
2019-06-07 16:29:29 -04:00
|
|
|
<input name="search" placeholder="{{.i18n.Tr "repo.pulls.filter_branch"}}...">
|
|
|
|
</div>
|
|
|
|
<div class="scrolling menu">
|
|
|
|
{{range .Branches}}
|
2021-03-15 21:36:34 -04:00
|
|
|
<div class="item {{if eq $.BaseBranch .}}selected{{end}}" data-url="{{$.RepoLink}}/compare/{{EscapePound .}}...{{if not $.PullRequestCtx.SameRepo}}{{$.HeadUser.Name}}/{{$.HeadRepo.Name}}:{{end}}{{EscapePound $.HeadBranch}}">{{$BaseCompareName}}:{{.}}</div>
|
2019-06-07 16:29:29 -04:00
|
|
|
{{end}}
|
2020-05-12 01:52:46 -04:00
|
|
|
{{if not .PullRequestCtx.SameRepo}}
|
|
|
|
{{range .HeadBranches}}
|
2021-03-15 21:36:34 -04:00
|
|
|
<div class="item" data-url="{{$.HeadRepo.Link}}/compare/{{EscapePound .}}...{{$.HeadUser.Name}}/{{$.HeadRepo.Name}}:{{EscapePound $.HeadBranch}}">{{$HeadCompareName}}:{{.}}</div>
|
2020-05-12 01:52:46 -04:00
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
{{if .OwnForkRepo}}
|
|
|
|
{{range .OwnForkRepoBranches}}
|
2021-03-15 21:36:34 -04:00
|
|
|
<div class="item" data-url="{{$.OwnForkRepo.Link}}/compare/{{EscapePound .}}...{{$.HeadUser.Name}}/{{$.HeadRepo.Name}}:{{EscapePound $.HeadBranch}}">{{$OwnForkCompareName}}:{{.}}</div>
|
2020-05-12 01:52:46 -04:00
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
{{if .RootRepo}}
|
|
|
|
{{range .RootRepoBranches}}
|
2021-03-15 21:36:34 -04:00
|
|
|
<div class="item" data-url="{{$.RootRepo.Link}}/compare/{{EscapePound .}}...{{$.HeadUser.Name}}/{{$.HeadRepo.Name}}:{{EscapePound $.HeadBranch}}">{{$RootRepoCompareName}}:{{.}}</div>
|
2019-10-30 01:58:18 -04:00
|
|
|
{{end}}
|
|
|
|
{{end}}
|
2019-06-07 16:29:29 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
...
|
|
|
|
<div class="ui floating filter dropdown">
|
|
|
|
<div class="ui basic small button">
|
2021-03-15 21:36:34 -04:00
|
|
|
<span class="text">{{.i18n.Tr "repo.pulls.compare_compare"}}: {{$HeadCompareName}}:{{$.HeadBranch}}</span>
|
2020-10-31 18:15:11 -04:00
|
|
|
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
2019-06-07 16:29:29 -04:00
|
|
|
</div>
|
|
|
|
<div class="menu">
|
|
|
|
<div class="ui icon search input">
|
2020-11-09 13:21:47 -05:00
|
|
|
<i class="icon df ac jc m-0">{{svg "octicon-filter" 16}}</i>
|
2019-06-07 16:29:29 -04:00
|
|
|
<input name="search" placeholder="{{.i18n.Tr "repo.pulls.filter_branch"}}...">
|
|
|
|
</div>
|
|
|
|
<div class="scrolling menu">
|
|
|
|
{{range .HeadBranches}}
|
2021-03-15 21:36:34 -04:00
|
|
|
<div class="{{if eq $.HeadBranch .}}selected{{end}} item" data-url="{{$.RepoLink}}/compare/{{EscapePound $.BaseBranch}}...{{if not $.PullRequestCtx.SameRepo}}{{$.HeadUser.Name}}/{{$.HeadRepo.Name}}:{{end}}{{EscapePound .}}">{{$HeadCompareName}}:{{.}}</div>
|
2020-05-12 01:52:46 -04:00
|
|
|
{{end}}
|
|
|
|
{{if not .PullRequestCtx.SameRepo}}
|
|
|
|
{{range .Branches}}
|
2021-03-15 21:36:34 -04:00
|
|
|
<div class="item" data-url="{{$.RepoLink}}/compare/{{EscapePound $.BaseBranch}}...{{$.BaseName}}/{{$.Repository.Name}}:{{EscapePound .}}">{{$BaseCompareName}}:{{.}}</div>
|
2020-05-12 01:52:46 -04:00
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
{{if .OwnForkRepo}}
|
|
|
|
{{range .OwnForkRepoBranches}}
|
2021-03-15 21:36:34 -04:00
|
|
|
<div class="item" data-url="{{$.RepoLink}}/compare/{{EscapePound $.BaseBranch}}...{{$.OwnForkRepo.OwnerName}}/{{$.OwnForkRepo.Name}}:{{EscapePound .}}">{{$OwnForkCompareName}}:{{.}}</div>
|
2020-05-12 01:52:46 -04:00
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
{{if .RootRepo}}
|
|
|
|
{{range .RootRepoBranches}}
|
2021-03-15 21:36:34 -04:00
|
|
|
<div class="item" data-url="{{$.RepoLink}}/compare/{{EscapePound $.BaseBranch}}...{{$.RootRepo.OwnerName}}/{{$.RootRepo.Name}}:{{EscapePound .}}">{{$RootRepoCompareName}}:{{.}}</div>
|
2020-05-12 01:52:46 -04:00
|
|
|
{{end}}
|
2019-06-07 16:29:29 -04:00
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{if .IsNothingToCompare}}
|
2021-03-03 22:41:23 -05:00
|
|
|
{{if and $.IsSigned $.AllowEmptyPr (not .Repository.IsArchived) }}
|
|
|
|
<div class="ui segment">{{.i18n.Tr "repo.pulls.nothing_to_compare_and_allow_empty_pr"}}</div>
|
|
|
|
<div class="ui info message show-form-container">
|
|
|
|
<button class="ui button green show-form">{{.i18n.Tr "repo.pulls.new"}}</button>
|
|
|
|
</div>
|
|
|
|
<div class="pullrequest-form" style="display: none">
|
|
|
|
{{template "repo/issue/new_form" .}}
|
|
|
|
</div>
|
|
|
|
{{else}}
|
|
|
|
<div class="ui segment">{{.i18n.Tr "repo.pulls.nothing_to_compare"}}</div>
|
|
|
|
{{end}}
|
2020-05-02 04:06:01 -04:00
|
|
|
{{else if and .PageIsComparePull (gt .CommitCount 0)}}
|
2019-06-07 16:29:29 -04:00
|
|
|
{{if .HasPullRequest}}
|
2021-04-10 23:46:37 -04:00
|
|
|
<div class="ui segment">
|
|
|
|
{{.i18n.Tr "repo.pulls.has_pull_request" $.RepoLink $.RepoRelPath .PullRequest.Index | Safe}}
|
|
|
|
</div>
|
2020-05-04 18:44:30 -04:00
|
|
|
{{else}}
|
|
|
|
{{if and $.IsSigned (not .Repository.IsArchived)}}
|
|
|
|
<div class="ui info message show-form-container">
|
|
|
|
<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}}
|
|
|
|
<div class="pullrequest-form" style="display: none">
|
|
|
|
{{template "repo/issue/new_form" .}}
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
{{template "repo/commits_table" .}}
|
|
|
|
{{template "repo/diff/box" .}}
|
|
|
|
{{end}}
|
2019-06-07 16:29:29 -04:00
|
|
|
{{else}}
|
|
|
|
{{template "repo/commits_table" .}}
|
|
|
|
{{template "repo/diff/box" .}}
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{template "base/footer" .}}
|