From cba94595f1eccf3ee1bd768944833ef153683be7 Mon Sep 17 00:00:00 2001 From: borissedw Date: Sat, 23 Sep 2023 18:01:19 +0300 Subject: [PATCH] 0.0.264 --- static/css/styles(boris).css | 7 +- .../etc_operations_for_chat_socket.js | 3 + static/js/range_calendar.js | 93 +++++++++++-------- static/js/user_profile.js | 64 +++++++++++++ templates/blocks/profile/b_new_route.html | 28 ++++-- 5 files changed, 144 insertions(+), 51 deletions(-) diff --git a/static/css/styles(boris).css b/static/css/styles(boris).css index baaf0ac..f5fcc14 100644 --- a/static/css/styles(boris).css +++ b/static/css/styles(boris).css @@ -468,8 +468,13 @@ background-repeat: no-repeat; background-position: center; position: relative; - bottom: 6px; display: inline-block; + margin-bottom: 0; + bottom: 6px; +} +.attach-file-btn-message.loader{ + top: 10px; + bottom: 0; } .send-message{ diff --git a/static/js/chat_socket_functions/etc_operations_for_chat_socket.js b/static/js/chat_socket_functions/etc_operations_for_chat_socket.js index eaa59f4..543ab89 100644 --- a/static/js/chat_socket_functions/etc_operations_for_chat_socket.js +++ b/static/js/chat_socket_functions/etc_operations_for_chat_socket.js @@ -19,13 +19,16 @@ function play_required_beep (data,beep) { function loader_show_message (data) { let loader = document.querySelector(".loader_show_message"); let send_btn = document.querySelector(".send-message") + let at = document.querySelector(".attach-file-btn-message") if (loader){ if (loader.classList.contains("show")){ send_btn.classList.remove("hide") loader.classList.remove("show") + at.classList.remove("loader") } else { send_btn.classList.add("hide") loader.classList.add("show") + at.classList.add("loader") } } else { diff --git a/static/js/range_calendar.js b/static/js/range_calendar.js index cee0d14..30d0a70 100644 --- a/static/js/range_calendar.js +++ b/static/js/range_calendar.js @@ -44,55 +44,68 @@ // } // }); -$(function() { +$(function () { + let onl_param = "" + if (window.location.href === "http://localhost:8016/ru/profile/page/create_route_for_mover/" || window.location.href === "http://localhost:8016/ru/profile/page/create_route_for_customer/"){ + onl_param = "singleDatePicker: true" + } let place_1 = document.querySelector("#id_arrival_DT") - $(place_1).daterangepicker({ - "autoapply": true, - "linkedCalendars": false, - }, - function(start, end, label) { + if (place_1) { + $(place_1).daterangepicker({ + "autoapply": true, + "linkedCalendars": false, - // $('#displayRegervation').text('Registration date is: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD')); - $('#id_arrival_DT').val(start.format('DD.MM.YYYY') + " - " + end.format('DD.MM.YYYY')) - }); + }, + function (start, end, label) { - $(`${place_1.id} .drp-calendar.right`).hide(); - $(`${place_1.id} .drp-calendar.left`).addClass('single'); + // $('#displayRegervation').text('Registration date is: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD')); + $('#id_arrival_DT').val(start.format('DD.MM.YYYY') + " - " + end.format('DD.MM.YYYY')) + }); - $(`${place_1.id} .calendar-table`).on('DOMSubtreeModified', function() { - var el = $(`${place_1.id} .prev.available`).parent().children().last(); - if (el.hasClass('next available')) { - return; - } - el.addClass('next available'); - el.append(''); - }); + $(`${place_1.id} .drp-calendar.right`).hide(); + $(`${place_1.id} .drp-calendar.left`).addClass('single'); + + $(`${place_1.id} .calendar-table`).on('DOMSubtreeModified', function () { + var el = $(`${place_1.id} .prev.available`).parent().children().last(); + if (el.hasClass('next available')) { + return; + } + el.addClass('next available'); + el.append(''); + }); + } }); $(function() { let place_1 = document.querySelector("#id_departure_DT") - $(place_1).daterangepicker({ - "autoapply": true, - "linkedCalendars": false, - }, - function(start, end, label) { - // $('#displayRegervation').text('Registration date is: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD')); - // $('#regervation')[0].dataset['departure_DT'] = start.format('YYYY-MM-DD'); - // $('#regervation')[0].dataset['arrival_DT'] = end.format('YYYY-MM-DD'); - $('#id_departure_DT').val(start.format('DD.MM.YYYY') + " - " + end.format('DD.MM.YYYY')) + let onl_param = "" + if (window.location.href === "http://localhost:8016/ru/profile/page/create_route_for_mover/" || window.location.href === "http://localhost:8016/ru/profile/page/create_route_for_customer/"){ + onl_param = "singleDatePicker: true" + } + if (place_1) { + $(place_1).daterangepicker({ + "autoapply": true, + "linkedCalendars": false, + onl_param + }, + function(start, end, label) { + // $('#displayRegervation').text('Registration date is: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD')); + // $('#regervation')[0].dataset['departure_DT'] = start.format('YYYY-MM-DD'); + // $('#regervation')[0].dataset['arrival_DT'] = end.format('YYYY-MM-DD'); + $('#id_departure_DT').val(start.format('DD.MM.YYYY') + " - " + end.format('DD.MM.YYYY')) - }); + }); - $(`${place_1.id} .drp-calendar.right`).hide(); - $(`${place_1.id} .drp-calendar.left`).addClass('single'); - - $(`${place_1.id} .calendar-table`).on('DOMSubtreeModified', function() { - var el = $(`${place_1.id} .prev.available`).parent().children().last(); - if (el.hasClass('next available')) { - return; - } - el.addClass('next available'); - el.append(''); - }); + $(`${place_1.id} .drp-calendar.right`).hide(); + $(`${place_1.id} .drp-calendar.left`).addClass('single'); + $(`${place_1.id} .calendar-table`).on('DOMSubtreeModified', function() { + var el = $(`${place_1.id} .prev.available`).parent().children().last(); + if (el.hasClass('next available')) { + return; + } + el.addClass('next available'); + el.append(''); + }); + } }); \ No newline at end of file diff --git a/static/js/user_profile.js b/static/js/user_profile.js index 730dba8..0a08186 100644 --- a/static/js/user_profile.js +++ b/static/js/user_profile.js @@ -572,7 +572,71 @@ function OnSelectionChange(el) { // checkbox_width.classList.add('width') // } sliderInit(); + $(function () { + let onl_param = "" + if (window.location.href === "http://localhost:8016/ru/profile/page/create_route_for_mover/" || window.location.href === "http://localhost:8016/ru/profile/page/create_route_for_customer/"){ + onl_param = "singleDatePicker: true" + } + let place_1 = document.querySelector("#id_arrival_DT") + if (place_1) { + $(place_1).daterangepicker({ + "autoapply": true, + "linkedCalendars": false, + }, + function (start, end, label) { + + // $('#displayRegervation').text('Registration date is: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD')); + $('#id_arrival_DT').val(start.format('DD.MM.YYYY') + " - " + end.format('DD.MM.YYYY')) + }); + + $(`${place_1.id} .drp-calendar.right`).hide(); + $(`${place_1.id} .drp-calendar.left`).addClass('single'); + + $(`${place_1.id} .calendar-table`).on('DOMSubtreeModified', function () { + var el = $(`${place_1.id} .prev.available`).parent().children().last(); + if (el.hasClass('next available')) { + return; + } + el.addClass('next available'); + el.append(''); + }); + } + }); + + $(function() { + let place_1 = document.querySelector("#id_departure_DT") + let onl_param = "" + if (window.location.href === "http://localhost:8016/ru/profile/page/create_route_for_mover/" || window.location.href === "http://localhost:8016/ru/profile/page/create_route_for_customer/"){ + onl_param = "singleDatePicker: true" + } + if (place_1) { + $(place_1).daterangepicker({ + "autoapply": true, + "linkedCalendars": false, + onl_param + }, + function(start, end, label) { + // $('#displayRegervation').text('Registration date is: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD')); + // $('#regervation')[0].dataset['departure_DT'] = start.format('YYYY-MM-DD'); + // $('#regervation')[0].dataset['arrival_DT'] = end.format('YYYY-MM-DD'); + $('#id_departure_DT').val(start.format('DD.MM.YYYY') + " - " + end.format('DD.MM.YYYY')) + + }); + + $(`${place_1.id} .drp-calendar.right`).hide(); + $(`${place_1.id} .drp-calendar.left`).addClass('single'); + + $(`${place_1.id} .calendar-table`).on('DOMSubtreeModified', function() { + var el = $(`${place_1.id} .prev.available`).parent().children().last(); + if (el.hasClass('next available')) { + return; + } + el.addClass('next available'); + el.append(''); + }); + } + }); } }); diff --git a/templates/blocks/profile/b_new_route.html b/templates/blocks/profile/b_new_route.html index e4849d6..4441063 100644 --- a/templates/blocks/profile/b_new_route.html +++ b/templates/blocks/profile/b_new_route.html @@ -71,6 +71,10 @@ placeholder="Выберите дату и время" {% if form.initial.departure_DT %}value="{{ form.initial.departure_DT.date|date:"Y-m-d" }}T{{ form.initial.departure_DT.time|date:"H:i" }}"{% endif %} /> + {# boris change input #} + +
+ {# end #} {% if not errors_off and form.errors and form.errors.departure_DT %} {{ form.errors.departure_DT }} @@ -79,16 +83,20 @@
- +{# #} + {# boris change input #} + +
+ {# end #} {% if not errors_off and form.errors and form.errors.arrival_DT %} {{ form.errors.arrival_DT }} {% endif %}