@{
    var currentUser = UserManager.FindByNameAsync(User.Identity.Name);
    ViewData["Title"] = $"{Model.Action} Posts - {@Model.Username}";
}

@model UserPostsViewModel

<div id="banner-area">
    <img src="~/images/banner/banner2.jpg" alt="" />
    <div class="parallax-overlay"></div>
    <div class="banner-title-content">
        <div class="text-center">
            <h2>@Model.Username @Model.Action Posts</h2>
            <ul class="breadcrumb">
                <li>Home</li>
                <li><a asp-area="" asp-controller="Blog" asp-action="Index"> Blog</a></li>
                <li>@Model.Action</li>
                <li><a asp-area="" asp-controller="Profile" asp-action="Index" asp-route-username="@Model.Username">@Model.Username</a></li>
            </ul>
        </div>
    </div>
</div>
<section id="main-container">
    <div class="container">
        <partial name="_TempDataPartial" />
        <div class="row">
            <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
                @foreach (var post in Model.Posts)
                {
                    @await Html.PartialAsync("_BlogPostPartial", post)
                }
                <div class="row" style="text-align: center">
                    @Html.PagedListPager((IPagedList)Model.Posts,
                            page => Url.Action("Index", "UserPosts",
                    new { username = Model.Username, filter = Model.Action, page = page }),
                    PagedListRenderOptions.OnlyShowFivePagesAtATime)
                </div>
            </div>
            @await Component.InvokeAsync("Blog")
        </div>
    </div>
</section>