Skip to content

Commit

Permalink
remove CanForkRepo
Browse files Browse the repository at this point in the history
  • Loading branch information
yp05327 committed Feb 20, 2023
1 parent 6840a8c commit ba9bb15
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions routers/web/repo/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,7 @@ func getForkRepository(ctx *context.Context) *repo_model.Repository {
func Fork(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("new_fork")

if ctx.Doer.CanForkRepo() {
ctx.Data["CanForkRepo"] = true
} else {
if !ctx.Doer.CanForkRepo() {
maxCreationLimit := ctx.Doer.MaxCreationLimit()
msg := ctx.TrN(maxCreationLimit, "repo.form.reach_limit_of_creation_1", "repo.form.reach_limit_of_creation_n", maxCreationLimit)
ctx.Data["Flash"] = ctx.Flash
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/pulls/fork.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

<div class="inline field">
<label></label>
<button class="ui green button{{if not .CanForkRepo}} disabled{{end}}">
<button class="ui green button">
{{.locale.Tr "repo.fork_repo"}}
</button>
</div>
Expand Down

0 comments on commit ba9bb15

Please sign in to comment.