Browse Source

resolved #310: hide fork to self (#323)

tags/v1.2.0-rc1
Lunny Xiao GitHub 9 years ago
parent
commit
939dfe8263
2 changed files with 2 additions and 1 deletions
  1. +1
    -0
      routers/repo/pull.go
  2. +1
    -1
      templates/repo/pulls/fork.tmpl

+ 1
- 0
routers/repo/pull.go View File

@@ -62,6 +62,7 @@ func getForkRepository(ctx *context.Context) *models.Repository {
return nil return nil
} }
ctx.Data["ForkFrom"] = forkRepo.Owner.Name + "/" + forkRepo.Name ctx.Data["ForkFrom"] = forkRepo.Owner.Name + "/" + forkRepo.Name
ctx.Data["ForkFromOwnerID"] = forkRepo.Owner.ID


if err := ctx.User.GetOrganizations(true); err != nil { if err := ctx.User.GetOrganizations(true); err != nil {
ctx.Handle(500, "GetOrganizations", err) ctx.Handle(500, "GetOrganizations", err)


+ 1
- 1
templates/repo/pulls/fork.tmpl View File

@@ -24,7 +24,7 @@
{{.SignedUser.ShortName 20}} {{.SignedUser.ShortName 20}}
</div> </div>
{{range .Orgs}} {{range .Orgs}}
{{if .IsOwnedBy $.SignedUser.ID}}
{{if and (.IsOwnedBy $.SignedUser.ID) (ne .ID $.ForkFromOwnerID)}}
<div class="item" data-value="{{.ID}}"> <div class="item" data-value="{{.ID}}">
<img class="ui mini image" src="{{.RelAvatarLink}}"> <img class="ui mini image" src="{{.RelAvatarLink}}">
{{.ShortName 20}} {{.ShortName 20}}


Loading…
Cancel
Save