Skip to content

Commit 607f6b4

Browse files
committed
remove DisableImportLocal
1 parent 9d6c029 commit 607f6b4

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

modules/templates/helper.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,6 @@ func NewFuncMap() template.FuncMap {
134134
"DisableWebhooks": func() bool {
135135
return setting.DisableWebhooks
136136
},
137-
"DisableImportLocal": func() bool {
138-
return !setting.ImportLocalPaths
139-
},
140137
"UserThemeName": userThemeName,
141138
"NotificationSettings": func() map[string]any {
142139
return map[string]any{

routers/web/admin/users.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ func editUserCommon(ctx *context.Context) {
314314
ctx.Data["DisableRegularOrgCreation"] = setting.Admin.DisableRegularOrgCreation
315315
ctx.Data["DisableMigrations"] = setting.Repository.DisableMigrations
316316
ctx.Data["DisableGitHooks"] = setting.DisableGitHooks
317+
ctx.Data["DisableImportLocal"] = !setting.ImportLocalPaths
317318
ctx.Data["AllowedUserVisibilityModes"] = setting.Service.AllowedUserVisibilityModesSlice.ToVisibleTypeSlice()
318319
ctx.Data["DisableGravatar"] = setting.Config().Picture.DisableGravatar.Value(ctx)
319320
}

templates/admin/user/edit.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@
134134
<input name="allow_git_hook" type="checkbox" {{if .User.CanEditGitHook}}checked{{end}} {{if .DisableGitHooks}}disabled{{end}}>
135135
</div>
136136
</div>
137-
<div class="inline field {{if or (DisableImportLocal) (.DisableMigrations)}}tw-hidden{{end}}">
137+
<div class="inline field {{if or (.DisableImportLocal) (.DisableMigrations)}}tw-hidden{{end}}">
138138
<div class="ui checkbox">
139139
<label><strong>{{ctx.Locale.Tr "admin.users.allow_import_local"}}</strong></label>
140-
<input name="allow_import_local" type="checkbox" {{if .User.CanImportLocal}}checked{{end}} {{if DisableImportLocal}}disabled{{end}}>
140+
<input name="allow_import_local" type="checkbox" {{if .User.CanImportLocal}}checked{{end}} {{if .DisableImportLocal}}disabled{{end}}>
141141
</div>
142142
</div>
143143
{{if not .DisableRegularOrgCreation}}

0 commit comments

Comments
 (0)