for chatmessage in agentUserMessageList
    .clearfix.chat-block(id=(chatmessage.id == agentusersearchdetails ? 'agentusersearchdetails' : ''),name=chatmessage.createtime)
        div(class=(chatmessage.calltype && chatmessage.calltype == '呼出' ? 'chat-right' : 'chat-left'))
            img.user-img(alt="", src=(chatmessage.calltype && chatmessage.calltype == '呼出' ? '/images/agent.png' : curagentuser.headimgurl && curagentuser.headimgurl != '' ? curagentuser.headimgurl : '/images/im/user.png'), style='width:45px;height:45px;')
            .chat-message
                span(class=(chatmessage.calltype && chatmessage.calltype == '呼出' ? 'rateright' : 'rateleft'))
                    i.layui-icon.iconclick(id=chatmessage.id, name=(chatmessage.islabel == true ? 'yeslabe' : 'nolabe'), style="font-size:30px;cursor:pointer;color: #{chatmessage.islabel == true ? '#46cad4' : '#aaaaaa'}")
                        | #{chatmessage.islabel == true ? '' : 'စ'}
                span.user
                    if chatmessage && chatmessage.calltype && chatmessage.calltype == '呼出'
                        if chatmessage.intervented
                            | #{chatmessage.supervisorname}
                        else
                            | #{chatmessage.username}
                    else
                        | #{chatmessage.username}
                span.time= pugHelper.formatDate('yyyy-MM-dd HH:mm:ss', chatmessage.createtime)
                span(class=(chatmessage.calltype && chatmessage.calltype == '呼出' ? 'rateleft' : 'rateright'), style="cursor: pointer; font-size: 30px")
                    i.layui-icon.iconclick(id=chatmessage.id, name=(chatmessage.islabel == true ? 'yeslabe' : 'nolabe'), style="cursor:pointer;font-size:30px;color: #{chatmessage.islabel == true ? '#46cad4' : '#aaaaaa'}")
                        | #{chatmessage.islabel == true ? '' : 'စ'}
                div(class=(chatmessage.calltype && chatmessage.calltype == '呼出' ? 'chatting-right' : 'chatting-left'))
                    i.userarrow
                    .chat-content
                        include /apps/agent/media/message.pug
        if agentUserMessageListnum
            input#totalElements(type='hidden',value=agentUserMessageListnum)

style.
    .chat-left .chat-message .rateright {
        display: inline-block;
    }

    .chat-left .chat-message .rateleft {
        display: none;
    }

    .chat-right .chat-message .rateright {
        display: inline-block;
    }

    .chat-right .chat-message .rateleft {
        display: none;
    }

script.
    $('.iconclick').click(function () {
        if ($(this).attr('name') == 'nolabe') {
            $(this).html('&#xe616;')
            $(this).css('color', '#46cad4')
            $(this).attr('name', 'yeslabe')
        } else {
            $(this).html('&#x1005;')
            $(this).css('color', '#aaaaaa')
            $(this).attr('name', 'nolabe')
        }
        $.ajax({
            url: '/agent/agentuserLabel.html',
            data: {'iconid': $(this).attr('id')},
            type: "get",
            success: function () {
            }
        });

    });

