diff options
author | 6543 <24977596+6543@users.noreply.github.com> | 2019-08-26 12:47:41 +0200 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2019-08-26 13:47:41 +0300 |
commit | 5409dec8fd29dfb7fcd7c0afb8a2d9682abc48b1 (patch) | |
tree | ccf3cd85cc243af211cf6f7c9a3f49d9d04630e2 /templates/repo | |
parent | c9546d4cdd5f7de8f56b7d4a9806d1aca784cf3f (diff) | |
download | gitea-5409dec8fd29dfb7fcd7c0afb8a2d9682abc48b1.tar.gz gitea-5409dec8fd29dfb7fcd7c0afb8a2d9682abc48b1.zip |
[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 :)
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/branch/list.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/graph.tmpl | 5 |
2 files changed, 1 insertions, 6 deletions
diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index 370e323960..9c53f4e67a 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -75,7 +75,7 @@ </td> <td class="two wide right aligned"> {{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}}"> <button id="new-pull-request" class="ui compact basic button">{{$.i18n.Tr "repo.pulls.compare_changes"}}</button> </a> diff --git a/templates/repo/graph.tmpl b/templates/repo/graph.tmpl index 14fbfac6d7..2e8d0b5d91 100644 --- a/templates/repo/graph.tmpl +++ b/templates/repo/graph.tmpl @@ -2,8 +2,6 @@ <div class="repository commits"> {{template "repo/header" .}} <div class="ui container"> - - <div id="git-graph-container" class="ui segment"> <h1>{{.i18n.Tr "repo.commit_graph"}}</h1> <div id="rel-container"> @@ -37,9 +35,6 @@ </ul> </div> </div> - - - </div> </div> {{template "base/footer" .}} |