Browse Source

Disable 'May Import Local Repository' when is disabled by setting (Issue #4779) (#4780)

for-closed-social
EnricoFerro 5 years ago
committed by techknowlogick
parent
commit
0a24f5cac8
2 changed files with 4 additions and 1 deletions
  1. +3
    -0
      modules/templates/helper.go
  2. +1
    -1
      templates/admin/user/edit.tmpl

+ 3
- 0
modules/templates/helper.go View File

@ -165,6 +165,9 @@ func NewFuncMap() []template.FuncMap {
"DisableGitHooks": func() bool {
return setting.DisableGitHooks
},
"DisableImportLocal": func() bool {
return !setting.ImportLocalPaths
},
"TrN": TrN,
"Dict": func(values ...interface{}) (map[string]interface{}, error) {
if len(values)%2 != 0 {

+ 1
- 1
templates/admin/user/edit.tmpl View File

@ -92,7 +92,7 @@
<div class="inline field">
<div class="ui checkbox">
<label><strong>{{.i18n.Tr "admin.users.allow_import_local"}}</strong></label>
<input name="allow_import_local" type="checkbox" {{if .User.CanImportLocal}}checked{{end}}>
<input name="allow_import_local" type="checkbox" {{if .User.CanImportLocal}}checked{{end}} {{if DisableImportLocal}}disabled{{end}}>
</div>
</div>
{{if not .DisableRegularOrgCreation}}

Loading…
Cancel
Save