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)}'}) 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(boris).css b/static/css/styles(boris).css index 8454d87..104637f 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); @@ -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 6e93135..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; @@ -635,7 +636,8 @@ header .header-second { .button_profile_header_mobile{ display: none; - cursor: pointer; + cursor: pointer; + vertical-align: middle; } .route_contact_avatar{ @@ -764,7 +766,7 @@ span.btn_profile_name { /*END Language select*/ -.header-second>div>img{ +#support_img{ margin-right: 5px; margin-left: 40px; } @@ -1424,6 +1426,7 @@ span.errorlist{ /*create new route*/ select#id_type_transport{ + cursor: pointer; display: block; height: 60px; width: 47%; @@ -1617,6 +1620,10 @@ div.departure_arrival>div>input{ } +#hide_owner_type{ + display: none; +} + /*end create new route*/ @@ -1703,7 +1710,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..4d33ed2 100644 --- a/static/js/user_profile.js +++ b/static/js/user_profile.js @@ -598,12 +598,20 @@ 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); +// } +// } + +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'; + + } + } @@ -612,9 +620,22 @@ function validate(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; @@ -962,33 +983,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 @@