schedule.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. {% extends 'auth_layout.html' %}
  2. {% block content %}
  3. {% if context.message %}
  4. <div class="row">
  5. <div class="col text-center text-primary mb-3">
  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 change the Password Reset Interval, you must first disable the scheduler. <a href="{{ url_for('disable_scheduler') }}">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="{{ url_for('enable_scheduler') }}">Click here to enable the scheduler.</a>
  17. </div>
  18. {% endif %}
  19. <div class="row">
  20. <div class="col">
  21. {% if context.suspend_setting == "false" %}
  22. <a href="#!" class="disabled btn btn-primary float-end me-2"><i class="ri-add-line"></i>Add Schedule</a>
  23. {% else %}
  24. <a href="#!" data-bs-toggle="modal" data-bs-target="#add-schedule" class="btn btn-primary float-end me-2"><i class="ri-add-line"></i>Add Schedule</a>
  25. {% endif %}
  26. <a href="{{ url_for('scheduled_emails') }}" class="btn btn-dark float-end me-2"><i class="ri-time-line"></i> Scheduled Reminders</a>
  27. <h3><i class="ri-time-line"></i> Schedule</h3>
  28. <p class="lead">The following schedule rules will schedule and send email reminders to staff.</p>
  29. </div>
  30. </div>
  31. <div class="row">
  32. <div class="col">
  33. <table class="table table-flush">
  34. <thead>
  35. <tr>
  36. <th scope="col">Interval</th>
  37. <th scope="col"></th>
  38. </tr>
  39. </thead>
  40. <tbody>
  41. {% for schedule in context.schedules %}
  42. <tr>
  43. <td>Send email reminder {{ schedule.interval }} day{% if schedule.interval > "1" %}s{% endif %} before password expires.</td>
  44. <td class="text-end">
  45. {% if context.suspend_setting == "false" %}
  46. <a href="#!" class="disabled btn btn-danger">Delete</a>
  47. {% else %}
  48. <a href="#!" data-bs-toggle="modal" data-bs-target="#setting-{{ loop.index0 }}" class="btn btn-danger">Delete</a>
  49. {% endif %}
  50. </td>
  51. </tr>
  52. {% endfor %}
  53. </tbody>
  54. </table>
  55. </div>
  56. </div>
  57. <div class="modal fade" id="add-schedule" tabindex="-1">
  58. <div class="modal-dialog modal-dialog-centered">
  59. <div class="modal-content">
  60. <div class="modal-header bg-light">
  61. <h1 class="modal-title fs-5"><i class="ri-add-line"></i> Add Schedule</h1>
  62. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  63. </div>
  64. <form action="" method="post">
  65. <div class="modal-body">
  66. <p class="lead">
  67. Enter the number of days before password expiration to send email reminders.
  68. </p>
  69. <div class="mb-3">
  70. <input type="text" class="form-control" id="interval" name="interval" placeholder="Number of days" required>
  71. </div>
  72. </div>
  73. <div class="modal-footer bg-light">
  74. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  75. <input type="submit" class="btn btn-primary" value="Save">
  76. </div>
  77. </form>
  78. </div>
  79. </div>
  80. </div>
  81. {% for schedule in context.schedules %}
  82. <div class="modal fade" id="setting-{{ loop.index0 }}" tabindex="-1">
  83. <div class="modal-dialog modal-dialog-centered">
  84. <div class="modal-content">
  85. <div class="modal-header bg-light">
  86. <h1 class="modal-title fs-5">Confirmation </h1>
  87. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  88. </div>
  89. <div class="modal-body">
  90. <p class="lead">Are you sure you want to delete this schedule?</p>
  91. </div>
  92. <div class="modal-footer bg-light">
  93. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  94. <a class="btn btn-danger" href="{{ url_for('schedule_remove', id=schedule.id) }}">Yes, remove the schedule</a>
  95. </div>
  96. </div>
  97. </div>
  98. </div>
  99. {% endfor %}
  100. {% endblock %}