Skip to content

Commit 2854031

Browse files
authored
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>
1 parent defc401 commit 2854031

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

templates/admin/user/edit.tmpl

+11-3
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151

152152
<div class="field">
153153
<button class="ui green button">{{.locale.Tr "admin.users.update_profile"}}</button>
154-
<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>
154+
<div class="ui red button show-modal" data-modal="#delete-user-modal">{{.locale.Tr "admin.users.delete_account"}}</div>
155155
</div>
156156
</form>
157157
</div>
@@ -206,15 +206,23 @@
206206
</div>
207207
<form class="ui form" method="POST" action="{{.Link}}/delete">
208208
{{$.CsrfTokenHtml}}
209-
<input type="hidden" name="id">
210209
<div class="field">
211210
<div class="ui checkbox">
212211
<label for="purge">{{.locale.Tr "admin.users.purge"}}</label>
213212
<input name="purge" type="checkbox">
214213
</div>
215214
<p class="help">{{.locale.Tr "admin.users.purge_help"}}</p>
216215
</div>
217-
{{template "base/delete_modal_actions" .}}
216+
<div class="actions">
217+
<div class="ui red basic inverted cancel button">
218+
{{svg "octicon-x"}}
219+
{{.locale.Tr "modal.no"}}
220+
</div>
221+
<button class="ui green basic inverted ok button">
222+
{{svg "octicon-check"}}
223+
{{.locale.Tr "modal.yes"}}
224+
</button>
225+
</div>
218226
</form>
219227
</div>
220228
{{template "base/footer" .}}

0 commit comments

Comments
 (0)