@ -3,105 +3,175 @@
{{ template "repo/header" . }}
{{ template "repo/header" . }}
<div class="ui container {{ if .IsSplitStyle }} fluid padded {{ end }} ">
<div class="ui container {{ if .IsSplitStyle }} fluid padded {{ end }} ">
{{ if .PageIsComparePull }}
<h2 class="ui header">
<h2 class="ui header">
{{ if and $ .PageIsComparePull $ .IsSigned ( not .Repository .IsArchived ) }}
{{ if and $ .IsSigned ( not .Repository .IsArchived ) }}
{{ .i18n .Tr "repo.pulls.compare_changes" }}
{{ .i18n .Tr "repo.pulls.compare_changes" }}
<div class="sub header"> {{ .i18n .Tr "repo.pulls.compare_changes_desc" }} </div>
<div class="sub header"> {{ .i18n .Tr "repo.pulls.compare_changes_desc" }} </div>
{{ else }}
{{ else }}
{{ .i18n .Tr "action.compare_commits_general" }}
{{ .i18n .Tr "action.compare_commits_general" }}
{{ end }}
{{ end }}
</h2>
</h2>
{{ $ BaseCompareName : = $ .BaseName - }}
{{ $ BaseCompareName : = $ .BaseName - }}
{{ - $ HeadCompareName : = $ .HeadRepo .OwnerName - }}
{{ - $ HeadCompareName : = $ .HeadRepo .OwnerName - }}
{{ - if and ( eq $ .BaseName $ .HeadRepo .OwnerName ) ( ne $ .Repository .Name $ .HeadRepo .Name ) - }}
{{ - 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 - }}
{{ - $ HeadCompareName = printf "%s/%s" $ .HeadRepo .OwnerName $ .HeadRepo .Name - }}
{{ - end - }}
{{ - end - }}
{{ - $ OwnForkCompareName : = "" - }}
{{ - if .OwnForkRepo - }}
{{ - if .OwnForkRepo - }}
{{ - $ OwnForkCompareName = .OwnForkRepo .OwnerName - }}
{{ - if eq $ .OwnForkRepo .OwnerName .RootRepo .OwnerName - }}
{{ - end - }}
{{ - $ OwnForkRepoCompareName = printf "%s/%s" $ .OwnForkRepo .OwnerName $ .OwnForkRepo .Name - }}
{{ - $ 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 - }}
{{ - end - }}
{{ - end - }}
<div class="ui segment choose branch">
{{ - end - }}
{{ svg "octicon-git-compare" }}
<div class="ui segment choose branch">
<div class="ui floating filter dropdown" data-no-results=" {{ .i18n .Tr "repo.pulls.no_results" }} ">
{{ svg "octicon-git-compare" }}
<div class="ui basic small button">
<div class="ui floating filter dropdown" data-no-results=" {{ .i18n .Tr "repo.pulls.no_results" }} ">
<span class="text"> {{ .i18n .Tr "repo.pulls.compare_base" }} : {{ $ BaseCompareName }} : {{ $ .BaseBranch }} </span>
<div class="ui basic small button">
{{ svg "octicon-triangle-down" 1 4 "dropdown icon" }}
<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" 1 4 "dropdown icon" }}
</div>
<div class="menu">
<div class="ui icon search input">
<i class="icon df ac jc m-0"> {{ svg "octicon-filter" 1 6 }} </i>
<input name="search" placeholder=" {{ .i18n .Tr "repo.filter_branch_and_tag" }} ...">
</div>
</div>
<div class="menu">
<div class="header">
<div class="ui icon search input">
<div class="ui grid">
<i class="icon df ac jc m-0"> {{ svg "octicon-filter" 1 6 }} </i>
<div class="two column row">
<input name="search" placeholder=" {{ .i18n .Tr "repo.pulls.filter_branch" }} ...">
<a class="reference column" href="#" data-target=".base-branch-list">
<span class="text black">
{{ svg "octicon-git-branch" 1 6 "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" 1 6 "mr-2" }} {{ .i18n .Tr "repo.tags" }}
</span>
</a>
</div>
</div>
</div>
<div class="scrolling menu">
</div>
{{ range .Branches }}
<div class="scrolling menu reference-list-menu base-branch-list">
<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>
{{ range .Branches }}
<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>
{{ end }}
{{ if not .PullRequestCtx .SameRepo }}
{{ range .HeadBranches }}
<div class="item" data-url=" {{ $ .HeadRepo .Link }} /compare/ {{ EscapePound . }} ... {{ $ .HeadUser .Name }} / {{ $ .HeadRepo .Name }} : {{ EscapePound $ .HeadBranch }} "> {{ $ HeadCompareName }} : {{ . }} </div>
{{ end }}
{{ end }}
{{ if not .PullRequestCtx .SameRepo }}
{{ end }}
{{ range .HeadBranches }}
{{ if .OwnForkRepo }}
<div class="item" data-url=" {{ $ .HeadRepo .Link }} /compare/ {{ EscapePound . }} ... {{ $ .HeadUser .Name }} / {{ $ .HeadRepo .Name }} : {{ EscapePound $ .HeadBranch }} "> {{ $ HeadCompareName }} : {{ . }} </div>
{{ range .OwnForkRepoBranches }}
{{ end }}
<div class="item" data-url=" {{ $ .OwnForkR epo .Link }} /compare/ {{ EscapePou nd . }} ... {{ $ .HeadUser .Name }} / {{ $ .HeadRepo .Name }} : {{ EscapePound $ .HeadBranch }} "> {{ $ OwnForkCompareName }} : {{ . }} </div>
{{ end }}
{{ end }}
{{ if .OwnForkRepo }}
{{ end }}
{{ range .OwnForkRepoBranches }}
{{ if .RootRepo }}
<div class="item" data-url=" {{ $ .OwnForkRepo .Link }} /compare/ {{ EscapePound . }} ... {{ $ .HeadUser .Name }} / {{ $ .HeadRepo .Name }} : {{ EscapePound $ .HeadBranch }} "> {{ $ OwnForkCompareName }} : {{ . }} </div>
{{ range .RootRepoBranches }}
{{ end }}
<div class="item" data-url=" {{ $ .RootR epo .Link }} /compare/ {{ EscapePou nd . }} ... {{ $ .HeadUser .Name }} / {{ $ .HeadRepo .Name }} : {{ EscapePound $ .HeadBranch }} "> {{ $ RootRepoCompareName }} : {{ . }} </div>
{{ end }}
{{ end }}
{{ if .RootRepo }}
{{ end }}
{{ range .RootRepoBranches }}
</div>
<div class="item" data-url=" {{ $ .RootRepo .Link }} /compare/ {{ EscapePound . }} ... {{ $ .HeadUser .Name }} / {{ $ .HeadRepo .Name }} : {{ EscapePound $ .HeadBranch }} "> {{ $ RootRepoCompareName }} : {{ . }} </div>
<div class="scrolling menu reference-list-menu base-tag-list" style="display: none">
{{ end }}
{{ range .Tags }}
<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>
{{ end }}
{{ if not .PullRequestCtx .SameRepo }}
{{ range .HeadTags }}
<div class="item" data-url=" {{ $ .HeadRepo .Link }} /compare/ {{ EscapePound . }} ... {{ $ .HeadUser .Name }} / {{ $ .HeadRepo .Name }} : {{ EscapePound $ .HeadBranch }} "> {{ $ HeadCompareName }} : {{ . }} </div>
{{ end }}
{{ end }}
</div>
{{ end }}
{{ if .OwnForkRepo }}
{{ range .OwnForkRepoTags }}
<div class="item" data-url=" {{ $ .OwnForkRepo .Link }} /compare/ {{ EscapePound . }} ... {{ $ .HeadUser .Name }} / {{ $ .HeadRepo .Name }} : {{ EscapePound $ .HeadBranch }} "> {{ $ OwnForkCompareName }} : {{ . }} </div>
{{ end }}
{{ end }}
{{ if .RootRepo }}
{{ range .RootRepoTags }}
<div class="item" data-url=" {{ $ .RootRepo .Link }} /compare/ {{ EscapePound . }} ... {{ $ .HeadUser .Name }} / {{ $ .HeadRepo .Name }} : {{ EscapePound $ .HeadBranch }} "> {{ $ RootRepoCompareName }} : {{ . }} </div>
{{ end }}
{{ end }}
</div>
</div>
</div>
</div>
...
</div>
<div class="ui floating filter dropdown">
...
<div class="ui basic small button">
<div class="ui floating filter dropdown">
<span class="text"> {{ .i18n .Tr "repo.pulls.compare_compare" }} : {{ $ HeadCompareName }} : {{ $ .HeadBranch }} </span>
<div class="ui basic small button">
{{ svg "octicon-triangle-down" 1 4 "dropdown icon" }}
<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" 1 4 "dropdown icon" }}
</div>
<div class="menu">
<div class="ui icon search input">
<i class="icon df ac jc m-0"> {{ svg "octicon-filter" 1 6 }} </i>
<input name="search" placeholder=" {{ .i18n .Tr "repo.filter_branch_and_tag" }} ...">
</div>
</div>
<div class="menu">
<div class="header">
<div class="ui icon search input">
<div class="ui grid">
<i class="icon df ac jc m-0"> {{ svg "octicon-filter" 1 6 }} </i>
<div class="two column row">
<input name="search" placeholder=" {{ .i18n .Tr "repo.pulls.filter_branch" }} ...">
<a class="reference column" href="#" data-target=".head-branch-list">
<span class="text black">
{{ svg "octicon-git-branch" 1 6 "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" 1 6 "mr-2" }} {{ .i18n .Tr "repo.tags" }}
</span>
</a>
</div>
</div>
</div>
<div class="scrolling menu">
</div>
{{ range .HeadBranches }}
<div class="scrolling menu reference-list-menu head-branch-list">
<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>
{{ range .HeadBranches }}
<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>
{{ end }}
{{ if not .PullRequestCtx .SameRepo }}
{{ range .Branches }}
<div class="item" data-url=" {{ $ .RepoLink }} /compare/ {{ EscapePound $ .BaseBranch }} ... {{ $ .BaseName }} / {{ $ .Repository .Name }} : {{ EscapePound . }} "> {{ $ BaseCompareName }} : {{ . }} </div>
{{ end }}
{{ end }}
{{ if not .PullRequestCtx .SameRepo }}
{{ end }}
{{ range .Branches }}
{{ if .OwnForkRepo }}
<div class="item" data-url=" {{ $ .RepoLink }} /compare/ {{ EscapePound $ .BaseBranch }} ... {{ $ .BaseName }} / {{ $ .Repository .Name }} : {{ EscapePound . }} "> {{ $ BaseCompareName }} : {{ . }} </div>
{{ range .OwnForkRepoBranches }}
{{ end }}
<div class="item" data-url=" {{ $ .R epoLink }} /compare/ {{ EscapePou nd $ .BaseBranch }} ... {{ $ .OwnForkRepo .OwnerName }} / {{ $ .OwnForkRepo .Name }} : {{ EscapePound . }} "> {{ $ OwnForkCompareName }} : {{ . }} </div>
{{ end }}
{{ end }}
{{ if .OwnForkRepo }}
{{ end }}
{{ range .OwnForkRepoBranches }}
{{ if .RootRepo }}
<div class="item" data-url=" {{ $ .RepoLink }} /compare/ {{ EscapePound $ .BaseBranch }} ... {{ $ .OwnForkRepo .OwnerName }} / {{ $ .OwnForkRepo .Name }} : {{ EscapePound . }} "> {{ $ OwnForkCompareName }} : {{ . }} </div>
{{ range .RootRepoBranches }}
{{ end }}
<div class="item" data-url=" {{ $ .R epoLink }} /compare/ {{ EscapePou nd $ .BaseBranch }} ... {{ $ .RootRepo .OwnerName }} / {{ $ .RootRepo .Name }} : {{ EscapePound . }} "> {{ $ RootRepoCompareName }} : {{ . }} </div>
{{ end }}
{{ end }}
{{ if .RootRepo }}
{{ end }}
{{ range .RootRepoBranches }}
</div>
<div class="item" data-url=" {{ $ .RepoLink }} /compare/ {{ EscapePound $ .BaseBranch }} ... {{ $ .RootRepo .OwnerName }} / {{ $ .RootRepo .Name }} : {{ EscapePound . }} "> {{ $ RootRepoCompareName }} : {{ . }} </div>
<div class="scrolling menu reference-list-menu head-tag-list" style="display: none">
{{ end }}
{{ range .HeadTags }}
<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>
{{ end }}
{{ if not .PullRequestCtx .SameRepo }}
{{ range .Tags }}
<div class="item" data-url=" {{ $ .RepoLink }} /compare/ {{ EscapePound $ .BaseBranch }} ... {{ $ .BaseName }} / {{ $ .Repository .Name }} : {{ EscapePound . }} "> {{ $ BaseCompareName }} : {{ . }} </div>
{{ end }}
{{ end }}
</div>
{{ end }}
{{ if .OwnForkRepo }}
{{ range .OwnForkRepoTags }}
<div class="item" data-url=" {{ $ .RepoLink }} /compare/ {{ EscapePound $ .BaseBranch }} ... {{ $ .OwnForkRepo .OwnerName }} / {{ $ .OwnForkRepo .Name }} : {{ EscapePound . }} "> {{ $ OwnForkCompareName }} : {{ . }} </div>
{{ end }}
{{ end }}
{{ if .RootRepo }}
{{ range .RootRepoTags }}
<div class="item" data-url=" {{ $ .RepoLink }} /compare/ {{ EscapePound $ .BaseBranch }} ... {{ $ .RootRepo .OwnerName }} / {{ $ .RootRepo .Name }} : {{ EscapePound . }} "> {{ $ RootRepoCompareName }} : {{ . }} </div>
{{ end }}
{{ end }}
</div>
</div>
</div>
</div>
</div>
</div>
{{ end }}
</div>
{{ if .IsNothingToCompare }}
{{ if .IsNothingToCompare }}
{{ if and $ .IsSigned $ .AllowEmptyPr ( not .Repository .IsArchived ) }}
{{ if and $ .IsSigned $ .AllowEmptyPr ( not .Repository .IsArchived ) }}