mirror of
https://github.com/writefreely/writefreely
synced 2024-12-13 02:02:27 +00:00
f85f0751a3
- update error messages to be correct - move suspended message into template and include for other pages - check suspended status on all relevant pages and show message if logged in user is suspended. - fix possible nil pointer error - remove changes to db schema files - add version comment to migration - add UserStatus type with UserActive and UserSuspended - change database table to use status column instead of suspended - update toggle suspended handler to be toggle status in prep for possible future inclusion of further user statuses
36 lines
1 KiB
Cheetah
36 lines
1 KiB
Cheetah
{{define "users"}}
|
|
{{template "header" .}}
|
|
|
|
<div class="snug content-container">
|
|
{{template "admin-header" .}}
|
|
|
|
<h2 id="posts-header" style="display: flex; justify-content: space-between;">Users <span style="font-style: italic; font-size: 0.75em;">{{.TotalUsers}} total</strong></h2>
|
|
|
|
<table class="classy export" style="width:100%">
|
|
<tr>
|
|
<th>User</th>
|
|
<th>Joined</th>
|
|
<th>Type</th>
|
|
<th>Status</th>
|
|
</tr>
|
|
{{range .Users}}
|
|
<tr>
|
|
<td><a href="/admin/user/{{.Username}}">{{.Username}}</a></td>
|
|
<td>{{.CreatedFriendly}}</td>
|
|
<td style="text-align:center">{{if .IsAdmin}}Admin{{else}}User{{end}}</td>
|
|
<td style="text-align:center">
|
|
<a
|
|
href="/admin/user/{{.Username}}#status"
|
|
title="View or change account status">{{if eq .Status 1}}suspended{{else}}active{{end}}</a></td>
|
|
</tr>
|
|
{{end}}
|
|
</table>
|
|
|
|
<nav class="pager">
|
|
{{range $n := .TotalPages}}<a href="/admin/users{{if ne $n 1}}?p={{$n}}{{end}}" {{if eq $.CurPage $n}}class="selected"{{end}}>{{$n}}</a>{{end}}
|
|
</nav>
|
|
|
|
</div>
|
|
|
|
{{template "footer" .}}
|
|
{{end}}
|