<div class="header-chat">
    <img src="{$path}/messages/chat.png" style="height: 50px;margin-left: 19px;margin-top: -8px;">
    <p class="name">{$receiver.name}</p>
</div>
<div class="messages-chat">
    {foreach $messages as $message}
        {if $message.sender_id == $receiver.user_id}
            <div class="message">
                <div class="photo"
                     style="background-image: url('{$path}/messages/user_chat.jpeg');">
                </div>
                <p class="text">{$message.message} </p>
            </div>
            <p class="time"> {$message.created_at}</p>
            <div class="clearfix"></div>
        {else}
            <div class="message text-only">
                <div class="response">
                    <p class="text"> {$message.message}</p>
                </div>
            </div>
            <p class="response-time time"> {$message.created_at}</p>
            <div class="clearfix"></div>
        {/if}
    {/foreach}
</div>