Fix: Gmail SMTP guidance, registration form field, and conditional admin auto-refresh

This commit is contained in:
ske087
2025-07-27 00:15:39 +03:00
parent 377e379883
commit c9c3c80f4f
4 changed files with 45 additions and 6 deletions

View File

@@ -229,10 +229,18 @@
document.getElementById('sidebar').classList.toggle('show');
});
// Auto-refresh stats every 30 seconds
setTimeout(function() {
location.reload();
}, 30000);
// Conditional auto-refresh logic
{% if request.endpoint == 'admin.mail_settings' %}
{% if settings and settings.enabled %}
setTimeout(function() {
location.reload();
}, 30000);
{% endif %}
{% else %}
setTimeout(function() {
location.reload();
}, 30000);
{% endif %}
</script>
</body>
</html>

View File

@@ -1,6 +1,18 @@
{% extends 'admin/base.html' %}
{% block admin_content %}
<h2>Mail Server Settings</h2>
<div class="alert alert-info" style="max-width:600px;">
<strong>Recommended Gmail SMTP Settings:</strong><br>
<ul style="margin-bottom:0;">
<li><b>Server:</b> smtp.gmail.com</li>
<li><b>Port:</b> 587</li>
<li><b>Use TLS:</b> True</li>
<li><b>Username:</b> your Gmail address (e.g. yourname@gmail.com)</li>
<li><b>Password:</b> your Gmail <b>App Password</b> (not your regular password)</li>
<li><b>Default sender:</b> your Gmail address (e.g. yourname@gmail.com)</li>
</ul>
<small>To use Gmail SMTP, you must create an <a href="https://myaccount.google.com/apppasswords" target="_blank">App Password</a> in your Google Account security settings.</small>
</div>
<form method="post">
<div class="form-group">
<label for="enabled">Enable Email Sending</label>