diff --git a/static/aerbimCSS.css b/static/aerbimCSS.css index ea9045f..7b1c839 100644 --- a/static/aerbimCSS.css +++ b/static/aerbimCSS.css @@ -480,6 +480,10 @@ body.n_scroll{ flex-direction: row-reverse; } +.container_input{ + margin-bottom: 25px; +} + .input_form_feedback{ border: none; border-bottom: 1px solid #E3E3E3; @@ -491,7 +495,6 @@ body.n_scroll{ outline: none; padding-bottom: 5px; padding-left: 20px; - margin-bottom: 25px; } .input_form_feedback.error{ @@ -571,7 +574,7 @@ body.n_scroll{ } .check_box_form_feedback{ - border: 1px solid #9a9a9a; + border: 1px solid #000000; background: none; display: inline-block; width: 15px; @@ -579,6 +582,9 @@ body.n_scroll{ outline: none; margin: 6px 0; } +.check_box_form_feedback.error{ + border: 1px solid #FF3F20; +} .label_feedback_form_checkbox{ font-size: 12px; @@ -587,6 +593,9 @@ body.n_scroll{ width: 90%; float: right; } +.label_feedback_form_checkbox.error{ + color: #FF3F20; +} /* block plugin*/ @@ -1221,4 +1230,16 @@ body.n_scroll{ border: 1px solid #E3E3E3; background: #FFF; box-shadow: 1px 1px 2px 0 rgba(151, 167, 176, 0.20); -} \ No newline at end of file +} + +/* errors */ +.error_input_html{ + color: #FF3F20; + padding: 10px 0 0 0; +} + +.error_input_html ul,li{ + padding: 0; + margin: 0; + list-style: none; +} diff --git a/static/aerbimJS.js b/static/aerbimJS.js index 6f1df07..5947561 100644 --- a/static/aerbimJS.js +++ b/static/aerbimJS.js @@ -253,7 +253,29 @@ function sendFormfeedback (el){ document.querySelector(".container_content_form_feedback").innerHTML = data.html }, error: function (data){ - document.querySelector(".container_content_form_feedback").innerHTML = data.responseJSON.html + document.querySelector(".form_feedback_content").innerHTML = data.responseJSON.left_form_html + document.querySelector(".checkbox_container").innerHTML = data.responseJSON.right_form_html } }); +} + +function deleteErrorsInput (el) { + let parent = el.parentNode + let errors_container = parent.querySelector(".error_input_html") + if (errors_container){ + let input = parent.querySelector(".input_form_feedback") + let checkbox_label = parent.querySelector(".label_feedback_form_checkbox") + if (input){ + input.classList.remove('error') + } else if (checkbox_label){ + checkbox_label.classList.remove("error") + } else { + let textarea = document.querySelector(".textarea_form_feedback") + textarea.classList.remove("error") + } + + let str = errors_container.outerHTML + str = str.replace(str,'') + errors_container.outerHTML = str + } } \ No newline at end of file diff --git a/templates/widgets/elements_form_feedback.html b/templates/widgets/elements_form_feedback.html index 533ed4c..eae1735 100644 --- a/templates/widgets/elements_form_feedback.html +++ b/templates/widgets/elements_form_feedback.html @@ -1,8 +1,19 @@ {% load static %} - -
- - - - \ No newline at end of file +
+ + {% if feedback_form.errors.name %}
{{ feedback_form.errors.name }}
{% endif %} +
+
+ + {% if feedback_form.errors.company %}
{{ feedback_form.errors.company }}
{% endif %} +
+
+ + {% if feedback_form.errors.contacts %}
{{ feedback_form.errors.contacts }}
{% endif %} +
+
+ + + {% if feedback_form.errors.description %}
{{ feedback_form.errors.description }}
{% endif %} +
\ No newline at end of file diff --git a/templates/widgets/w_checkbox_f_feedback.html b/templates/widgets/w_checkbox_f_feedback.html index e37c8dc..f186fed 100644 --- a/templates/widgets/w_checkbox_f_feedback.html +++ b/templates/widgets/w_checkbox_f_feedback.html @@ -1,4 +1,5 @@ {% load static %} - - + + +{% if feedback_form.errors.company %}
{% endif %}
\ No newline at end of file