Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -38,8 +38,17 @@ class MsgGroup(BaseModel):
|
|||||||
manager = models.ForeignKey(User, verbose_name=_('Менеджер'), related_name='rel_msgGroups_for_manager',
|
manager = models.ForeignKey(User, verbose_name=_('Менеджер'), related_name='rel_msgGroups_for_manager',
|
||||||
on_delete=models.SET_NULL, null=True)
|
on_delete=models.SET_NULL, null=True)
|
||||||
|
|
||||||
def get_last_msg(self):
|
def get_last_msg_txt(self):
|
||||||
return self.rel_messages_for_group.all().order_by('-createDT').first()
|
msg = self.rel_messages_for_group.all().order_by('-createDT').first()
|
||||||
|
if not msg:
|
||||||
|
return self.text
|
||||||
|
|
||||||
|
if msg.text:
|
||||||
|
return msg.text
|
||||||
|
elif msg.files:
|
||||||
|
return msg.files[0].file_name
|
||||||
|
|
||||||
|
return self.name
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = _('Тикет')
|
verbose_name = _('Тикет')
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
|
|
||||||
function update_count_unread_messages (data) {
|
function update_count_unread_messages (data) {
|
||||||
let list_unrd = document.querySelectorAll(".unredmessages_value_text")
|
let selected_btn = document.querySelector(".selected")
|
||||||
let list_unrd_parent = document.querySelectorAll(".icon_unread_messages")
|
if (selected_btn.dataset['ajaxUrl'] !== 'chats'){
|
||||||
let i = 0
|
let list_unrd = document.querySelectorAll(".unredmessages_value_text")
|
||||||
for (i;i < list_unrd.length;i++){
|
let list_unrd_parent = document.querySelectorAll(".icon_unread_messages")
|
||||||
if (!list_unrd_parent[i].classList.contains("showed")){
|
let i = 0
|
||||||
list_unrd_parent[i].classList.toggle("showed")
|
for (i;i < list_unrd.length;i++){
|
||||||
|
if (!list_unrd_parent[i].classList.contains("showed")){
|
||||||
|
list_unrd_parent[i].classList.toggle("showed")
|
||||||
|
}
|
||||||
|
list_unrd[i].innerHTML = data.unread_msgs_count.toString()
|
||||||
}
|
}
|
||||||
list_unrd[i].innerHTML = data.unread_msgs_count.toString()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,9 @@ function deleteMarkerMessages (el) {
|
|||||||
let marker = el.querySelectorAll(".icon_unread_messages")
|
let marker = el.querySelectorAll(".icon_unread_messages")
|
||||||
if (marker.length > 0){
|
if (marker.length > 0){
|
||||||
marker[0].classList.remove("showed")
|
marker[0].classList.remove("showed")
|
||||||
marker[1].classList.remove("showed")
|
if (marker[1]){
|
||||||
|
marker[1].classList.remove("showed")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,11 +19,7 @@
|
|||||||
<div class="message-sprt-title">
|
<div class="message-sprt-title">
|
||||||
<span>
|
<span>
|
||||||
{# Текст последнего сообщени в чате (с размытием)#}
|
{# Текст последнего сообщени в чате (с размытием)#}
|
||||||
{% if ticket.get_last_msg.text %}
|
{{ ticket.get_last_msg_txt }}
|
||||||
{{ ticket.get_last_msg.text }}
|
|
||||||
{% elif ticket.get_last_msg.files %}
|
|
||||||
{{ ticket.get_last_msg.files.0.file_name }}
|
|
||||||
{% endif %}
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user