[Branch View] show "New Pull Request" Button only if posible (#7977)

* add check Commits Ahead is gt 0

* code format
to start drone-ci test again
and formate code is also nice :)
tokarchuk/v1.17
6543 5 years ago committed by Lauris BH
parent c9546d4cdd
commit 5409dec8fd
  1. 2
      templates/repo/branch/list.tmpl
  2. 5
      templates/repo/graph.tmpl

@ -75,7 +75,7 @@
</td> </td>
<td class="two wide right aligned"> <td class="two wide right aligned">
{{if not .LatestPullRequest}} {{if not .LatestPullRequest}}
{{if and (not .IsDeleted) $.AllowsPulls}} {{if and (not .IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}}
<a href="{{$.RepoLink}}/compare/{{$.DefaultBranch | EscapePound}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{$.Owner.Name}}:{{end}}{{.Name | EscapePound}}"> <a href="{{$.RepoLink}}/compare/{{$.DefaultBranch | EscapePound}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{$.Owner.Name}}:{{end}}{{.Name | EscapePound}}">
<button id="new-pull-request" class="ui compact basic button">{{$.i18n.Tr "repo.pulls.compare_changes"}}</button> <button id="new-pull-request" class="ui compact basic button">{{$.i18n.Tr "repo.pulls.compare_changes"}}</button>
</a> </a>

@ -2,8 +2,6 @@
<div class="repository commits"> <div class="repository commits">
{{template "repo/header" .}} {{template "repo/header" .}}
<div class="ui container"> <div class="ui container">
<div id="git-graph-container" class="ui segment"> <div id="git-graph-container" class="ui segment">
<h1>{{.i18n.Tr "repo.commit_graph"}}</h1> <h1>{{.i18n.Tr "repo.commit_graph"}}</h1>
<div id="rel-container"> <div id="rel-container">
@ -37,9 +35,6 @@
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
{{template "base/footer" .}} {{template "base/footer" .}}

Loading…
Cancel
Save