diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2024-02-23 15:24:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-23 07:24:04 +0000 |
commit | 3ef6252e06a1f3981f8b7d1717bfc581418b1dc5 (patch) | |
tree | 9ff3962b5b33d3f08e13259eb8d4ebc7c2f228e3 /templates/user/settings | |
parent | 7fbdb60fc1152acc9a040dc04b1b0f5a3475b081 (diff) | |
download | gitea-3ef6252e06a1f3981f8b7d1717bfc581418b1dc5.tar.gz gitea-3ef6252e06a1f3981f8b7d1717bfc581418b1dc5.zip |
Allow options to disable user deletion from the interface on app.ini (#29275)
Extract from #20549
This PR added a new option on app.ini `[admin]USER_DISABLED_FEATURES` to
allow the site administrator to disable users visiting deletion user
interface or allow.
This options are also potentially allowed to define more features in
future PRs.
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'templates/user/settings')
-rw-r--r-- | templates/user/settings/account.tmpl | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/templates/user/settings/account.tmpl b/templates/user/settings/account.tmpl index bfcf423d67..515e79d739 100644 --- a/templates/user/settings/account.tmpl +++ b/templates/user/settings/account.tmpl @@ -128,6 +128,7 @@ {{end}} </div> + {{if not ($.UserDisabledFeatures.Contains "deletion")}} <h4 class="ui top attached error header"> {{ctx.Locale.Tr "settings.delete_account"}} </h4> @@ -151,7 +152,18 @@ </button> </div> </form> + <div class="ui g-modal-confirm delete modal" id="delete-account"> + <div class="header"> + {{svg "octicon-trash"}} + {{ctx.Locale.Tr "settings.delete_account_title"}} + </div> + <div class="content"> + <p>{{ctx.Locale.Tr "settings.delete_account_desc"}}</p> + </div> + {{template "base/modal_actions_confirm" .}} + </div> </div> + {{end}} </div> <div class="ui g-modal-confirm delete modal" id="delete-email"> @@ -165,15 +177,4 @@ {{template "base/modal_actions_confirm" .}} </div> -<div class="ui g-modal-confirm delete modal" id="delete-account"> - <div class="header"> - {{svg "octicon-trash"}} - {{ctx.Locale.Tr "settings.delete_account_title"}} - </div> - <div class="content"> - <p>{{ctx.Locale.Tr "settings.delete_account_desc"}}</p> - </div> - {{template "base/modal_actions_confirm" .}} -</div> - {{template "user/settings/layout_footer" .}} |