1
0

admin_ils_users.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. {% extends 'auth_layout.html' %}
  2. {% block content %}
  3. {% if context.message %}
  4. <div class="row">
  5. <div class="col text-center text-primary">
  6. <i class="ri-error-warning-fill"></i> {{ context.message }}
  7. </div>
  8. </div>
  9. {% endif %}
  10. {% if context.suspend_setting == "false" %}
  11. <div class="alert alert-warning" role="alert">
  12. The scheduler is currently running. To make changes, you must first disable the scheduler. <a href="">Click here to disable the scheduler.</a>
  13. </div>
  14. {% else %}
  15. <div class="alert alert-primary" role="alert">
  16. The scheduler is currently disabled. <a href="">Click here to enable the scheduler.</a>
  17. </div>
  18. {% endif %}
  19. <div class="row">
  20. <div class="col">
  21. <a href="#!" data-bs-toggle="modal" data-bs-target="#remove-all-users" class="btn btn-danger float-end {% if context.suspend_setting == "false" %} disabled {% endif %}"><i class="ri-delete-bin-line"></i> Remove all ILS Users</a>
  22. <a href="#!" data-bs-toggle="modal" data-bs-target="#add-user" class="btn btn-primary float-end me-2 {% if context.suspend_setting == "false" %} disabled {% endif %}"><i class="ri-user-add-line"></i> Add ILS User</a>
  23. <a href="{{ url_for('admin_ils_users_csv_download') }}" class="btn btn-dark float-end me-2"><i class="ri-file-download-fill"></i> CSV Export</a>
  24. <a href="{{ url_for('admin_ils_users_csv_import') }}" class="btn btn-dark float-end me-2 {% if context.suspend_setting == "false" %} disabled {% endif %}"><i class="ri-file-upload-fill"></i> CSV Import</a>
  25. <h3><i class="ri-shield-user-fill"></i> ILS Users</h3>
  26. <p class="lead">ILS users accounts establish with the ILS system.</p>
  27. </div>
  28. </div>
  29. <div class="row">
  30. <div class="col">
  31. <table class="table table-flush">
  32. <thead>
  33. <tr>
  34. <th scope="col">Username</th>
  35. <th scope="col">Email</th>
  36. <th scope="col">Reset Date</th>
  37. <th scope="col"></th>
  38. <th scope="col"></th>
  39. </tr>
  40. </thead>
  41. <tbody>
  42. {% for user in context.users %}
  43. <tr>
  44. <td>{{ user.username }}</td>
  45. <td>{{ user.email }}</td>
  46. <!-- check if user.reset_datetime is today -->
  47. <td>
  48. {{ user.reset_datetime }}
  49. </td>
  50. <td>
  51. {{ user.reset_datetime|time_since }}
  52. </td>
  53. <td>
  54. <a href="{{ url_for('admin_ils_users_edit', id=user.id) }}" class="btn btn-secondary w-100">Edit</a>
  55. </td>
  56. </tr>
  57. {% endfor %}
  58. </tbody>
  59. </table>
  60. </div>
  61. </div>
  62. <div class="modal fade" id="add-user" tabindex="-1">
  63. <div class="modal-dialog modal-dialog-centered">
  64. <div class="modal-content">
  65. <div class="modal-header bg-light">
  66. <h1 class="modal-title fs-5"><i class="ri-user-add-fill"></i> Add ILS User</h1>
  67. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  68. </div>
  69. <form action="" method="post">
  70. <div class="modal-body">
  71. <div class="mb-3">
  72. <input type="text" class="form-control" id="username" name="username" placeholder="Username" required>
  73. </div>
  74. <div class="mb-3">
  75. <input type="email" class="form-control" id="email" name="email" placeholder="Email" required>
  76. </div>
  77. <div class="mb-3">
  78. <input type="date" class="form-control" id="date" name="date" placeholder="Last Password Reset Date">
  79. </div>
  80. </div>
  81. <div class="modal-footer bg-light">
  82. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  83. <input type="submit" class="btn btn-primary" value="Save">
  84. </div>
  85. </form>
  86. </div>
  87. </div>
  88. </div>
  89. <div class="modal fade" id="remove-all-users" tabindex="-1">
  90. <div class="modal-dialog modal-dialog-centered">
  91. <div class="modal-content">
  92. <div class="modal-header bg-light">
  93. <h1 class="modal-title fs-5"><i class="ri-delete-bin-line-fill"></i> Confirmation</h1>
  94. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  95. </div>
  96. <div class="modal-body">
  97. # Confirmation asking user to confirm removal of all ILS users
  98. <p class="lead">
  99. Are you sure you want to remove all ILS users?
  100. </p>
  101. </div>
  102. <div class="modal-footer bg-light">
  103. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  104. <a href="{{ url_for('admin_ils_users_delete_all') }}" class="btn btn-danger">Remove All</a>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. {% endblock %}