settings.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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="row">
  25. <div class="col">
  26. <table class="table table-flush">
  27. <thead>
  28. <tr>
  29. <th scope="col">Name</th>
  30. <th scope="col">Value</th>
  31. <th scope="col">Actions</th>
  32. </tr>
  33. </thead>
  34. <tbody>
  35. {% for setting in context.settings %}
  36. <tr>
  37. <td>{{ setting.name }}</td>
  38. {% if setting.name == 'SMTP Password' %}
  39. <td>
  40. {% if setting.value == "" %}
  41. <i>Password not set</i>
  42. {% else %}
  43. <i>Password set</i>
  44. {% endif %}
  45. </td>
  46. {% else %}
  47. <td>{{ setting.value }}</td>
  48. {% endif %}
  49. <td>
  50. {% if setting.name == 'Password Reset Interval' %}
  51. {% if context.suspend_setting == "false" %}
  52. <a href="#!" class="disabled btn btn-primary">Edit</a>
  53. {% else %}
  54. <a href="#!" data-bs-toggle="modal" data-bs-target="#setting-{{ loop.index0 }}" class="btn btn-primary">Edit</a>
  55. {% endif %}
  56. {% else %}
  57. <a href="#!" data-bs-toggle="modal" data-bs-target="#setting-{{ loop.index0 }}" class="btn btn-primary">Edit</a>
  58. {% endif %}
  59. </td>
  60. </tr>
  61. {% endfor %}
  62. </tbody>
  63. </table>
  64. </div>
  65. </div>
  66. {% for setting in context.settings %}
  67. <div class="modal fade" id="setting-{{ loop.index0 }}" tabindex="-1">
  68. <div class="modal-dialog modal-dialog-centered">
  69. <div class="modal-content">
  70. <form action="" method="post">
  71. <div class="modal-header bg-light">
  72. <h1 class="modal-title fs-5">Edit {{ setting.name}}</h1>
  73. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  74. </div>
  75. <div class="modal-body">
  76. <div class="mb-3">
  77. <label for="value" class="form-label">{{ setting.name}}</label>
  78. {% if setting.name == 'SMTP Password' %}
  79. <input type="password" class="form-control" id="value" name="value" value="" required>
  80. {% else %}
  81. <input type="text" class="form-control" id="value" name="value" value="{{ setting.value }}" required>
  82. {% endif %}
  83. <input type="hidden" name="id" value="{{ setting.id }}" required>
  84. </div>
  85. </div>
  86. <div class="modal-footer bg-light">
  87. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  88. <input type="submit" class="btn btn-primary" value="Save">
  89. </div>
  90. </form>
  91. </div>
  92. </div>
  93. </div>
  94. {% endfor %}
  95. {% endblock %}