From 4a8d2ad8c81ac580f1233cfd7141b7808eba5063 Mon Sep 17 00:00:00 2001 From: SDE Date: Wed, 16 Aug 2023 18:02:39 +0300 Subject: [PATCH 1/2] 0.3.26 support chat v3 --- ChatServiceApp/templatetags/tt_chat.py | 4 ++-- TWB/settings.py | 2 +- templates/tb_base.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ChatServiceApp/templatetags/tt_chat.py b/ChatServiceApp/templatetags/tt_chat.py index 39b644d..6a99e84 100644 --- a/ChatServiceApp/templatetags/tt_chat.py +++ b/ChatServiceApp/templatetags/tt_chat.py @@ -13,8 +13,8 @@ register = template.Library() # @register.filter('get_msg_side') @register.simple_tag -def get_ws_port(): - return settings.WS_PORT +def get_ws_address(): + return settings.WS_ADDRESS @register.simple_tag diff --git a/TWB/settings.py b/TWB/settings.py index 3f1b6aa..9877948 100644 --- a/TWB/settings.py +++ b/TWB/settings.py @@ -91,7 +91,7 @@ TEMPLATES = [ # WSGI_APPLICATION = 'TWB.wsgi.application' ASGI_APPLICATION = 'TWB.asgi.application' -WS_PORT = 8000 +WS_ADDRESS = 'localhost:8000' CHANNEL_LAYERS = { 'default': { diff --git a/templates/tb_base.html b/templates/tb_base.html index 136ec91..5d6c73a 100644 --- a/templates/tb_base.html +++ b/templates/tb_base.html @@ -12,7 +12,7 @@ From dd8551c0c6f87ca07e4d06e35275049ab1027ad4 Mon Sep 17 00:00:00 2001 From: borissedw Date: Thu, 17 Aug 2023 14:24:34 +0300 Subject: [PATCH 2/2] 0.0.150 --- static/css/styles(boris).css | 64 ++++++++++++++-- static/js/chat_sockets.js | 55 ++++++++++---- static/js/range_slider_double.js | 58 +++++++++++++++ templates/pages/p_results_find_route.html | 91 ++++++++++++++++++++--- 4 files changed, 236 insertions(+), 32 deletions(-) create mode 100644 static/js/range_slider_double.js diff --git a/static/css/styles(boris).css b/static/css/styles(boris).css index f8d28e0..2a49325 100644 --- a/static/css/styles(boris).css +++ b/static/css/styles(boris).css @@ -6,7 +6,9 @@ width: 100% !important; } - +.disp-none{ + display: none !important; +} .text-align-center{ text-align: center; @@ -689,6 +691,7 @@ flex-grow: 1; flex-shrink: 1; flex-basis: 0; + position: relative; } @@ -706,17 +709,58 @@ } -.inp_form_find_route_w_abbreviation.first{ +/*.inp_form_find_route_w_abbreviation.first{*/ +/* border-top: 1px solid #E6E6E6;*/ +/* border-right: 0;*/ +/* border-bottom: 1px solid #E6E6E6;*/ +/* border-left: 1px solid #E6E6E6;*/ +/* display: block;*/ +/* height: 97%;*/ +/* width: 73%;*/ +/* border-radius: 10px 0 0 10px;*/ +/* float: left;*/ +/*}*/ + +.from_address_point_txt.find_route.first{ + border-top: 1px solid #E6E6E6; + border-right: 0; + border-bottom: 1px solid #E6E6E6; + border-left: 1px solid #E6E6E6; + display: block; + height: 31%; + width: 58%; + float: left; + background-image: none !important; + margin-top: 0; + padding: 10% 6%; + border-radius: 10px 0 0 10px; +} + +.to_address_point_txt.find_route{ border-top: 1px solid #E6E6E6; border-right: 0; border-bottom: 1px solid #E6E6E6; border-left: 1px solid #E6E6E6; display: block; - height: 97%; - width: 73%; - border-radius: 10px 0 0 10px; + height: 31%; + width: 58%; + border-radius: 0; float: left; + background-image: none !important; + margin-top: 0; + padding: 10% 6%; +} +.input_list.find_route{ + width: 100%; + /* display: block; */ + border-radius: 0 10px; + top: 61px; + z-index: 12; +} + +.input_list.find_route.show{ + display: block; } .container_inp_w_abr{ @@ -781,7 +825,7 @@ .abbreviation_airport_in_search{ display: inline-block; float: right; - width: 26%; + width: 29%; height: 97%; border-top: 1px solid #E6E6E6; border-right: 1px solid #E6E6E6; @@ -791,7 +835,7 @@ .abbreviation_airport_in_search > text{ - margin-top: 43%; + margin-top: 39%; display: block; font-size: 16px; color: #27242499; @@ -1341,4 +1385,10 @@ } .insert-airports-place.show{ display: block; +} + +/* styles to-from-addres point*/ + +.from_address_point_txt.find_route{ + } \ No newline at end of file diff --git a/static/js/chat_sockets.js b/static/js/chat_sockets.js index 3f535cf..cd82ce9 100644 --- a/static/js/chat_sockets.js +++ b/static/js/chat_sockets.js @@ -85,6 +85,34 @@ chatSocket.onmessage = function (e) { } } } + if (data.tickets_w_manager_html) { + if (document.querySelector(".list_linked_tickets") !== null || document.querySelector(".list_unlinked_tickets") !== null) { + document.querySelector(".list_linked_tickets").innerHTML = data.tickets_w_manager_html + if (el_tab !== null){ + document.querySelector(".tab_user_messanger.select").classList.remove("select") + let old_insert_tab = document.querySelector(`[data-cur-receiver-item="${old_item_tab_user}"]`) + if (old_insert_tab) { + old_insert_tab.classList.add("select") + old_insert_tab.scrollIntoView({behavior: "smooth"}); + } + + } + let container_messenger = document.querySelector(".container-messages") + if (container_messenger){ + let dataset_cont_mes = container_messenger.dataset + if (dataset_cont_mes){ + let ticket_id = dataset_cont_mes["ticketId"] + if (ticket_id !== ""){ + let ticket = document.querySelector(`[data-cur-receiver-item="${ticket_id}"]`) + if (!ticket){ + let chat = document.querySelector(".block-chat").innerHTML = "" + } + } + } + } + } + + } if (data.tickets_wo_manager_html) { if (document.querySelector(".list_linked_tickets") !== null || document.querySelector(".list_unlinked_tickets") !== null) { document.querySelector(".list_unlinked_tickets").innerHTML = data.tickets_wo_manager_html @@ -98,24 +126,25 @@ chatSocket.onmessage = function (e) { old_insert_tab.classList.add("select") old_insert_tab.scrollIntoView({behavior: "smooth"}); } - } - } - } - if (data.tickets_w_manager_html) { - if (document.querySelector(".list_linked_tickets") !== null || document.querySelector(".list_unlinked_tickets") !== null) { - document.querySelector(".list_linked_tickets").innerHTML = data.tickets_w_manager_html - if (el_tab !== null){ - document.querySelector(".tab_user_messanger.select").classList.remove("select") - let old_insert_tab = document.querySelector(`[data-cur-receiver-item="${old_item_tab_user}"]`) - if (old_insert_tab) { - old_insert_tab.classList.add("select") - old_insert_tab.scrollIntoView({behavior: "smooth"}); + } + let container_messenger = document.querySelector(".container-messages") + if (container_messenger){ + let dataset_cont_mes = container_messenger.dataset + if (dataset_cont_mes){ + let ticket_id = dataset_cont_mes["ticketId"] + if (ticket_id !== ""){ + let ticket = document.querySelector(`[data-cur-receiver-item="${ticket_id}"]`) + if (!ticket){ + let chat = document.querySelector(".block-chat").innerHTML = "" + } + } } } } - } else { + } + else { let list_of_users = document.querySelector(".block-list-of-users") if (list_of_users !== null){ if (data.users_list_html){ diff --git a/static/js/range_slider_double.js b/static/js/range_slider_double.js new file mode 100644 index 0000000..505d721 --- /dev/null +++ b/static/js/range_slider_double.js @@ -0,0 +1,58 @@ +var $range = $(".js-range-slider"), + $inputFrom = $(".js-input-from"), + $inputTo = $(".js-input-to"), + instance, + min = 0, + max = 1000, + from = 0, + to = 0; + +$range.ionRangeSlider({ + skin: "round", + type: "double", + min: min, + max: max, + from: 200, + to: 800, + onStart: updateInputs, + onChange: updateInputs +}); +instance = $range.data("ionRangeSlider"); + +function updateInputs (data) { + from = data.from; + to = data.to; + + $inputFrom.prop("value", from); + $inputTo.prop("value", to); +} + +$inputFrom.on("input", function () { + var val = $(this).prop("value"); + + // validate + if (val < min) { + val = min; + } else if (val > to) { + val = to; + } + + instance.update({ + from: val + }); +}); + +$inputTo.on("input", function () { + var val = $(this).prop("value"); + + // validate + if (val < from) { + val = from; + } else if (val > max) { + val = max; + } + + instance.update({ + to: val + }); +}); \ No newline at end of file diff --git a/templates/pages/p_results_find_route.html b/templates/pages/p_results_find_route.html index 587ab4b..bc7bb44 100644 --- a/templates/pages/p_results_find_route.html +++ b/templates/pages/p_results_find_route.html @@ -2,10 +2,19 @@ {% load static %} {% block meta %} + + + - +{# #} + + + + {% endblock %} + + {% block content %}
@@ -16,22 +25,75 @@ {% csrf_token %}
+ +{# #} + +{#
#} +{# {% include "widgets/w_places_input.html" %}#} +{#
#}
- + + -
- {% include "widgets/w_places_input.html" %} +
+
+{#
#} +{# #} + +{#
#} +{# {% include "widgets/w_ac_input_address_point.html" %}#} +{#
#} +{#
#}
- - -
- {% include "widgets/w_ac_input_address_point.html" %} -
+ + + +
+ +
@@ -107,9 +169,14 @@
-
- - +
+ +
+
+ + +
+