Skip to content

Commit ba9bb15

Browse files
committed
remove CanForkRepo
1 parent 6840a8c commit ba9bb15

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

routers/web/repo/pull.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,7 @@ 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() {
186-
ctx.Data["CanForkRepo"] = true
187-
} else {
185+
if !ctx.Doer.CanForkRepo() {
188186
maxCreationLimit := ctx.Doer.MaxCreationLimit()
189187
msg := ctx.TrN(maxCreationLimit, "repo.form.reach_limit_of_creation_1", "repo.form.reach_limit_of_creation_n", maxCreationLimit)
190188
ctx.Data["Flash"] = ctx.Flash

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{{if not .CanForkRepo}} disabled{{end}}">
61+
<button class="ui green button">
6262
{{.locale.Tr "repo.fork_repo"}}
6363
</button>
6464
</div>

0 commit comments

Comments
 (0)