Sala33_FreebirdTech/Views/Messages/GetMessageData.cshtml
@using FreebirdTech.ViewModels
@using FreebirdTech.Utility
@model MessageListViewModel

@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
}

<div id="mydiv" class="chat-history overflow-auto">
    <ul class="m-b-0">
        @foreach (var item in Model.Messages)
        {
            if (item.Sender.OwnerId.Equals(Model.OwnerID))
            {
                <li class="clearfix">
                    <div class="message-data text-right">
                        <span class="message-data-time">@item.Time.Hour:@item.Time.Minute, @PageRenderHelper.GetDay(item.Time)</span>
                        <img src="@item.Sender.AvatarImageURI" alt="avatar">
                    </div>
                    <div class="message other-message float-right"> @item.MessageText </div>
                </li>
            }
            else
            {
                <li class="clearfix">
                    <div class="message-data">
                        <span class="message-data-time">@item.Time.Hour:@item.Time.Minute, @PageRenderHelper.GetDay(item.Time)</span>
                    </div>
                    <div class="message my-message">@item.MessageText</div>
                </li>
            }
        }
    </ul>
</div>