]> source.dussan.org Git - gitea.git/commitdiff
resolved #310: hide fork to self (#323)
authorLunny Xiao <xiaolunwen@gmail.com>
Thu, 1 Dec 2016 10:51:50 +0000 (18:51 +0800)
committerGitHub <noreply@github.com>
Thu, 1 Dec 2016 10:51:50 +0000 (18:51 +0800)
routers/repo/pull.go
templates/repo/pulls/fork.tmpl

index 389fcb089816c2abb5946aa8712d855eda00e362..5e51fda4951d9ebda832d1c3eadf26c7f8c84bb0 100644 (file)
@@ -62,6 +62,7 @@ func getForkRepository(ctx *context.Context) *models.Repository {
                return nil
        }
        ctx.Data["ForkFrom"] = forkRepo.Owner.Name + "/" + forkRepo.Name
+       ctx.Data["ForkFromOwnerID"] = forkRepo.Owner.ID
 
        if err := ctx.User.GetOrganizations(true); err != nil {
                ctx.Handle(500, "GetOrganizations", err)
index 431f6df236fc7ee4d41249c601a06727bfb76ac3..133cc92f7cb08de611ce4144f9b225e646810761 100644 (file)
@@ -24,7 +24,7 @@
                                                                        {{.SignedUser.ShortName 20}}
                                                                </div>
                                                                {{range .Orgs}}
-                                                                       {{if .IsOwnedBy $.SignedUser.ID}}
+                                                                       {{if and (.IsOwnedBy $.SignedUser.ID) (ne .ID $.ForkFromOwnerID)}}
                                                                                <div class="item" data-value="{{.ID}}">
                                                                                        <img class="ui mini image" src="{{.RelAvatarLink}}">
                                                                                        {{.ShortName 20}}