Change "suspend" to "silence" where user-facing

This puts the verbiage more in line with what the feature does, and
leaves room for other moderation controls in the future.

NOTE: this includes no backend refactoring, which may be confusing. We
should rename things to fit ASAP.

Ref T661
pull/174/head
Matt Baer 5 years ago
parent f7550a0da8
commit c3f76a3ab8
  1. 2
      errors.go
  2. 2
      templates/pad.tmpl
  3. 2
      templates/user/admin/users.tmpl
  4. 12
      templates/user/admin/view-user.tmpl
  5. 2
      templates/user/include/suspended.tmpl

@ -48,7 +48,7 @@ var (
ErrUserNotFound = impart.HTTPError{http.StatusNotFound, "User doesn't exist."} ErrUserNotFound = impart.HTTPError{http.StatusNotFound, "User doesn't exist."}
ErrUserNotFoundEmail = impart.HTTPError{http.StatusNotFound, "Please enter your username instead of your email address."} ErrUserNotFoundEmail = impart.HTTPError{http.StatusNotFound, "Please enter your username instead of your email address."}
ErrUserSuspended = impart.HTTPError{http.StatusForbidden, "Account is suspended, contact the administrator."} ErrUserSuspended = impart.HTTPError{http.StatusForbidden, "Account is silenced."}
) )
// Post operation errors // Post operation errors

@ -134,7 +134,7 @@
var suspended = {{.Suspended}}; var suspended = {{.Suspended}};
var publish = function(content, font) { var publish = function(content, font) {
if (suspended === true) { if (suspended === true) {
alert("Your account is currently suspended, posting is disabled."); alert("Your account is silenced, so you can't publish or update posts.");
return; return;
} }
{{if and (and .Post.Id (not .Post.Slug)) (not .User)}} {{if and (and .Post.Id (not .Post.Slug)) (not .User)}}

@ -18,7 +18,7 @@
<td><a href="/admin/user/{{.Username}}">{{.Username}}</a></td> <td><a href="/admin/user/{{.Username}}">{{.Username}}</a></td>
<td>{{.CreatedFriendly}}</td> <td>{{.CreatedFriendly}}</td>
<td style="text-align:center">{{if .IsAdmin}}Admin{{else}}User{{end}}</td> <td style="text-align:center">{{if .IsAdmin}}Admin{{else}}User{{end}}</td>
<td style="text-align:center">{{if .IsSuspended}}Suspended{{else}}Active{{end}}</td> <td style="text-align:center">{{if .IsSilenced}}Silenced{{else}}Active{{end}}</td>
</tr> </tr>
{{end}} {{end}}
</table> </table>

@ -57,16 +57,16 @@ td.active-suspend > input[type="submit"] {
<td>{{if .LastPost}}{{.LastPost}}{{else}}Never{{end}}</td> <td>{{if .LastPost}}{{.LastPost}}{{else}}Never{{end}}</td>
</tr> </tr>
<tr> <tr>
<form action="/admin/user/{{.User.Username}}/status" method="POST" {{if not .User.IsSuspended}}onsubmit="return confirmSuspend()"{{end}}> <form action="/admin/user/{{.User.Username}}/status" method="POST" {{if not .User.IsSilenced}}onsubmit="return confirmSilence()"{{end}}>
<a id="status"/> <a id="status"/>
<th>Status</th> <th>Status</th>
<td class="active-suspend"> <td class="active-suspend">
{{if .User.IsSuspended}} {{if .User.IsSuspended}}
<p>Suspended</p> <p>Silenced</p>
<input type="submit" value="Activate"/> <input type="submit" value="Unsilence"/>
{{else}} {{else}}
<p>Active</p> <p>Active</p>
<input class="danger" type="submit" value="Suspend" {{if .User.IsAdmin}}disabled{{end}}/> <input class="danger" type="submit" value="Silence" {{if .User.IsAdmin}}disabled{{end}}/>
{{end}} {{end}}
</td> </td>
</form> </form>
@ -117,8 +117,8 @@ td.active-suspend > input[type="submit"] {
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
function confirmSuspend() { function confirmSilence() {
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."); return confirm("Silence 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> </script>

@ -1,5 +1,5 @@
{{define "user-suspended"}} {{define "user-suspended"}}
<div class="alert info"> <div class="alert info">
<p><strong>Your account is suspended.</strong> You can still access all of your posts and blogs, but no one else can currently see them.</p> <p><strong>Your account has been silenced.</strong> You can still access all of your posts and blogs, but no one else can currently see them.</p>
</div> </div>
{{end}} {{end}}

Loading…
Cancel
Save