Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -1234,10 +1234,17 @@
|
||||
.options_subscribe_title{
|
||||
font-weight: 600;
|
||||
font-size: 18px;
|
||||
color: #272424;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.options_subscribe_title.light{
|
||||
color: #272424;
|
||||
}
|
||||
|
||||
.options_subscribe_title.dark{
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.text_option_item{
|
||||
font-size: 16px;
|
||||
color: #272424;
|
||||
@@ -1319,7 +1326,7 @@
|
||||
.arrange_subscribe{
|
||||
background: #FF613A;
|
||||
height: 60px;
|
||||
padding: 20px 35px 20px 35px;
|
||||
padding: 20px 33px 20px 33px;
|
||||
color: #FFFFFF;
|
||||
border-radius: 10px;
|
||||
margin-top: 20px;
|
||||
@@ -1356,6 +1363,29 @@
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.inputs_for_slider_cont{
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.input_f_slider_start{
|
||||
float: left;
|
||||
height: 30px;
|
||||
width: 40%;
|
||||
border: 1px solid #E6E6E6;
|
||||
border-radius: 10px;
|
||||
padding: 2%;
|
||||
}
|
||||
|
||||
.input_f_slider_end{
|
||||
float: right;
|
||||
height: 30px;
|
||||
width: 40%;
|
||||
border: 1px solid #E6E6E6;
|
||||
border-radius: 10px;
|
||||
padding: 2%;
|
||||
}
|
||||
|
||||
.title_el_methods_transportation{
|
||||
font-size: 16px;
|
||||
color: #272424;
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
function update_count_unread_messages (data) {
|
||||
let list_unrd = document.querySelectorAll(".qs")
|
||||
let i = 0
|
||||
for (i;i < list_unrd.length;i++){
|
||||
list_unrd[i].innerHTML = data.unread_msgs_count.toString()
|
||||
}
|
||||
}
|
||||
|
||||
function play_required_beep (data) {
|
||||
const beep = new Audio('/static/sounds/beep_2.mp3')
|
||||
beep.play()
|
||||
}
|
||||
9
static/js/chat_socket_functions/inital_old_tab.js
Normal file
9
static/js/chat_socket_functions/inital_old_tab.js
Normal file
@@ -0,0 +1,9 @@
|
||||
function inital_old_tab (){
|
||||
let el_tab = document.querySelector(".tab_user_messanger.select")
|
||||
let old_item_tab_user = null;
|
||||
if (el_tab !== null){
|
||||
let dataset = el_tab.dataset;
|
||||
old_item_tab_user = dataset['curReceiverItem'];
|
||||
}
|
||||
return old_item_tab_user
|
||||
}
|
||||
30
static/js/chat_socket_functions/update_messenger.js
Normal file
30
static/js/chat_socket_functions/update_messenger.js
Normal file
@@ -0,0 +1,30 @@
|
||||
function update_chat_html (data,msg_cont) {
|
||||
if (data.chat_html){
|
||||
if (msg_cont !== null){
|
||||
if (msg_cont.dataset['curReceiver'] === ""){
|
||||
document.querySelector(".fotter-chat")
|
||||
msg_cont.innerHTML = data.chat_html
|
||||
} else {
|
||||
// что бы не выводился левый чат
|
||||
if (msg_cont.dataset['curReceiver'] === data['sender'].toString() || msg_cont.dataset['curReceiver'] === data['receiver'].toString()) {
|
||||
msg_cont.innerHTML = data.chat_html
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function update_list_w_users (data,old_item_tab_user) {
|
||||
let list_of_users = document.querySelector(".block-list-of-users")
|
||||
if (list_of_users) {
|
||||
|
||||
if (data.users_list_html){
|
||||
list_of_users.innerHTML = data.users_list_html
|
||||
if (el_tab !== null){
|
||||
document.querySelector(`[data-cur-receiver-item="${old_item_tab_user}"]` ).classList.add("select")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
function update_tickets_operations_manager (data,old_item_tab_user,w=null,wo=null) {
|
||||
let insert_type = null
|
||||
if (w !== null){
|
||||
insert_type = 'data.tickets_w_manager_html'
|
||||
} else if (wo !== null){
|
||||
insert_type = 'data.tickets_wo_manager_html'
|
||||
}
|
||||
if (insert_type) {
|
||||
if (document.querySelector(".list_linked_tickets") !== null || document.querySelector(".list_unlinked_tickets") !== null) {
|
||||
document.querySelector(".list_unlinked_tickets").innerHTML = insert_type
|
||||
// if (el_tab !== null) {
|
||||
// let select_tab = document.querySelector(".tab_user_messanger.select")
|
||||
// if (select_tab) {
|
||||
// select_tab.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 === null){
|
||||
// let chat = document.querySelector(".block-chat").innerHTML = ""
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
select_and_scroll_to_ticket(data,old_item_tab_user)
|
||||
clear_messenger(data)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function select_and_scroll_to_ticket (data,old_item_tab_user){
|
||||
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"});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function clear_messenger (data) {
|
||||
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 === null){
|
||||
let chat = document.querySelector(".block-chat").innerHTML = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function update_support_chat_func (data){
|
||||
if (msg_cont !== null){
|
||||
if (msg_cont.dataset['curReceiver'] === ""){
|
||||
document.querySelector(".info_profile").innerHTML = data.support_chat_html
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,12 +55,7 @@ function sendMessageSocket (data) {
|
||||
|
||||
|
||||
chatSocket.onmessage = function (e) {
|
||||
let el_tab = document.querySelector(".tab_user_messanger.select")
|
||||
let old_item_tab_user = null;
|
||||
if (el_tab !== null){
|
||||
let dataset = el_tab.dataset;
|
||||
old_item_tab_user = dataset['curReceiverItem'];
|
||||
}
|
||||
let old_item_tab_user = inital_old_tab()
|
||||
let data = JSON.parse(e.data);
|
||||
console.log('Data:', data);
|
||||
console.log("return")
|
||||
@@ -72,114 +67,89 @@ chatSocket.onmessage = function (e) {
|
||||
console.log(data)
|
||||
} else if (data.type === "update_chat") {
|
||||
let msg_cont = document.querySelector(".container-messages")
|
||||
if (data.chat_html){
|
||||
if (msg_cont !== null){
|
||||
if (msg_cont.dataset['curReceiver'] === ""){
|
||||
document.querySelector(".fotter-chat")
|
||||
msg_cont.innerHTML = data.chat_html
|
||||
} else {
|
||||
// что бы не выводился левый чат
|
||||
if (msg_cont.dataset['curReceiver'] === data['sender'].toString() || msg_cont.dataset['curReceiver'] === data['receiver'].toString()) {
|
||||
msg_cont.innerHTML = data.chat_html
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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 = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
update_chat_html(data,msg_cont)
|
||||
|
||||
}
|
||||
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
|
||||
if (el_tab !== null) {
|
||||
let select_tab = document.querySelector(".tab_user_messanger.select")
|
||||
if (select_tab) {
|
||||
select_tab.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"});
|
||||
}
|
||||
// update_tickets_w_manager(data,old_item_tab_user)
|
||||
//
|
||||
// update_tickets_wo_manager(data,old_item_tab_user)л
|
||||
|
||||
}
|
||||
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 = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
update_tickets_operations_manager(data,old_item_tab_user,'w')
|
||||
|
||||
}
|
||||
else {
|
||||
let list_of_users = document.querySelector(".block-list-of-users")
|
||||
if (list_of_users !== null){
|
||||
if (data.users_list_html){
|
||||
list_of_users.innerHTML = data.users_list_html
|
||||
if (el_tab !== null){
|
||||
document.querySelector(`[data-cur-receiver-item="${old_item_tab_user}"]` ).classList.add("select")
|
||||
}
|
||||
}
|
||||
update_tickets_operations_manager(data,old_item_tab_user,null,'wo')
|
||||
|
||||
}
|
||||
}
|
||||
update_list_w_users(data,old_item_tab_user)
|
||||
|
||||
|
||||
} else if (data.type === "update_support_chat"){
|
||||
if (msg_cont !== null){
|
||||
if (msg_cont.dataset['curReceiver'] === ""){
|
||||
document.querySelector(".info_profile").innerHTML = data.support_chat_html
|
||||
}
|
||||
}
|
||||
update_support_chat_func(data)
|
||||
}
|
||||
if (data.unread_msgs_count > 0){
|
||||
let list_unrd = document.querySelectorAll(".qs")
|
||||
let i = 0
|
||||
for (i;i < list_unrd.length;i++){
|
||||
list_unrd[i].innerHTML = data.unread_msgs_count.toString()
|
||||
}
|
||||
update_count_unread_messages(data)
|
||||
}
|
||||
if (data.required_beep === true) {
|
||||
const beep = new Audio('/static/sounds/beep_2.mp3')
|
||||
beep.play()
|
||||
|
||||
play_required_beep(data)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// function update_tickets_w_manager (data,old_item_tab_user){
|
||||
// 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
|
||||
//
|
||||
// select_and_scroll_to_ticket(data,old_item_tab_user)
|
||||
//
|
||||
// clear_messenger(data)
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
|
||||
|
||||
// function update_tickets_wo_manager (data,old_item_tab_user) {
|
||||
// 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
|
||||
// if (el_tab !== null) {
|
||||
// let select_tab = document.querySelector(".tab_user_messanger.select")
|
||||
// if (select_tab) {
|
||||
// select_tab.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 === null){
|
||||
// let chat = document.querySelector(".block-chat").innerHTML = ""
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
|
||||
// let url = `ws://localhost:8000/ws/socket-server/`;
|
||||
//
|
||||
// const chatSocket = new WebSocket(url);
|
||||
|
||||
@@ -1,58 +1,65 @@
|
||||
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);
|
||||
window.onload = function () {
|
||||
inital_slider()
|
||||
}
|
||||
|
||||
$inputFrom.on("input", function () {
|
||||
var val = $(this).prop("value");
|
||||
function inital_slider (){
|
||||
var $range = $(".range_slider_form_filters"),
|
||||
$inputFrom = $(".input_f_slider_start"),
|
||||
$inputTo = $(".input_f_slider_end"),
|
||||
instance,
|
||||
min = 0,
|
||||
max = 1000,
|
||||
from = 0,
|
||||
to = 0;
|
||||
$range.ionRangeSlider({
|
||||
skin: "round",
|
||||
type: "double",
|
||||
min: min,
|
||||
max: max,
|
||||
from: 100,
|
||||
to: 900,
|
||||
onStart: updateInputs,
|
||||
onChange: updateInputs
|
||||
});
|
||||
instance = $range.data("ionRangeSlider");
|
||||
|
||||
// validate
|
||||
if (val < min) {
|
||||
val = min;
|
||||
} else if (val > to) {
|
||||
val = to;
|
||||
function updateInputs (data) {
|
||||
from = data.from;
|
||||
to = data.to;
|
||||
|
||||
$inputFrom.prop("value", from);
|
||||
$inputTo.prop("value", to);
|
||||
}
|
||||
|
||||
instance.update({
|
||||
from: val
|
||||
$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");
|
||||
$inputTo.on("input", function () {
|
||||
var val = $(this).prop("value");
|
||||
|
||||
// validate
|
||||
if (val < from) {
|
||||
val = from;
|
||||
} else if (val > max) {
|
||||
val = max;
|
||||
}
|
||||
// validate
|
||||
if (val < from) {
|
||||
val = from;
|
||||
} else if (val > max) {
|
||||
val = max;
|
||||
}
|
||||
|
||||
instance.update({
|
||||
to: val
|
||||
instance.update({
|
||||
to: val
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -31,7 +31,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="options_subscribe">
|
||||
<div class="options_subscribe_title">
|
||||
<div class="options_subscribe_title light">
|
||||
Опции:
|
||||
</div>
|
||||
<div class="list_options_subscribe">
|
||||
@@ -63,7 +63,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="options_subscribe">
|
||||
<div class="options_subscribe_title">
|
||||
<div class="options_subscribe_title dark">
|
||||
Опции:
|
||||
</div>
|
||||
<div class="list_options_subscribe">
|
||||
@@ -94,7 +94,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="options_subscribe">
|
||||
<div class="options_subscribe_title">
|
||||
<div class="options_subscribe_title light">
|
||||
Опции:
|
||||
</div>
|
||||
<div class="list_options_subscribe">
|
||||
|
||||
@@ -170,15 +170,24 @@
|
||||
</div>
|
||||
<div class="methods_transportation_form_filters">
|
||||
<div class="range-slider">
|
||||
<input type="text" class="js-range-slider" value="" />
|
||||
<input type="text" class="range_slider_form_filters" value="" />
|
||||
</div>
|
||||
<div class="extra-controls">
|
||||
<input type="text" class="js-input-from" value="0" />
|
||||
<input type="text" class="js-input-to" value="0" />
|
||||
<div class="inputs_for_slider_cont">
|
||||
<input type="text" class="input_f_slider_start" value="100" />
|
||||
<input type="text" class="input_f_slider_end" value="900" />
|
||||
<div class="clear_both"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="methods_transportation_form_filters">
|
||||
<div class="title_el_methods_transportation">Сортировать по:</div>
|
||||
<select class="select_form_filters_find_route">
|
||||
<option>По последним</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="block-finded-routes">
|
||||
{% for route in routes %}
|
||||
{% include "widgets/w_carrier_card.html" %}
|
||||
|
||||
Reference in New Issue
Block a user