소스 검색

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
T661-disable-accounts
Matt Baer 4 년 전
부모
커밋
c3f76a3ab8
5개의 변경된 파일10개의 추가작업 그리고 10개의 파일을 삭제
  1. +1
    -1
      errors.go
  2. +1
    -1
      templates/pad.tmpl
  3. +1
    -1
      templates/user/admin/users.tmpl
  4. +6
    -6
      templates/user/admin/view-user.tmpl
  5. +1
    -1
      templates/user/include/suspended.tmpl

+ 1
- 1
errors.go 파일 보기

@@ -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


+ 1
- 1
templates/pad.tmpl 파일 보기

@@ -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)}}


+ 1
- 1
templates/user/admin/users.tmpl 파일 보기

@@ -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>


+ 6
- 6
templates/user/admin/view-user.tmpl 파일 보기

@@ -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>
<input type="submit" value="Activate"/>
<p>Silenced</p>
<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() {
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.");
function confirmSilence() {
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
- 1
templates/user/include/suspended.tmpl 파일 보기

@@ -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}}

불러오는 중...
취소
저장