settings.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. <h3><i class="ri-settings-5-line"></i> Settings</h3>
  13. </div>
  14. </div>
  15. {% if context.suspend_setting == "false" %}
  16. <div class="alert alert-warning" role="alert">
  17. 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>
  18. </div>
  19. {% else %}
  20. <div class="alert alert-primary" role="alert">
  21. The scheduler is currently disabled. <a href="{{ url_for('enable_scheduler') }}">Click here to enable the scheduler.</a>
  22. </div>
  23. {% endif %}
  24. <div class="text-end">
  25. <a href="#!" data-bs-toggle="modal" data-bs-target="#email-test" class="btn btn-secondary ms-1">Send Test Email</a>
  26. </div>
  27. <div class="row">
  28. <div class="col">
  29. <table class="table table-flush">
  30. <thead>
  31. <tr>
  32. <th scope="col">Name</th>
  33. <th scope="col">Value</th>
  34. <th scope="col">Actions</th>
  35. </tr>
  36. </thead>
  37. <tbody>
  38. {% for setting in context.settings %}
  39. <tr>
  40. <td>{{ setting.name }}</td>
  41. {% if setting.name == 'SMTP Password' %}
  42. <td>
  43. {% if setting.value == "" %}
  44. <i>Password not set</i>
  45. {% else %}
  46. <i>Password set</i>
  47. {% endif %}
  48. </td>
  49. {% else %}
  50. <td>{{ setting.value }}</td>
  51. {% endif %}
  52. <td>
  53. {% if setting.name == 'Password Reset Interval' %}
  54. {% if context.suspend_setting == "false" %}
  55. <a href="#!" class="disabled btn btn-primary">Edit</a>
  56. {% else %}
  57. <a href="#!" data-bs-toggle="modal" data-bs-target="#setting-{{ loop.index0 }}" class="btn btn-primary">Edit</a>
  58. {% endif %}
  59. {% else %}
  60. <a href="#!" data-bs-toggle="modal" data-bs-target="#setting-{{ loop.index0 }}" class="btn btn-primary">Edit</a>
  61. {% endif %}
  62. </td>
  63. </tr>
  64. {% endfor %}
  65. </tbody>
  66. </table>
  67. </div>
  68. </div>
  69. {% for setting in context.settings %}
  70. <div class="modal fade" id="setting-{{ loop.index0 }}" tabindex="-1">
  71. <div class="modal-dialog modal-dialog-centered">
  72. <div class="modal-content">
  73. <form action="" method="post">
  74. <div class="modal-header bg-light">
  75. <h1 class="modal-title fs-5">Edit {{ setting.name}}</h1>
  76. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  77. </div>
  78. <div class="modal-body">
  79. <div class="mb-3">
  80. <label for="value" class="form-label">{{ setting.name}}</label>
  81. {% if setting.name == 'SMTP Password' %}
  82. <input type="password" class="form-control" id="value" name="value" value="" required>
  83. {% else %}
  84. <input type="text" class="form-control" id="value" name="value" value="{{ setting.value }}" required>
  85. {% endif %}
  86. <input type="hidden" name="id" value="{{ setting.id }}" required>
  87. </div>
  88. </div>
  89. <div class="modal-footer bg-light">
  90. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  91. <input type="submit" class="btn btn-primary" value="Save">
  92. </div>
  93. </form>
  94. </div>
  95. </div>
  96. </div>
  97. {% endfor %}
  98. <div class="modal fade" id="email-test" tabindex="-1">
  99. <div class="modal-dialog modal-dialog-centered">
  100. <div class="modal-content">
  101. <form action="{{ url_for('test_email') }}" method="post">
  102. <div class="modal-header bg-light">
  103. <h1 class="modal-title fs-5">Test Email Settings</h1>
  104. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  105. </div>
  106. <div class="modal-body">
  107. <div class="mb-3">
  108. <label for="value" class="form-label">Email Address to send to</label>
  109. <input type="text" class="form-control" id="email" name="email" value="" required>
  110. </div>
  111. </div>
  112. <div class="modal-footer bg-light">
  113. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  114. <input type="submit" class="btn btn-primary" value="Save">
  115. </div>
  116. </form>
  117. </div>
  118. </div>
  119. </div>
  120. {% endblock %}