]> source.dussan.org Git - gitea.git/commitdiff
fix click create pull request button 404 (#2859)
authorLunny Xiao <xiaolunwen@gmail.com>
Sun, 5 Nov 2017 19:11:35 +0000 (03:11 +0800)
committerLauris BH <lauris@nix.lv>
Sun, 5 Nov 2017 19:11:35 +0000 (21:11 +0200)
modules/context/repo.go
templates/repo/home.tmpl

index c61010ecbad243a057cafdcafcaa110af0d82b66..883a826e4449da8c5d88b415345c4a166f8b2293 100644 (file)
@@ -424,6 +424,7 @@ func RepoAssignment() macaron.Handler {
                                return
                        }
                }
+               ctx.Data["IsForkedRepo"] = repo.IsFork
 
                // People who have push access or have forked repository can propose a new pull request.
                if ctx.Repo.IsWriter() || (ctx.IsSigned && ctx.User.HasForkedRepo(ctx.Repo.Repository.ID)) {
index c7c88aafccc2cd20b6b571277fc723bb08d485d4..0db8f37320a0a51f94ec25836774d4623615c414 100644 (file)
@@ -27,7 +27,7 @@
                <div class="ui secondary menu">
                        {{if .PullRequestCtx.Allowed}}
                                <div class="fitted item">
-                                       <a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch}}...{{if .SignedUser.HasForkedRepo .BaseRepo.ID }}{{.SignedUser.Name}}:{{end}}{{.BranchName}}">
+                                       <a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch}}...{{if .IsForkedRepo}}{{.Repository.Owner.Name}}:{{else}}{{if .SignedUser.HasForkedRepo .BaseRepo.ID}}{{.SignedUser.Name}}:{{end}}{{end}}{{.BranchName}}">
                                                <button class="ui green tiny compact button"><i class="octicon octicon-git-compare"></i></button>
                                        </a>
                                </div>