From d14a46d3d7077d2a297e8fe81290528582b9945d Mon Sep 17 00:00:00 2001 From: ArtemB Date: Wed, 6 Dec 2023 15:51:55 +0300 Subject: [PATCH 1/8] 0.0.319 upd create_route, header_buttons alight --- static/css/mobile_styles.css | 7 +-- static/css/styles.css | 8 +-- static/js/user_profile.js | 61 ++++++++++++----------- templates/blocks/b_header.html | 2 +- templates/blocks/profile/b_new_route.html | 17 ++++--- 5 files changed, 53 insertions(+), 42 deletions(-) diff --git a/static/css/mobile_styles.css b/static/css/mobile_styles.css index 295b63d..59e3b69 100644 --- a/static/css/mobile_styles.css +++ b/static/css/mobile_styles.css @@ -120,6 +120,9 @@ font-size: 29px; line-height: 33px; } + .header_buttons{ + display: none; + } .not_found_routes>img{ display: none; @@ -1796,9 +1799,7 @@ height: 30px; } - .header_buttons{ - display: none; - } + /*.to_address_point_txt.find_route {*/ /* width: 48.4%;*/ /*}*/ diff --git a/static/css/styles.css b/static/css/styles.css index 6e93135..3b16274 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -635,7 +635,8 @@ header .header-second { .button_profile_header_mobile{ display: none; - cursor: pointer; + cursor: pointer; + vertical-align: middle; } .route_contact_avatar{ @@ -764,7 +765,7 @@ span.btn_profile_name { /*END Language select*/ -.header-second>div>img{ +#support_img{ margin-right: 5px; margin-left: 40px; } @@ -1424,6 +1425,7 @@ span.errorlist{ /*create new route*/ select#id_type_transport{ + cursor: pointer; display: block; height: 60px; width: 47%; @@ -1703,7 +1705,7 @@ div.departure_arrival>div>input{ .input_list .hide{ display: none; } -span.hide{ +span.hide, .error_to_address_point.hide, #id_cargo_lable.hide, #error_id_phone.hide{ display: none; } #agreement_check.hide{ diff --git a/static/js/user_profile.js b/static/js/user_profile.js index 4d2a9f3..5fda6f5 100644 --- a/static/js/user_profile.js +++ b/static/js/user_profile.js @@ -598,13 +598,13 @@ function sendRoute(el, routeID = null){ -function validate(el) { - if (el.checked) { - console.log('cheked', el.id); - } else { - console.log("You didn't check it! Let me check it for you.", el.id); - } -} +// function validate(el) { +// if (el.checked) { +// console.log('cheked', el.id); +// } else { +// console.log("You didn't check it! Let me check it for you.", el.id); +// } +// } @@ -962,33 +962,38 @@ function hideErrors(el) { let agree_error = document.getElementById('reg_agree_error') let error_departure_DT = document.getElementById('error_departure_DT') let error_arrival_DT = document.getElementById('error_arrival_DT') - - - - - 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(el.id === 'agreement_check'){ - agree_error.classList.add('hide') - } else if(el.id === 'id_arrival_DT' && error_arrival_DT !== null){ - error_arrival_DT.classList.add('hide') - }else if(el.id === 'id_departure_DT' && error_departure_DT !== null){ - error_departure_DT.classList.add('hide') - } else if(error_feeedback !== null) { - error_feeedback.classList.add('hide') - } + let error_from_address_point = document.getElementById('error_from_address_point') + let error_to_address_point = document.getElementById('error_to_address_point') + let error_cargo_type = document.getElementById('error_cargo_type') + let error_id_phone = document.getElementById('error_id_phone') + 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(el.id === 'agreement_check'){ + agree_error.classList.add('hide') + } else if(el.id === 'id_arrival_DT' && error_arrival_DT !== null){ + error_arrival_DT.classList.add('hide') + }else if(el.id === 'id_departure_DT' && error_departure_DT !== null){ + error_departure_DT.classList.add('hide') + } else if(el.id === 'id_from_address_point_txt' && error_from_address_point !== null ){ + error_from_address_point.classList.add('hide') + }else if(el.id === 'id_to_address_point_txt' && error_to_address_point !== null ){ + error_to_address_point.classList.add('hide') + } else if(el.id === 'id_cargo_lable' && error_cargo_type !== null){ + error_cargo_type.classList.add('hide') + } else if(el.id === 'id_phone' && error_id_phone !==null){ + error_id_phone.classList.add('hide') + } - // if(el.nextElementSibling === errorFeeedback){ - // errorFeeedback.classList.add('hide') - // } - + else if(error_feeedback !== null) { + error_feeedback.classList.add('hide') + } } diff --git a/templates/blocks/b_header.html b/templates/blocks/b_header.html index c06c87e..04e84ba 100644 --- a/templates/blocks/b_header.html +++ b/templates/blocks/b_header.html @@ -52,7 +52,7 @@
- +
{% trans "Служба поддержки" %} diff --git a/templates/blocks/profile/b_new_route.html b/templates/blocks/profile/b_new_route.html index 4b2a114..2e0afe0 100644 --- a/templates/blocks/profile/b_new_route.html +++ b/templates/blocks/profile/b_new_route.html @@ -139,10 +139,10 @@ onclick="showSearchList(this)" onblur="onblurInputField(event, this)" onfocus="clearID(this)" + onkeydown = "hideErrors(this)" autocomplete="off" type="text" minlength="3" - name="from_address_point_txt" class="from_address_point_txt post_route el_form_b_new_route" {% if form.fields.from_address_point.required %} required{% endif %} @@ -158,7 +158,7 @@
{% if not errors_off and form.errors and form.errors.from_address_point %} - {{ form.errors.from_address_point}} + {{ form.errors.from_address_point}} {% endif %}
@@ -175,7 +175,7 @@ oninput="searchTown(this)" onclick="showSearchList(this)" onblur="onblurInputField(event, this)" - + onkeydown = "hideErrors(this)" onfocus="clearID(this)" autocomplete="off" type="text" @@ -191,7 +191,7 @@
{% if not errors_off and form.errors and form.errors.to_address_point %} - {{ form.errors.to_address_point }} + {{ form.errors.to_address_point }} {% endif %}
@@ -264,6 +264,7 @@ class="custom-checkbox cargo_check" type="radio" name="cargo_type" + id="id_cargo_type_{{ forloop.counter }}" {% if form.fields.cargo_type.required %} required{% endif %} value="{{ item.0 }}" @@ -273,7 +274,8 @@ /> @@ -282,7 +284,7 @@ {% if not errors_off and form.errors and form.errors.cargo_type %} - {{ form.errors.cargo_type }} + {{ form.errors.cargo_type }} {% endif %} @@ -332,6 +334,7 @@ {% if not errors_off and form.errors and form.errors.phone %} - {{ form.errors.phone }} + {{ form.errors.phone }} {% endif %} From fd3612c37020994fadb1453662015c966261cad6 Mon Sep 17 00:00:00 2001 From: ArtemB Date: Wed, 6 Dec 2023 18:03:48 +0300 Subject: [PATCH 2/8] 0.0.320 --- static/css/styles(boris).css | 2 +- static/js/user_profile.js | 8 ++++++++ templates/blocks/profile/b_new_route.html | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/static/css/styles(boris).css b/static/css/styles(boris).css index 8454d87..e1d7cab 100644 --- a/static/css/styles(boris).css +++ b/static/css/styles(boris).css @@ -1232,7 +1232,7 @@ } .not_found_routes{ - width: 98%; + width: 96%; height: 250px; background: #FFFFFF; box-shadow: -1px 4px 10px 0 rgba(198, 199, 203, 0.20), 0 -1px 10px 0 rgba(198, 199, 203, 0.20); diff --git a/static/js/user_profile.js b/static/js/user_profile.js index 5fda6f5..4e7e7a8 100644 --- a/static/js/user_profile.js +++ b/static/js/user_profile.js @@ -606,6 +606,14 @@ function sendRoute(el, routeID = null){ // } // } +function setIcon(el) { + if(el.id === 'id_departure_DT' ){ + document.getElementById('id_departure_DT').style.background = 'url("/static/img/svg/IconCalendar.svg") white 98% no-repeat'; + + } + +} + diff --git a/templates/blocks/profile/b_new_route.html b/templates/blocks/profile/b_new_route.html index 2e0afe0..0586018 100644 --- a/templates/blocks/profile/b_new_route.html +++ b/templates/blocks/profile/b_new_route.html @@ -77,7 +77,8 @@ {# boris change input #} Date: Thu, 7 Dec 2023 16:54:57 +0300 Subject: [PATCH 3/8] 0.0.321 --- templates/blocks/profile/b_new_route.html | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/templates/blocks/profile/b_new_route.html b/templates/blocks/profile/b_new_route.html index 0586018..0ef540a 100644 --- a/templates/blocks/profile/b_new_route.html +++ b/templates/blocks/profile/b_new_route.html @@ -56,11 +56,23 @@ {% endif %} + + {% if form.initial and form.initial.type_transport and form.initial.type_transport != '' %}
- + {# Date: Thu, 7 Dec 2023 18:35:06 +0300 Subject: [PATCH 4/8] 0.8.37 owner_type initial --- AuthApp/funcs.py | 4 ++-- RoutesApp/funcs.py | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/AuthApp/funcs.py b/AuthApp/funcs.py index c2f226e..aa77bc8 100644 --- a/AuthApp/funcs.py +++ b/AuthApp/funcs.py @@ -18,10 +18,10 @@ def get_profile_page_content_html(request, page_name, data): return get_chat_page_content_html(request, data) elif page_name == 'create_route_for_customer': from RoutesApp.funcs import get_profile_new_route_page_html - return get_profile_new_route_page_html(request, {}) + return get_profile_new_route_page_html(request, {'owner_type': 'customer'}) elif page_name == 'create_route_for_mover': from RoutesApp.funcs import get_profile_new_route_page_html - return get_profile_new_route_page_html(request, {}) + return get_profile_new_route_page_html(request, {'owner_type': 'mover'}) elif page_name == 'my_routes': from RoutesApp.funcs import get_profile_my_routes_page_content_html return get_profile_my_routes_page_content_html(request) diff --git a/RoutesApp/funcs.py b/RoutesApp/funcs.py index 34ceecc..dce7fd4 100644 --- a/RoutesApp/funcs.py +++ b/RoutesApp/funcs.py @@ -75,11 +75,17 @@ def get_profile_new_route_page_html(request, data): # if not form.is_valid(): # pass + if 'owner_type' in data: + form.initial['owner_type'] = data['owner_type'] + Dict = { 'form': form, 'errors_off': errors_off } + if 'owner_type' in data: + Dict.update({'owner_type': data['owner_type']}) + # print(form) except Exception as e: # form.errors.append({'__all__': f'Ошибка: {str(e)}'}) From 16e860a29f6b2b8acc0895cae9747ad483268af3 Mon Sep 17 00:00:00 2001 From: ArtemB Date: Tue, 12 Dec 2023 16:01:01 +0300 Subject: [PATCH 5/8] 0.0.322 upd lable for b_new_route.html --- static/css/styles.css | 4 ++ static/js/user_profile.js | 15 ++++- templates/blocks/profile/b_new_route.html | 75 ++++++++++++++++++----- 3 files changed, 78 insertions(+), 16 deletions(-) diff --git a/static/css/styles.css b/static/css/styles.css index 3b16274..1b3f676 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -1619,6 +1619,10 @@ div.departure_arrival>div>input{ } +#hide_owner_type{ + display: none; +} + /*end create new route*/ diff --git a/static/js/user_profile.js b/static/js/user_profile.js index 4e7e7a8..4d33ed2 100644 --- a/static/js/user_profile.js +++ b/static/js/user_profile.js @@ -620,9 +620,22 @@ function setIcon(el) { //cleaning route inputs after selection changes function OnSelectionChange(el) { event.preventDefault() - let form = el.form; + + // if (customer.classList.contains('selected')) { + // owner_type = form.dataset['customer'] + // } else if (mover.classList.contains('selected')) { + // owner_type = form.dataset['customer'] + // } + let owner_type_value = document.getElementById('hide_owner_type').value + + + let formData = new FormData(form); + let owner_type = owner_type_value + formData.set('owner_type', owner_type) + + // formData.set('owner_type', owner_type) // let data = {}; // data['csrfmiddlewaretoken'] = $('input[name="csrfmiddlewaretoken"]')[0].value; diff --git a/templates/blocks/profile/b_new_route.html b/templates/blocks/profile/b_new_route.html index 0ef540a..756a353 100644 --- a/templates/blocks/profile/b_new_route.html +++ b/templates/blocks/profile/b_new_route.html @@ -32,7 +32,7 @@ {#
#} - +{# #} {% if form.initial and form.initial.type_transport and form.initial.type_transport != '' %}
@@ -105,7 +105,19 @@
- + {#
- +
- + #}
- +
- +
From 001dd2cb8782c7773a422600472765b70da2d6e4 Mon Sep 17 00:00:00 2001 From: ArtemB Date: Tue, 12 Dec 2023 16:34:00 +0300 Subject: [PATCH 6/8] 0.0.323 --- templates/blocks/profile/b_buttons_menu_profile.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/blocks/profile/b_buttons_menu_profile.html b/templates/blocks/profile/b_buttons_menu_profile.html index b41ed8f..94a20bd 100644 --- a/templates/blocks/profile/b_buttons_menu_profile.html +++ b/templates/blocks/profile/b_buttons_menu_profile.html @@ -9,7 +9,7 @@ {%trans "Написать сообщение" as t_chats %} {%trans "Тех. поддержка" as t_support %} {%trans "Моя подписка" as t_subscribe %} -{%trans "Мой профиль" as t_change_profile %} +{%trans "Изменить профиль" as t_change_profile %} {%trans "Выход" as t_logout %} - + {% if form.initial and form.initial.type_transport and form.initial.type_transport != '' %}
From dc16ced786167fa6a209b3b7b450a6e8477bb3cf Mon Sep 17 00:00:00 2001 From: ArtemB Date: Tue, 12 Dec 2023 17:06:05 +0300 Subject: [PATCH 8/8] 0.0.325 hide scroll for mozilla --- static/css/styles(boris).css | 2 ++ static/css/styles.css | 1 + 2 files changed, 3 insertions(+) diff --git a/static/css/styles(boris).css b/static/css/styles(boris).css index e1d7cab..104637f 100644 --- a/static/css/styles(boris).css +++ b/static/css/styles(boris).css @@ -2550,6 +2550,7 @@ position: absolute; top: 293px; transition: 0ms; + scrollbar-width: none; } @@ -2674,6 +2675,7 @@ height: calc(100vh - 95px); max-height: 697px; background: #F8F8F8; + scrollbar-width: none; } .menu_profile.background{ diff --git a/static/css/styles.css b/static/css/styles.css index 1b3f676..b59593b 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -557,6 +557,7 @@ header .header-first { height: 390px; box-shadow: -1px 4px 10px 0px rgba(198, 199, 203, 0.20), 0px -1px 10px 0px rgba(198, 199, 203, 0.20); z-index: 1; + top: 30px; } .dropdown-content.show{ display:block;