aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-10-05 09:08:19 +0800
committerGitHub <noreply@github.com>2023-10-05 09:08:19 +0800
commit9f8d59858af581a2c278a4896a301339991ece5b (patch)
tree577a395a442ccd9579dfd2726750301e6a934ef3 /templates
parent976d1760ac483a6f5fa8fa5ad24d94cae58497eb (diff)
downloadgitea-9f8d59858af581a2c278a4896a301339991ece5b.tar.gz
gitea-9f8d59858af581a2c278a4896a301339991ece5b.zip
Refactor system setting (#27000)
This PR reduces the complexity of the system setting system. It only needs one line to introduce a new option, and the option can be used anywhere out-of-box. It is still high-performant (and more performant) because the config values are cached in the config system.
Diffstat (limited to 'templates')
-rw-r--r--templates/admin/config.tmpl8
1 files changed, 4 insertions, 4 deletions
diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl
index 57722f9898..7eb9d086e6 100644
--- a/templates/admin/config.tmpl
+++ b/templates/admin/config.tmpl
@@ -292,15 +292,15 @@
<dl class="admin-dl-horizontal">
<dt>{{ctx.Locale.Tr "admin.config.disable_gravatar"}}</dt>
<dd>
- <div class="ui toggle checkbox">
- <input type="checkbox" name="picture.disable_gravatar" version="{{.SystemSettings.GetVersion "picture.disable_gravatar"}}"{{if .SystemSettings.GetBool "picture.disable_gravatar"}} checked{{end}} title="{{ctx.Locale.Tr "admin.config.disable_gravatar"}}">
+ <div class="ui toggle checkbox" data-tooltip-content="{{ctx.Locale.Tr "admin.config.disable_gravatar"}}">
+ <input type="checkbox" data-config-dyn-key="picture.disable_gravatar" {{if .SystemConfig.Picture.DisableGravatar.Value ctx}}checked{{end}}>
</div>
</dd>
<div class="divider"></div>
<dt>{{ctx.Locale.Tr "admin.config.enable_federated_avatar"}}</dt>
<dd>
- <div class="ui toggle checkbox">
- <input type="checkbox" name="picture.enable_federated_avatar" version="{{.SystemSettings.GetVersion "picture.enable_federated_avatar"}}"{{if .SystemSettings.GetBool "picture.enable_federated_avatar"}} checked{{end}} title="{{ctx.Locale.Tr "admin.config.enable_federated_avatar"}}">
+ <div class="ui toggle checkbox" data-tooltip-content="{{ctx.Locale.Tr "admin.config.enable_federated_avatar"}}">
+ <input type="checkbox" data-config-dyn-key="picture.enable_federated_avatar" {{if .SystemConfig.Picture.EnableFederatedAvatar.Value ctx}}checked{{end}}>
</div>
</dd>
</dl>