|
16 | 16 | {{svg "octicon-git-compare"}}
|
17 | 17 | <div class="ui floating filter dropdown" data-no-results="{{.i18n.Tr "repo.pulls.no_results"}}">
|
18 | 18 | <div class="ui basic small button">
|
19 |
| - <span class="text">{{.i18n.Tr "repo.pulls.compare_base"}}: {{$.BaseName}}:{{$.BaseBranch}}</span> |
| 19 | + <span class="text">{{.i18n.Tr "repo.pulls.compare_base"}}: <span class="branch-name base" |
| 20 | + data-base-url="{{$.RepoLink}}/compare/" |
| 21 | + data-base-branchname="{{$.BaseName}}:{{$.BaseBranch}}"> |
| 22 | + {{$.BaseName}}:{{$.BaseBranch}} |
| 23 | + </span> |
| 24 | + </span> |
20 | 25 | {{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
21 | 26 | </div>
|
22 | 27 | <div class="menu">
|
|
26 | 31 | </div>
|
27 | 32 | <div class="scrolling menu">
|
28 | 33 | {{range .Branches}}
|
29 |
| - <div class="item {{if eq $.BaseBranch .}}selected{{end}}" data-url="{{$.RepoLink}}/compare/{{EscapePound .}}...{{if not $.PullRequestCtx.SameRepo}}{{$.HeadUser.Name}}/{{$.HeadRepo.Name}}:{{end}}{{EscapePound $.HeadBranch}}">{{$.BaseName}}:{{.}}</div> |
| 34 | + <div class="item {{if eq $.BaseBranch .}}selected{{end}}" |
| 35 | + data-base-url="{{$.RepoLink}}/compare/" |
| 36 | + data-base-branchname="{{EscapePound .}}" |
| 37 | + > |
| 38 | + {{$.BaseName}}:{{.}} |
| 39 | + </div> |
30 | 40 | {{end}}
|
31 | 41 | {{if not .PullRequestCtx.SameRepo}}
|
32 | 42 | {{range .HeadBranches}}
|
33 |
| - <div class="item" data-url="{{$.HeadRepo.Link}}/compare/{{EscapePound .}}...{{$.HeadUser.Name}}/{{$.HeadRepo.Name}}:{{EscapePound $.HeadBranch}}">{{$.HeadUser.Name}}:{{.}}</div> |
| 43 | + <div class="item" |
| 44 | + data-base-url="{{$.HeadRepo.Link}}/compare/" |
| 45 | + data-base-branchname="{{EscapePound .}}"> |
| 46 | + {{$.HeadUser.Name}}:{{.}} |
| 47 | + </div> |
34 | 48 | {{end}}
|
35 | 49 | {{end}}
|
36 | 50 | {{if .OwnForkRepo}}
|
37 | 51 | {{range .OwnForkRepoBranches}}
|
38 |
| - <div class="item" data-url="{{$.OwnForkRepo.Link}}/compare/{{EscapePound .}}...{{$.HeadUser.Name}}/{{$.HeadRepo.Name}}:{{EscapePound $.HeadBranch}}">{{$.OwnForkRepo.OwnerName}}:{{.}}</div> |
| 52 | + <div class="item" |
| 53 | + data-base-url="{{$.OwnForkRepo.Link}}/compare/" |
| 54 | + data-base-branchname="{{EscapePound .}}"> |
| 55 | + {{$.OwnForkRepo.OwnerName}}:{{.}} |
| 56 | + </div> |
39 | 57 | {{end}}
|
40 | 58 | {{end}}
|
41 | 59 | {{if .RootRepo}}
|
42 | 60 | {{range .RootRepoBranches}}
|
43 |
| - <div class="item" data-url="{{$.RootRepo.Link}}/compare/{{EscapePound .}}...{{$.HeadUser.Name}}/{{$.HeadRepo.Name}}:{{EscapePound $.HeadBranch}}">{{$.RootRepo.OwnerName}}:{{.}}</div> |
| 61 | + <div class="item" |
| 62 | + data-base-url="{$.RootRepo.Link}}/compare/" |
| 63 | + data-base-branchname="{{EscapePound .}}"> |
| 64 | + {{$.RootRepo.OwnerName}}:{{.}} |
| 65 | + </div> |
44 | 66 | {{end}}
|
45 | 67 | {{end}}
|
46 | 68 | </div>
|
|
49 | 71 | ...
|
50 | 72 | <div class="ui floating filter dropdown">
|
51 | 73 | <div class="ui basic small button">
|
52 |
| - <span class="text">{{.i18n.Tr "repo.pulls.compare_compare"}}: {{$.HeadUser.Name}}:{{$.HeadBranch}}</span> |
| 74 | + <span class="text">{{.i18n.Tr "repo.pulls.compare_compare"}}: <span class="branch-name head" |
| 75 | + data-head-branchname="{{if not $.PullRequestCtx.SameRepo}}{{$.HeadUser.Name}}/{{$.HeadRepo.Name}}:{{end}}{{EscapePound $.HeadBranch}}" |
| 76 | + >{{$.HeadUser.Name}}:{{$.HeadBranch}}</span></span> |
53 | 77 | {{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
54 | 78 | </div>
|
55 | 79 | <div class="menu">
|
|
59 | 83 | </div>
|
60 | 84 | <div class="scrolling menu">
|
61 | 85 | {{range .HeadBranches}}
|
62 |
| - <div class="{{if eq $.HeadBranch .}}selected{{end}} item" data-url="{{$.RepoLink}}/compare/{{EscapePound $.BaseBranch}}...{{if not $.PullRequestCtx.SameRepo}}{{$.HeadUser.Name}}/{{$.HeadRepo.Name}}:{{end}}{{EscapePound .}}">{{$.HeadUser.Name}}:{{.}}</div> |
| 86 | + <div |
| 87 | + class="{{if eq $.HeadBranch .}}selected{{end}} item" |
| 88 | + data-head-branchname="{{if not $.PullRequestCtx.SameRepo}}{{$.HeadUser.Name}}/{{$.HeadRepo.Name}}:{{end}}{{EscapePound .}}" |
| 89 | + > |
| 90 | + {{$.HeadUser.Name}}:{{.}} |
| 91 | + </div> |
63 | 92 | {{end}}
|
64 | 93 | {{if not .PullRequestCtx.SameRepo}}
|
65 | 94 | {{range .Branches}}
|
66 |
| - <div class="item" data-url="{{$.RepoLink}}/compare/{{EscapePound $.BaseBranch}}...{{$.BaseName}}/{{$.Repository.Name}}:{{EscapePound .}}">{{$.BaseName}}:{{.}}</div> |
| 95 | + <div class="item" |
| 96 | + data-head-branchname="{{$.BaseName}}/{{$.Repository.Name}}:{{EscapePound .}}" |
| 97 | + >{{$.BaseName}}:{{.}}</div> |
67 | 98 | {{end}}
|
68 | 99 | {{end}}
|
69 | 100 | {{if .OwnForkRepo}}
|
70 | 101 | {{range .OwnForkRepoBranches}}
|
71 |
| - <div class="item" data-url="{{$.RepoLink}}/compare/{{EscapePound $.BaseBranch}}...{{$.OwnForkRepo.OwnerName}}/{{$.OwnForkRepo.Name}}:{{EscapePound .}}">{{$.OwnForkRepo.OwnerName}}:{{.}}</div> |
| 102 | + <div class="item" |
| 103 | + data-head-branchname="{{$.OwnForkRepo.OwnerName}}/{{$.OwnForkRepo.Name}}:{{EscapePound .}}" |
| 104 | + >{{$.OwnForkRepo.OwnerName}}:{{.}}</div> |
72 | 105 | {{end}}
|
73 | 106 | {{end}}
|
74 | 107 | {{if .RootRepo}}
|
75 | 108 | {{range .RootRepoBranches}}
|
76 |
| - <div class="item" data-url="{{$.RepoLink}}/compare/{{EscapePound $.BaseBranch}}...{{$.RootRepo.OwnerName}}/{{$.RootRepo.Name}}:{{EscapePound .}}">{{$.RootRepo.OwnerName}}:{{.}}</div> |
| 109 | + <div class="item" |
| 110 | + data-head-branchname="{{$.RootRepo.OwnerName}}/{{$.RootRepo.Name}}:{{EscapePound .}}" |
| 111 | + >{{$.RootRepo.OwnerName}}:{{.}}</div> |
77 | 112 | {{end}}
|
78 | 113 | {{end}}
|
79 | 114 | </div>
|
80 | 115 | </div>
|
81 | 116 | </div>
|
| 117 | + <a id="compare-calc-changes"> |
| 118 | + <button id="compare-calc-changes-btn" class="ui green button disabled">{{.i18n.Tr "repo.pulls.calculate_changes"}}</button> |
| 119 | + </a> |
82 | 120 | </div>
|
83 | 121 | {{end}}
|
84 | 122 |
|
85 |
| - {{if .IsNothingToCompare}} |
86 |
| - <div class="ui segment">{{.i18n.Tr "repo.pulls.nothing_to_compare"}}</div> |
87 |
| - {{else if and .PageIsComparePull (gt .CommitCount 0)}} |
88 |
| - {{if .HasPullRequest}} |
89 |
| - <div class="ui segment"> |
90 |
| - {{.i18n.Tr "repo.pulls.has_pull_request" $.RepoLink $.RepoRelPath .PullRequest.Index | Safe}} |
91 |
| - </div> |
92 |
| - {{else}} |
93 |
| - {{if and $.IsSigned (not .Repository.IsArchived)}} |
94 |
| - <div class="ui info message show-form-container"> |
95 |
| - <button class="ui button green show-form">{{.i18n.Tr "repo.pulls.new"}}</button> |
96 |
| - </div> |
97 |
| - {{else if .Repository.IsArchived}} |
98 |
| - <div class="ui warning message"> |
99 |
| - {{.i18n.Tr "repo.archive.title"}} |
100 |
| - </div> |
101 |
| - {{end}} |
102 |
| - {{if $.IsSigned}} |
103 |
| - <div class="pullrequest-form" style="display: none"> |
104 |
| - {{template "repo/issue/new_form" .}} |
| 123 | + <div class="ui segment" id="info-calculate-changes-needed" style="display:none;">{{.i18n.Tr "repo.pulls.click_calc_changes_to_see_diff"}}</div> |
| 124 | + <div id="compare-contents-area"> |
| 125 | + {{if .IsNothingToCompare}} |
| 126 | + <div class="ui segment">{{.i18n.Tr "repo.pulls.nothing_to_compare"}}</div> |
| 127 | + {{else if and .PageIsComparePull (gt .CommitCount 0)}} |
| 128 | + {{if .HasPullRequest}} |
| 129 | + <div class="ui segment"> |
| 130 | + {{.i18n.Tr "repo.pulls.has_pull_request" $.RepoLink $.RepoRelPath .PullRequest.Index | Safe}} |
105 | 131 | </div>
|
| 132 | + {{else}} |
| 133 | + {{if and $.IsSigned (not .Repository.IsArchived)}} |
| 134 | + <div class="ui info message show-form-container"> |
| 135 | + <button class="ui button green show-form">{{.i18n.Tr "repo.pulls.new"}}</button> |
| 136 | + </div> |
| 137 | + {{else if .Repository.IsArchived}} |
| 138 | + <div class="ui warning message"> |
| 139 | + {{.i18n.Tr "repo.archive.title"}} |
| 140 | + </div> |
| 141 | + {{end}} |
| 142 | + {{if $.IsSigned}} |
| 143 | + <div class="pullrequest-form" style="display: none"> |
| 144 | + {{template "repo/issue/new_form" .}} |
| 145 | + </div> |
| 146 | + {{end}} |
| 147 | + {{template "repo/commits_table" .}} |
| 148 | + {{template "repo/diff/box" .}} |
106 | 149 | {{end}}
|
| 150 | + {{else}} |
107 | 151 | {{template "repo/commits_table" .}}
|
108 | 152 | {{template "repo/diff/box" .}}
|
109 | 153 | {{end}}
|
110 |
| - {{else}} |
111 |
| - {{template "repo/commits_table" .}} |
112 |
| - {{template "repo/diff/box" .}} |
113 |
| - {{end}} |
| 154 | + </div> |
114 | 155 | </div>
|
115 | 156 | </div>
|
116 | 157 | {{template "base/footer" .}}
|
0 commit comments