From e4164cbf67132355697fa2b3d6465d63914e612f Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Thu, 22 Apr 2021 10:08:05 -0400 Subject: [PATCH] Move admin user deletion confirmation to modal Ref T319 --- less/core.less | 13 ++++++ less/pad.less | 9 +++++ static/js/modals.js | 24 +++++++++++ templates/user/admin/view-user.tmpl | 62 ++++++++++++++++++++++++----- templates/user/collection.tmpl | 17 +------- 5 files changed, 100 insertions(+), 25 deletions(-) create mode 100644 static/js/modals.js diff --git a/less/core.less b/less/core.less index 9d2e1ab..6401ceb 100644 --- a/less/core.less +++ b/less/core.less @@ -1044,6 +1044,19 @@ li { background-color: #dff0d8; border-color: #d6e9c6; } + &.danger { + border-color: #856404; + background-color: white; + h3 { + margin: 0 0 0.5em 0; + font-size: 1em; + font-weight: bold; + color: black !important; + } + h3 + p, button { + font-size: 0.86em; + } + } p { margin: 0; diff --git a/less/pad.less b/less/pad.less index 6cdd383..486e2ea 100644 --- a/less/pad.less +++ b/less/pad.less @@ -340,6 +340,15 @@ body#pad { } } + .body { + line-height: 1.5; + + input[type=text].confirm { + width: 100%; + box-sizing: border-box; + } + } + .short { text-align: center; } diff --git a/static/js/modals.js b/static/js/modals.js new file mode 100644 index 0000000..6705afa --- /dev/null +++ b/static/js/modals.js @@ -0,0 +1,24 @@ +/* + * Copyright © 2016-2021 A Bunch Tell LLC. + * + * This file is part of WriteFreely. + * + * WriteFreely is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, included + * in the LICENSE file in this source code package. + */ + +function showModal(id) { + document.getElementById('overlay').style.display = 'block'; + document.getElementById('modal-'+id).style.display = 'block'; +} + +var closeModals = function(e) { + e.preventDefault(); + document.getElementById('overlay').style.display = 'none'; + var modals = document.querySelectorAll('.modal'); + for (var i=0; i
+
+ {{template "admin-header" .}}

{{.User.Username}}

@@ -141,19 +146,58 @@ input.copy-text { {{end}} {{ if not .User.IsAdmin }} -
-

Delete Account

-

Danger Zone - This cannot be undone

-

This will delete the user {{.User.Username}} and all their blogs AND posts.

-
-

Type their username to confirm deletion.

- - -

+

Incinerator

+
+
+
+

Delete this user

+

Permanently erase all user data, with no way to recover it.

+
+ +
+
{{end}}
+ + + + +