@@ -91,12 +91,17 @@ func getForkRepository(ctx *context.Context) *repo_model.Repository {
9191 ctx .Data ["CanForkToUser" ] = canForkToUser
9292 ctx .Data ["Orgs" ] = orgs
9393
94+ // TODO: this message should only be shown for the "current doer" when it is selected, just like the "new repo" page.
95+ // msg := ctx.TrN(maxCreationLimit, "repo.form.reach_limit_of_creation_1", "repo.form.reach_limit_of_creation_n", ctx.Doer.MaxCreationLimit())
96+
9497 if canForkToUser {
9598 ctx .Data ["ContextUser" ] = ctx .Doer
99+ ctx .Data ["CanForkRepoInNewOwner" ] = true
96100 } else if len (orgs ) > 0 {
97101 ctx .Data ["ContextUser" ] = orgs [0 ]
102+ ctx .Data ["CanForkRepoInNewOwner" ] = true
98103 } else {
99- ctx .Data ["CanForkRepoInDoer " ] = false
104+ ctx .Data ["CanForkRepoInNewOwner " ] = false
100105 ctx .Flash .Error (ctx .Tr ("repo.fork_no_valid_owners" ), true )
101106 return nil
102107 }
@@ -120,15 +125,6 @@ func getForkRepository(ctx *context.Context) *repo_model.Repository {
120125// Fork render repository fork page
121126func Fork (ctx * context.Context ) {
122127 ctx .Data ["Title" ] = ctx .Tr ("new_fork" )
123-
124- if ctx .Doer .CanForkRepoIn (ctx .Doer ) {
125- ctx .Data ["CanForkRepoInDoer" ] = true
126- } else {
127- maxCreationLimit := ctx .Doer .MaxCreationLimit ()
128- msg := ctx .TrN (maxCreationLimit , "repo.form.reach_limit_of_creation_1" , "repo.form.reach_limit_of_creation_n" , maxCreationLimit )
129- ctx .Flash .Error (msg , true )
130- }
131-
132128 getForkRepository (ctx )
133129 if ctx .Written () {
134130 return
@@ -141,7 +137,6 @@ func Fork(ctx *context.Context) {
141137func ForkPost (ctx * context.Context ) {
142138 form := web .GetForm (ctx ).(* forms.CreateRepoForm )
143139 ctx .Data ["Title" ] = ctx .Tr ("new_fork" )
144- ctx .Data ["CanForkRepoInDoer" ] = true
145140
146141 ctxUser := checkContextUser (ctx , form .UID )
147142 if ctx .Written () {
0 commit comments