users.gohtml (2904B)
1 {{ define "sub-content" }} 2 <div class="pb-2 mt-4 mb-4 border-bottom"> 3 <h2>{{ .Data.UsersCount | comma }} Users</h2> 4 </div> 5 6 <form> 7 <div class="input-group"> 8 <input type="text" name="q" class="form-control" value="{{ .Data.Query }}" placeholder="Search username" /> 9 <div class="input-group-append"> 10 <button class="btn btn-secondary"><i class="fa fa-search fa-fw"></i></button> 11 </div> 12 </div> 13 </form> 14 <table class="table table-striped table-sm table-novpadding table-dark"> 15 <thead> 16 <tr> 17 <th>Username</th> 18 <th>Role</th> 19 <th>Created at</th> 20 <th class="text-center">Admin</th> 21 <th class="text-center">Verified</th> 22 <th class="text-center">pgp</th> 23 <th class="text-center">totp</th> 24 <th class="text-center">HB</th> 25 <th class="text-center">Tuto</th> 26 <th class="text-center">Reg</th> 27 <th class="text-right" style="width: 140px;">Actions</th> 28 </tr> 29 </thead> 30 <tbody> 31 {{ range .Data.Users }} 32 <tr> 33 <td class="align-middle"><a href="/admin/users/{{ .ID }}/edit">{{ .Username }}</a></td> 34 <td class="align-middle">{{ .Role }}</td> 35 <td class="align-middle">{{ .CreatedAt.Format "Jan 02, 2006 - 15:04:05" }}</td> 36 <td class="text-center align-middle">{{ .IsAdmin | fmtBool }}</td> 37 <td class="text-center align-middle">{{ .Verified | fmtBool }}</td> 38 <td class="text-center align-middle">{{ not (.GPGPublicKey | isStrEmpty) | fmtBool }}</td> 39 <td class="text-center align-middle">{{ (not .TwoFactorSecret.IsEmpty) | fmtBool }}</td> 40 <td class="text-center align-middle">{{ .IsHellbanned | fmtBool }}</td> 41 <td class="text-center align-middle">{{ .ChatTutorial }}</td> 42 <td class="text-center align-middle">{{ .RegistrationDuration | ms2s }}</td> 43 <td class="text-right"> 44 {{ if eq .ID 1 }} 45 <button type="submit" class="btn btn-danger btn-sm disabled" title="Delete user" disabled>X</button> 46 {{ else }} 47 <form class="d-inline" id="delete_user_{{ .ID }}" action="/admin/users/{{ .ID }}/delete" method="post"> 48 <input type="hidden" name="csrf" value="{{ $.CSRF }}" /> 49 <button type="submit" class="btn btn-danger btn-sm" title="Delete user">X</button> 50 </form> 51 {{ end }} 52 </td> 53 </tr> 54 {{ end }} 55 </tbody> 56 </table> 57 58 <div class="mb-5"> 59 <a href="?p={{ add .Data.CurrentPage -1 }}" class="btn btn-light{{ if le .Data.CurrentPage 1 }} disabled{{ end }}">« {{ t "Prev" . }}</a> 60 <a href="?p={{ add .Data.CurrentPage 1 }}" class="btn btn-light{{ if eq .Data.CurrentPage .Data.MaxPage }} disabled{{ end }}">{{ t "Next" . }} »</a> 61 </div> 62 {{ end }}