{% load static %}

{#{% load static %}#}


{#    <div class="insert-tech-place">#}

<div class="container-messenger support">
{#    <div class="title-profile-cont">#}
{#        <h1>Техническая поддержка</h1>#}
{#    </div>#}
    <img class="loader_chat_f_sw_chats support" src="{% static "/img/svg/loader.svg" %}" alt="loader">
    {% if user.is_staff %}
        <div class="menu_buttons curtain left open" data-name="тик">
            <div class="container_block_list_of_users">
                {% include 'blocks/profile/b_list_of_tickets_support_chat.html' %}
            </div>
            <div class="handler_menu close" onclick="open_curtain('left')">
                <img class="btns_f_curtain close left" src="{% static 'img/svg/arrow_f_curtain.svg' %}">
                <div class="text_f_curtain left">тик</div>
                <img class="btns_f_curtain close right"  src="{% static 'img/svg/arrow_f_curtain.svg' %}">
                <div class="clear_both"></div>
            </div>
        </div>
    {% endif %}
    {% if ticket %}
        <div class="name_ticket">
            <span>{{ ticket.name }}</span>
        </div>

        <div class="{% if user.is_staff %}block-chat{% else %}block-chat width-100{% endif %} support">
            {% if user.is_staff or ticket.manager %}
                <div class="container-header-chat">
                    <div class="header-chat-left-part">
                        <img class="chat-avatar" {% if cur_receiver.user_profile.avatar %}src="{{ cur_receiver.user_profile.avatar.url }}"{% else %}src="{% static "img/svg/User.svg" %}"{% endif %}>
                        <span class="chat-username">{{ cur_receiver.last_name }} {{ cur_receiver.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 messages %}#}
{#                    {% with text=ticket.text modifiedDT=ticket.modifiedDT  %}#}
{#                        {% include "widgets/w_message.html" %}#}
{#                    {% endwith %}#}
{#                {% else %}#}
{#                    {% for msg in messages %}#}
{#                        {% with text=msg.text modifiedDT=msg.modifiedDT %}#}
{#                            {% include "widgets/w_message.html" %}#}
{#                        {% endwith %}#}
{#                    {% endfor %}#}
{#                {% endif %}#}
{#            </div>#}
            <div class="bottom_part_of_chats">
                <div class="container-messages" data-user-id="{{ user.id }}" data-cur-receiver="{{ cur_receiver.id }}" data-ticket-id='{{ ticket.id }}'>
                    {% include "blocks/profile/b_messages_container.html" %}
                </div>


                <div class="footer-chat{% if not new_msg_allow  %} hide{% endif %}">

                    <div class="left-part-block-enter-message">
                        <input class="enter-message-inp" onfocus="check_new_messages_timeout()" onkeypress="sendMessageEnter(event,{{ ticket.id }},{{ user.id }},{{ cur_receiver.id }})" placeholder="Отправить сообщение">
                    </div>
{#                    <div class="right-part-block-enter-message">#}
{#                        <button class="attach-file-btn-message" onclick="attachFilemeassge(event,this,{{ ticket.id }},{{ user.id }},{{ cur_receiver.id }})"></button>#}
{#                        <button class="send-message" onclick="sendMessage({{ ticket.id }},{{ user.id }},{{ cur_receiver.id }})"></button>#}
{#                    </div>#}
                    <div class="right-part-block-enter-message">
        {#                <button class="attach-file-btn-message" onclick="attachFilemeassge(event,this,null,{{ user.id }},{{ cur_receiver.id }})"></button>#}
                        <input style="display: none;" type="file" onchange="attachFilemeassge(event,this,{{ ticket.id }},{{ user.id }},{{ cur_receiver.id }})" id="id_choce_file" multiple>
                        <label for="id_choce_file" class="attach-file-btn-message"></label>
                        <button class="send-message" onclick="sendMessage({{ ticket.id }},{{ user.id }},{{ cur_receiver.id }})"></button>
                        <img src="{% static "/img/svg/loader.svg" %}" class="loader_show_message">
        {#                <button class="send-message" onclick="send_ws_msg('message')"></button>#}
                    </div>
                </div>
            </div>

        </div>
    {% endif %}

</div>

{#</div>#}