feat: add FAQ question form with email notifications and validations
All checks were successful
Build and Push Docker Image / build (push) Successful in 43s
All checks were successful
Build and Push Docker Image / build (push) Successful in 43s
- Created `FaqQuestionForm` in `forms.py` with custom field validations - Added FAQ form to the FAQ section with CSRF protection and error handling - Integrated email notifications to administrator upon FAQ submission - Updated styles and scripts for form inputs, validation messages, and messages UI - Adjusted FAQ section layout in `faq.html` and related CSS for responsiveness - Implemented tests for FAQ form submission and email notifications
This commit is contained in:
@@ -20,7 +20,36 @@
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% if messages %}
|
||||
<div class="site-toast-stack" aria-live="polite" aria-atomic="true">
|
||||
{% for message in messages %}
|
||||
<div class="site-toast site-toast--{{ message.tags }}" data-toast>
|
||||
<div class="site-toast__content">{{ message }}</div>
|
||||
<button class="site-toast__close" type="button" aria-label="Закрыть уведомление" data-toast-close>×</button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
document.querySelectorAll('[data-toast]').forEach(function (toast) {
|
||||
const closeButton = toast.querySelector('[data-toast-close]')
|
||||
const hideToast = function () {
|
||||
toast.classList.add('is-hiding')
|
||||
window.setTimeout(function () {
|
||||
toast.remove()
|
||||
}, 220)
|
||||
}
|
||||
|
||||
if (closeButton) {
|
||||
closeButton.addEventListener('click', hideToast)
|
||||
}
|
||||
|
||||
window.setTimeout(hideToast, 4000)
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user