Skip to content

Commit 2a5a88c

Browse files
committed
fix
1 parent ac470c2 commit 2a5a88c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

routers/web/repo/pull.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@ func getForkRepository(ctx *context.Context) *repo_model.Repository {
182182
func Fork(ctx *context.Context) {
183183
ctx.Data["Title"] = ctx.Tr("new_fork")
184184

185-
if !ctx.Doer.CanForkRepo() {
185+
if ctx.Doer.CanForkRepo() {
186+
ctx.Data["CanForkRepo"] = true
187+
} else {
186188
maxCreationLimit := ctx.Doer.MaxCreationLimit()
187189
msg := ctx.TrN(maxCreationLimit, "repo.form.reach_limit_of_creation_1", "repo.form.reach_limit_of_creation_n", maxCreationLimit)
188190
ctx.Data["Flash"] = ctx.Flash
@@ -201,6 +203,7 @@ func Fork(ctx *context.Context) {
201203
func ForkPost(ctx *context.Context) {
202204
form := web.GetForm(ctx).(*forms.CreateRepoForm)
203205
ctx.Data["Title"] = ctx.Tr("new_fork")
206+
ctx.Data["CanForkRepo"] = true
204207

205208
ctxUser := checkContextUser(ctx, form.UID)
206209
if ctx.Written() {

templates/repo/pulls/fork.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858

5959
<div class="inline field">
6060
<label></label>
61-
<button class="ui green button">
61+
<button class="ui green button{{if not .CanForkRepo}} disabled{{end}}">
6262
{{.locale.Tr "repo.fork_repo"}}
6363
</button>
6464
</div>

0 commit comments

Comments
 (0)