Confirm suspension before submitting the form

This also includes a bit of explanation about what suspending a user
actually does.

Ref T661
pull/174/head
Matt Baer 5 years ago
parent c9f7219831
commit 280c32afdc
  1. 8
      templates/user/admin/view-user.tmpl

@ -57,7 +57,7 @@ td.active-suspend > input[type="submit"] {
<td>{{if .LastPost}}{{.LastPost}}{{else}}Never{{end}}</td>
</tr>
<tr>
<form action="/admin/user/{{.User.Username}}/status" method="POST">
<form action="/admin/user/{{.User.Username}}/status" method="POST" {{if not .User.IsSuspended}}onsubmit="return confirmSuspend()"{{end}}>
<a id="status"/>
<th>Status</th>
<td class="active-suspend">
@ -116,5 +116,11 @@ td.active-suspend > input[type="submit"] {
{{end}}
</div>
<script type="text/javascript">
function confirmSuspend() {
return confirm("Suspend this user? They'll still be able to log in and access their posts, but no one else will be able to see them anymore. You can reverse this decision at any time.");
}
</script>
{{template "footer" .}}
{{end}}

Loading…
Cancel
Save