scheduled_emails.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. <div class="row">
  11. <div class="col">
  12. <a href="{{ url_for('schedule') }}" class="btn btn-dark float-end me-2">Back</a>
  13. <h3><i class="ri-time-line"></i> Scheduled Reminders</h3>
  14. <p class="lead">The following are the scheduled email reminders.</p>
  15. </div>
  16. </div>
  17. <div class="row">
  18. <div class="col">
  19. <table class="table table-flush">
  20. <thead>
  21. <tr>
  22. <th scope="col">Date to Send</th>
  23. <th scope="col">Days before expiration</th>
  24. <th scope="col">Username</th>
  25. <th scope="col">Email</th>
  26. <th class="text-end" scope="col">Actions</th>
  27. </tr>
  28. </thead>
  29. <tbody>
  30. {% for reminder in context.reminders %}
  31. <tr>
  32. <td>{{ reminder.date }} {{ reminder.date | time_until }}</td>
  33. <td>{{ reminder.interval }}</td>
  34. <td>{{ reminder.username }}</td>
  35. <td>{{ reminder.email }}</td>
  36. <td class="text-end">
  37. <a href="#!" data-bs-toggle="modal" data-bs-target="#reminder-{{ loop.index0 }}" class="btn btn-danger">Delete</a>
  38. </td>
  39. </tr>
  40. {% endfor %}
  41. </tbody>
  42. </table>
  43. </div>
  44. </div>
  45. {% for reminder in context.reminders %}
  46. <div class="modal fade" id="reminder-{{ loop.index0 }}" tabindex="-1">
  47. <div class="modal-dialog modal-dialog-centered">
  48. <div class="modal-content">
  49. <div class="modal-header bg-light">
  50. <h1 class="modal-title fs-5">Confirmation </h1>
  51. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  52. </div>
  53. <div class="modal-body">
  54. <p class="lead">Are you sure you want to delete this reminder?</p>
  55. </div>
  56. <div class="modal-footer bg-light">
  57. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  58. <a class="btn btn-danger" href="{{ url_for('reminder_remove', id=reminder.id) }}">Yes, remove the reminder</a>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. {% endfor %}
  64. {% endblock %}