users.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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="#"
  42. data-confirm="true"
  43. data-label-question="{{ t "Are you sure?" }}"
  44. data-label-yes="{{ t "yes" }}"
  45. data-label-no="{{ t "no" }}"
  46. data-label-loading="{{ t "Work in progress..." }}"
  47. data-url="{{ route "removeUser" "userID" .ID }}">{{ t "Remove" }}</a>
  48. </td>
  49. </tr>
  50. {{ end }}
  51. {{ end }}
  52. </table>
  53. {{ end }}
  54. {{ end }}