0.1.24
send msg
This commit is contained in:
@@ -41,11 +41,8 @@ def support_tickets_ajax(request):
|
|||||||
raise Http404
|
raise Http404
|
||||||
|
|
||||||
if request.user.is_staff:
|
if request.user.is_staff:
|
||||||
from ChatServiceApp.funcs import get_tickets_for_manager, get_tickets_wo_manager
|
from ChatServiceApp.funcs import get_ticketsDict_for_staff
|
||||||
Dict = {
|
Dict = get_ticketsDict_for_staff(request.user)
|
||||||
'tickets_wo_manager': get_tickets_wo_manager(),
|
|
||||||
'tickets_for_manager': get_tickets_for_manager(request.user),
|
|
||||||
}
|
|
||||||
tpl_name = 'blocks/profile/b_support_chat.html'
|
tpl_name = 'blocks/profile/b_support_chat.html'
|
||||||
else:
|
else:
|
||||||
from ChatServiceApp.models import MsgGroup
|
from ChatServiceApp.models import MsgGroup
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
from .models import *
|
from .models import *
|
||||||
|
|
||||||
|
def get_ticketsDict_for_staff(user):
|
||||||
|
Dict = {
|
||||||
|
'tickets_wo_manager': get_tickets_wo_manager(),
|
||||||
|
'tickets_for_manager': get_tickets_for_manager(user),
|
||||||
|
}
|
||||||
|
return Dict
|
||||||
|
|
||||||
def get_tickets_wo_manager():
|
def get_tickets_wo_manager():
|
||||||
|
|
||||||
tickets = MsgGroup.objects.filter(enable=True, manager=None)
|
tickets = MsgGroup.objects.filter(enable=True, manager=None)
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ def support_show_chat_by_ticket_ajax(request):
|
|||||||
Dict = {
|
Dict = {
|
||||||
'ticket': obj
|
'ticket': obj
|
||||||
}
|
}
|
||||||
|
Dict.update(get_ticketsDict_for_staff(request.user))
|
||||||
|
|
||||||
tpl_name = 'blocks/profile/b_support_chat.html'
|
tpl_name = 'blocks/profile/b_support_chat.html'
|
||||||
|
|
||||||
|
|||||||
@@ -9,50 +9,52 @@
|
|||||||
<div class="title-profile-cont">
|
<div class="title-profile-cont">
|
||||||
<h1>Техническая поддержка</h1>
|
<h1>Техническая поддержка</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="name_ticket">
|
|
||||||
<span>{{ ticket.name }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="block-chat">
|
|
||||||
{% if user.is_staff or ticket.manager %}
|
|
||||||
<div class="container-header-chat">
|
|
||||||
<div class="header-chat-left-part">
|
|
||||||
<img class="chat-avatar" src="{% static "delete_later/Avatar.png" %}">
|
|
||||||
<span class="chat-username">{{ ticket.manager.last_name }} {{ ticket.manager.first_name }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="header-chat-right-part">
|
|
||||||
<img class="header-icons-right-part-padding" src="{% static "img/svg/phone.svg" %}">
|
|
||||||
<img class="header-icons-right-part-padding" src="{% static "img/svg/info.svg" %}">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<div class="container-messages">
|
{% if ticket %}
|
||||||
{% if not ticket.rel_messages_for_group.all %}
|
<div class="name_ticket">
|
||||||
{% with text=ticket.text modifiedDT=ticket.modifiedDT %}
|
<span>{{ ticket.name }}</span>
|
||||||
{% include "widgets/w_message.html" %}
|
</div>
|
||||||
{% endwith %}
|
<div class="block-chat">
|
||||||
{% else %}
|
{% if user.is_staff or ticket.manager %}
|
||||||
{% for msg in ticket.rel_messages_for_group.all %}
|
<div class="container-header-chat">
|
||||||
{% with text=msg.text modifiedDT=msg.modifiedDT %}
|
<div class="header-chat-left-part">
|
||||||
|
<img class="chat-avatar" src="{% static "delete_later/Avatar.png" %}">
|
||||||
|
<span class="chat-username">{{ ticket.manager.last_name }} {{ ticket.manager.first_name }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="header-chat-right-part">
|
||||||
|
<img class="header-icons-right-part-padding" src="{% static "img/svg/phone.svg" %}">
|
||||||
|
<img class="header-icons-right-part-padding" src="{% static "img/svg/info.svg" %}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<div class="container-messages">
|
||||||
|
{% if not ticket.rel_messages_for_group.all %}
|
||||||
|
{% with text=ticket.text modifiedDT=ticket.modifiedDT %}
|
||||||
{% include "widgets/w_message.html" %}
|
{% include "widgets/w_message.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% endfor %}
|
{% else %}
|
||||||
|
{% for msg in ticket.rel_messages_for_group.all %}
|
||||||
|
{% with text=msg.text modifiedDT=msg.modifiedDT %}
|
||||||
|
{% include "widgets/w_message.html" %}
|
||||||
|
{% endwith %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% if user.is_staff or ticket.manager %}
|
||||||
|
<div class="footer-chat">
|
||||||
|
<div class="left-part-block-enter-message">
|
||||||
|
<input class="enter-message-inp" placeholder="Отправить сообщение">
|
||||||
|
</div>
|
||||||
|
<div class="right-part-block-enter-message">
|
||||||
|
<button class="attach-file-btn-message" onclick="attachFilemeassge()"></button>
|
||||||
|
<button class="send-message" onclick="sendMessage('{{ ticket.id }},{{ sender }},{{ receiver }},{{ text }}')"></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% if user.is_staff or ticket.manager %}
|
|
||||||
<div class="footer-chat">
|
|
||||||
<div class="left-part-block-enter-message">
|
|
||||||
<input class="enter-message-inp" placeholder="Отправить сообщение">
|
|
||||||
</div>
|
|
||||||
<div class="right-part-block-enter-message">
|
|
||||||
<button class="attach-file-btn-message" onclick="attachFilemeassge()"></button>
|
|
||||||
<button class="send-message" onclick="sendMessage('{{ ticket.id }},{{ sender }},{{ receiver }},{{ text }}')"></button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
{% if user.is_staff %}
|
{% if user.is_staff %}
|
||||||
<div class="block-list-of-users">
|
<div class="block-list-of-users">
|
||||||
<span class="title-list-of-users">Неразобранные тикеты</span>
|
<span class="title-list-of-users">Неразобранные тикеты</span>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
|
|
||||||
<div class="container-message_support_chat{% if msg.sender == user %} right{% else %} left{% endif %}">
|
<div class="container-message_support_chat{% if msg.sender == user or ticket.owner != user %} right{% else %} left{% endif %}">
|
||||||
<div class="block_avatar_message{% if msg.sender == ticket.manager %} left{% else %} right{% endif %}">
|
<div class="block_avatar_message{% if msg.sender == ticket.manager %} left{% else %} right{% endif %}">
|
||||||
<img src="{% static "delete_later/Avatar.png" %}">
|
<img src="{% static "delete_later/Avatar.png" %}">
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user