summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorJohn Olheiser <john.olheiser@gmail.com>2022-09-12 15:52:17 -0500
committerGitHub <noreply@github.com>2022-09-12 21:52:17 +0100
commit2854031d870434f4a9f7e5131846eb6a7209ca59 (patch)
treed9c5e25279b091147710b3c10b39c0b2fda46a56 /templates
parentdefc401b275ae5cbcb983a6685e083e71da9e341 (diff)
downloadgitea-2854031d870434f4a9f7e5131846eb6a7209ca59.tar.gz
gitea-2854031d870434f4a9f7e5131846eb6a7209ca59.zip
Use form for admin purge user (#21070)
Fixes #20998 The basic modal actions were set up for basic confirmation-style modals, however this modal also has a special form input, which instead requires a form in the modal itself. The basic modal actions are indirectly controlled by JS and are simple `<div>` elements, whereas this requires a `<button>` to submit. This appears to be similar to how we do it in (for example) the repo deletion modal. Signed-off-by: jolheiser <john.olheiser@gmail.com>
Diffstat (limited to 'templates')
-rw-r--r--templates/admin/user/edit.tmpl14
1 files changed, 11 insertions, 3 deletions
diff --git a/templates/admin/user/edit.tmpl b/templates/admin/user/edit.tmpl
index 7aeaa2537c..9e0f1d89fd 100644
--- a/templates/admin/user/edit.tmpl
+++ b/templates/admin/user/edit.tmpl
@@ -151,7 +151,7 @@
<div class="field">
<button class="ui green button">{{.locale.Tr "admin.users.update_profile"}}</button>
- <div class="ui red button show-modal" data-modal="#delete-user-modal" data-url="{{$.Link}}/delete" data-id="{{.User.ID}}">{{.locale.Tr "admin.users.delete_account"}}</div>
+ <div class="ui red button show-modal" data-modal="#delete-user-modal">{{.locale.Tr "admin.users.delete_account"}}</div>
</div>
</form>
</div>
@@ -206,7 +206,6 @@
</div>
<form class="ui form" method="POST" action="{{.Link}}/delete">
{{$.CsrfTokenHtml}}
- <input type="hidden" name="id">
<div class="field">
<div class="ui checkbox">
<label for="purge">{{.locale.Tr "admin.users.purge"}}</label>
@@ -214,7 +213,16 @@
</div>
<p class="help">{{.locale.Tr "admin.users.purge_help"}}</p>
</div>
- {{template "base/delete_modal_actions" .}}
+ <div class="actions">
+ <div class="ui red basic inverted cancel button">
+ {{svg "octicon-x"}}
+ {{.locale.Tr "modal.no"}}
+ </div>
+ <button class="ui green basic inverted ok button">
+ {{svg "octicon-check"}}
+ {{.locale.Tr "modal.yes"}}
+ </button>
+ </div>
</form>
</div>
{{template "base/footer" .}}