users.html 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. {{ define "title"}}{{ t "Users" }}{{ end }}
  2. {{ define "content"}}
  3. <section class="page-header">
  4. <h1>{{ t "Users" }}</h1>
  5. <ul>
  6. <li>
  7. <a href="{{ route "settings" }}">{{ t "Settings" }}</a>
  8. </li>
  9. <li>
  10. <a href="{{ route "sessions" }}">{{ t "Sessions" }}</a>
  11. </li>
  12. <li>
  13. <a href="{{ route "createUser" }}">{{ t "Add user" }}</a>
  14. </li>
  15. </ul>
  16. </section>
  17. {{ if eq (len .users) 1 }}
  18. <p class="alert">{{ t "You are the only user." }}</p>
  19. {{ else }}
  20. <table>
  21. <tr>
  22. <th class="column-20">{{ t "Username" }}</th>
  23. <th>{{ t "Administrator" }}</th>
  24. <th>{{ t "Last Login" }}</th>
  25. <th>{{ t "Actions" }}</th>
  26. </tr>
  27. {{ range .users }}
  28. {{ if ne .ID $.user.ID }}
  29. <tr>
  30. <td>{{ .Username }}</td>
  31. <td>{{ if eq .IsAdmin true }}{{ t "Yes" }}{{ else }}{{ t "No" }}{{ end }}</td>
  32. <td>
  33. {{ if .LastLoginAt }}
  34. <time datetime="{{ isodate .LastLoginAt }}" title="{{ isodate .LastLoginAt }}">{{ elapsed .LastLoginAt }}</time>
  35. {{ else }}
  36. {{ t "Never" }}
  37. {{ end }}
  38. </td>
  39. <td>
  40. <a href="{{ route "editUser" "userID" .ID }}">{{ t "Edit" }}</a>,
  41. <a href="{{ route "removeUser" "userID" .ID }}">{{ t "Remove" }}</a>
  42. </td>
  43. </tr>
  44. {{ end }}
  45. {{ end }}
  46. </table>
  47. {{ end }}
  48. {{ end }}