diff --git a/AuthApp/forms.py b/AuthApp/forms.py index c66debf..498fa5a 100644 --- a/AuthApp/forms.py +++ b/AuthApp/forms.py @@ -34,9 +34,9 @@ class RegistrationForm(forms.Form): i = 0 names = list(cleaned_data.keys()) while i < len(names): - # for name, val in cleaned_data.items(): if not cleaned_data[names[i]]: - self.add_error(names[i], _('Обязательное поле')) + if self.fields[names[i]].required: + self.add_error(names[i], _('Обязательное поле')) i += 1 if cleaned_data and 'confirm_password' in cleaned_data and 'password' in cleaned_data: diff --git a/static/css/styles.css b/static/css/styles.css index ca1ae6d..e5b3b52 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -821,13 +821,15 @@ section.register>form { } .agree { - display: flex; + /*display: flex;*/ margin-bottom: 40px; align-items: end; + display: inline-block; } .agree>.checkbox{ width: 50px; + display: inline-block; } .agree_text { @@ -837,6 +839,8 @@ section.register>form { font-style: normal; font-weight: 400; line-height: 20px; + display: inline-block; + width: 90%; } .button_register>button { @@ -1370,14 +1374,14 @@ h2.title_new_route{ width: 100%; } .errorlist{ - position: absolute; + /*position: absolute;*/ } .errorlist>li{ color:red; margin-left: 12px; - font-size: 14px; + font-size: 12px; } span.errorlist{ color: red; @@ -1670,6 +1674,12 @@ div.departure_arrival>div>input{ .input_list .hide{ display: none; } +span.hide{ + display: none; +} +#agreement_check.hide{ + display: none; +} diff --git a/static/js/user_profile.js b/static/js/user_profile.js index 7031b6a..8a13392 100644 --- a/static/js/user_profile.js +++ b/static/js/user_profile.js @@ -963,16 +963,17 @@ function hideErrors(el) { let counter_text = document.querySelector('.counter-text') let footer_button = document.getElementById('footer_input_button') let error_footer = document.getElementById('error_footer') + let agree_error = document.getElementById('reg_agree_error') if(error_feeedback === counter_text && error_feeedback !== null && error_feeedback_text !== null ){ error_feeedback_text.classList.add('hide') } else if(error_feeedback === footer_button && error_footer !== null ){ error_footer.classList.add('hide') - } - - else if(error_feeedback !== null) { + } else if(error_feeedback !== null) { error_feeedback.classList.add('hide') + } else if(el.id === 'agreement_check'){ + agree_error.classList.add('hide') } diff --git a/templates/forms/f_registration.html b/templates/forms/f_registration.html index acd5de3..13a4cb4 100644 --- a/templates/forms/f_registration.html +++ b/templates/forms/f_registration.html @@ -15,52 +15,97 @@
- + + {% if form.errors and form.errors.firstname %} - {{ form.errors.firstname }} + {{ form.errors.firstname }} {% endif %} -
-
- {% if form.errors and form.errors.lastname %} - {{ form.errors.lastname }} - {% endif %} -
-
-
-
- {% if form.errors and form.errors.email %} - {{ form.errors.email }} - {% endif %} -
-
- {% if form.errors and form.errors.tel %} - {{ form.errors.tel }} - {% endif %} -
-
-
-
- {% if form.errors and form.errors.password %} - {{ form.errors.password }} - {% endif %} -
-
- {% if form.errors and form.errors.confirm_password %} - {{ form.errors.confirm_password }} - {% endif %} -
-
-
-
- -
- {% if form.errors and form.errors.agreement %} - {{ form.errors.agreement }} - {% endif %} -
{% translate "Регистрируясь, я соглашаюсь с Лицензионным соглашениеми и Политикой конфиденциальности" %}
+
+ + {% if form.errors and form.errors.lastname %} + {{ form.errors.lastname }} + {% endif %} +
+
+
+
+ + + {% if form.errors and form.errors.email %} + {{ form.errors.email }} + {% endif %} +
+ +
+ + {% if form.errors and form.errors.tel %} + {{ form.errors.tel }} + {% endif %} +
+
+ +
+
+ + + {% if form.errors and form.errors.password %} + {{ form.errors.password }} + {% endif %} +
+ +
+ + {% if form.errors and form.errors.confirm_password %} + {{ form.errors.confirm_password }} + {% endif %} +
+ +
+
+ +
+ + + +
+
{% translate "Регистрируясь, я соглашаюсь с Лицензионным соглашениеми и Политикой конфиденциальности" %}
+ {% if form.errors and form.errors.agreement %} + {{ form.errors.agreement }} + {% endif %} +
diff --git a/templates/widgets/w_message.html b/templates/widgets/w_message.html index b7a32b0..d5244aa 100644 --- a/templates/widgets/w_message.html +++ b/templates/widgets/w_message.html @@ -8,15 +8,8 @@
- {% if msg.text %} - - {{ msg.text }} - - {% elif ticket %} - - {{ ticket.text }} - - {% elif msg.files %} + + {% if msg.files %} {% for file in msg.files %}
@@ -29,6 +22,15 @@
{% endfor %} + + {% elif msg.text %} + + {{ msg.text }} + + {% elif ticket and ticket.text %} + + {{ ticket.text }} + {% endif %}