Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed Dec 11, 2022
1 parent a10c911 commit 6810325
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 36 deletions.
4 changes: 2 additions & 2 deletions custom/conf/app.example.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2483,5 +2483,5 @@ ROUTER = console
;PROXY_HOSTS =

;[user]
; Disabled modules from user settings, could be passwords, deletion, security, applications, gpg keys, organizations
;USER_SETTING_DISABLED_MODULES =
; Disabled modules from user settings, could be password, deletion, security, applications, gpg keys, organizations
;SETTING_DISABLED_MODULES =
75 changes: 41 additions & 34 deletions templates/user/settings/account.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -135,31 +135,40 @@
</form>
</div>

<h4 class="ui top attached error header">
{{.locale.Tr "settings.delete_account"}}
</h4>
<div class="ui attached error segment">
<div class="ui red message">
<p class="text left">{{svg "octicon-alert"}} {{.locale.Tr "settings.delete_prompt" | Str2html}}</p>
{{if .UserDeleteWithComments}}
<p class="text left" style="font-weight: bold;">{{.locale.Tr "settings.delete_with_all_comments" .UserDeleteWithCommentsMaxTime | Str2html}}</p>
{{end}}
</div>
<form class="ui form ignore-dirty" id="delete-form" action="{{AppSubUrl}}/user/settings/account/delete" method="post">
{{template "base/disable_form_autofill"}}
{{.CsrfTokenHtml}}
<div class="required field {{if .Err_Password}}error{{end}}">
<label for="password-confirmation">{{.locale.Tr "password"}}</label>
<input id="password-confirmation" name="password" type="password" autocomplete="off" required>
{{if $.UserModules.Enabled "deletion"}}
<h4 class="ui top attached error header">
{{.locale.Tr "settings.delete_account"}}
</h4>
<div class="ui attached error segment">
<div class="ui red message">
<p class="text left">{{svg "octicon-alert"}} {{.locale.Tr "settings.delete_prompt" | Str2html}}</p>
{{if .UserDeleteWithComments}}
<p class="text left" style="font-weight: bold;">{{.locale.Tr "settings.delete_with_all_comments" .UserDeleteWithCommentsMaxTime | Str2html}}</p>
{{end}}
</div>
<div class="field">
<div class="ui red button delete-button" data-modal-id="delete-account" data-type="form" data-form="#delete-form">
{{.locale.Tr "settings.confirm_delete_account"}}
</div>
<a href="{{AppSubUrl}}/user/forgot_password?email={{.Email}}">{{.locale.Tr "auth.forgot_password"}}</a>
<form class="ui form ignore-dirty" id="delete-form" action="{{AppSubUrl}}/user/settings/account/delete" method="post">
{{template "base/disable_form_autofill"}}
{{.CsrfTokenHtml}}
<div class="required field {{if .Err_Password}}error{{end}}">
<label for="password-confirmation">{{.locale.Tr "password"}}</label>
<input id="password-confirmation" name="password" type="password" autocomplete="off" required>
</div>
</form>
</div>
<form class="ui form ignore-dirty" id="delete-form" action="{{AppSubUrl}}/user/settings/account/delete" method="post">
{{template "base/disable_form_autofill"}}
{{.CsrfTokenHtml}}
<div class="required field {{if .Err_Password}}error{{end}}">
<label for="password-confirmation">{{.locale.Tr "password"}}</label>
<input id="password-confirmation" name="password" type="password" autocomplete="off" required>
</div>
<div class="field">
<div class="ui red button delete-button" data-modal-id="delete-account" data-type="form" data-form="#delete-form">
{{.locale.Tr "settings.confirm_delete_account"}}
</div>
<a href="{{AppSubUrl}}/user/forgot_password?email={{.Email}}">{{.locale.Tr "auth.forgot_password"}}</a>
</div>
</form>
</div>
{{end}}
</div>
</div>

Expand All @@ -174,17 +183,15 @@
{{template "base/delete_modal_actions" .}}
</div>

{{if $.UserModules.Enabled "deletion"}}
<div class="ui small basic delete modal" id="delete-account">
<div class="ui icon header">
{{svg "octicon-trash"}}
{{.locale.Tr "settings.delete_account_title"}}
</div>
<div class="content">
<p>{{.locale.Tr "settings.delete_account_desc"}}</p>
</div>
{{template "base/delete_modal_actions" .}}
<div class="ui small basic delete modal" id="delete-account">
<div class="ui icon header">
{{svg "octicon-trash"}}
{{.locale.Tr "settings.delete_account_title"}}
</div>
{{end}}
<div class="content">
<p>{{.locale.Tr "settings.delete_account_desc"}}</p>
</div>
{{template "base/delete_modal_actions" .}}
</div>

{{template "base/footer" .}}

0 comments on commit 6810325

Please sign in to comment.