@model FavoritesPaginationViewModel

@foreach (var post in Model.Favorites)
{
    <div class="media activity-item">
        <div class="activity-attachment">
            @if (post.IsFavourite)
            {
                <form asp-area="" asp-controller="Post" asp-action="RemoveFromFavorite" asp-route-postId="@post.Id" method="post">
                    <button type="submit" class="btn btn-sm btn-danger" style="float: right">
                        <i class="fas fa-eraser"></i>
                        <span>
                            Remove from favorite
                        </span>
                    </button>
                </form>
            }
            else
            {
                <form asp-area="" asp-controller="Post" asp-action="AddToFavorite" asp-route-postId="@post.Id" method="post">
                    <button type="submit" class="btn btn-sm btn-success" style="float: right">
                        <i class="far fa-heart"></i>
                        <span>
                            Add to favorite
                        </span>
                    </button>
                </form>
            }
            <h4>
                <a asp-area="" asp-controller="Post" asp-action="Index" asp-route-postId="@post.Id">
                    @post.Title
                </a>
            </h4>
            <small>@post.CreatedOn.ToString("dd-MMMM-yyyy")</small>
            <div class="well well-sm">
                @Html.Raw(post.ShortContent)
            </div>
        </div>
    </div>
}
<div class="row" style="text-align: center">
    @Html.PagedListPager((IPagedList)Model.Favorites,
            page => Url.Action("Index", "Profile",
    new { username = Model.Username, page = page }),
    PagedListRenderOptions.OnlyShowFivePagesAtATime)
</div>