diff options
author | Wiktor Żurawik <wiktor.zurawik@gmail.com> | 2017-07-15 05:14:02 +0200 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-07-15 11:14:02 +0800 |
commit | 32f289ae3b88f0a33723fe51b808d1633cd6716a (patch) | |
tree | 16b2fcf782e94d922258ea038152dfa26e4fabcc /templates | |
parent | 98c5a1e0068fe604b30e5654e556a7db9d569f04 (diff) | |
download | gitea-32f289ae3b88f0a33723fe51b808d1633cd6716a.tar.gz gitea-32f289ae3b88f0a33723fe51b808d1633cd6716a.zip |
Make compare button URL aware if current repo is a fork (#2162) (#2163)
* Make compare button URL aware if current repo is a fork (#2162)
* Optimize code
* To not change current behaviour check if signed in user has fork of base repository
* Fix to check only if signed user has forked repo otherwise it will still redirect to wrong page
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/home.tmpl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index a87e6b7588..664326c562 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -10,7 +10,7 @@ <div class="ui secondary menu"> {{if .PullRequestCtx.Allowed}} <div class="fitted item"> - <a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch}}...{{.SignedUser.Name}}:{{.BranchName}}"> + <a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch}}...{{if .SignedUser.HasForkedRepo .BaseRepo.ID }}{{.SignedUser.Name}}:{{end}}{{.BranchName}}"> <button class="ui green small button"><i class="octicon octicon-git-compare"></i></button> </a> </div> |