users.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 "integrations" }}">{{ t "Integrations" }}</a>
  11. </li>
  12. <li>
  13. <a href="{{ route "sessions" }}">{{ t "Sessions" }}</a>
  14. </li>
  15. <li>
  16. <a href="{{ route "createUser" }}">{{ t "Add user" }}</a>
  17. </li>
  18. <li>
  19. <a href="{{ route "about" }}">{{ t "About" }}</a>
  20. </li>
  21. </ul>
  22. </section>
  23. {{ if eq (len .users) 1 }}
  24. <p class="alert">{{ t "You are the only user." }}</p>
  25. {{ else }}
  26. <table>
  27. <tr>
  28. <th class="column-20">{{ t "Username" }}</th>
  29. <th>{{ t "Administrator" }}</th>
  30. <th>{{ t "Last Login" }}</th>
  31. <th>{{ t "Actions" }}</th>
  32. </tr>
  33. {{ range .users }}
  34. {{ if ne .ID $.user.ID }}
  35. <tr>
  36. <td>{{ .Username }}</td>
  37. <td>{{ if eq .IsAdmin true }}{{ t "Yes" }}{{ else }}{{ t "No" }}{{ end }}</td>
  38. <td>
  39. {{ if .LastLoginAt }}
  40. <time datetime="{{ isodate .LastLoginAt }}" title="{{ isodate .LastLoginAt }}">{{ elapsed $.user.Timezone .LastLoginAt }}</time>
  41. {{ else }}
  42. {{ t "Never" }}
  43. {{ end }}
  44. </td>
  45. <td>
  46. <a href="{{ route "editUser" "userID" .ID }}">{{ t "Edit" }}</a>,
  47. <a href="#"
  48. data-confirm="true"
  49. data-label-question="{{ t "Are you sure?" }}"
  50. data-label-yes="{{ t "yes" }}"
  51. data-label-no="{{ t "no" }}"
  52. data-label-loading="{{ t "Work in progress..." }}"
  53. data-url="{{ route "removeUser" "userID" .ID }}">{{ t "Remove" }}</a>
  54. </td>
  55. </tr>
  56. {{ end }}
  57. {{ end }}
  58. </table>
  59. {{ end }}
  60. {{ end }}