@{
    ViewData["Title"] = "Pending Posts";
}

@model PendingPostsPaginationViewModel

<div class="tab-pane fade in active">
    @foreach (var post in Model.PendingPosts)
    {
        <div class="media activity-item">
            @if (User.IsInRole(Roles.Administrator.ToString()) || User.IsInRole(Roles.Editor.ToString()))
            {
                <a asp-area="Editor" asp-controller="Post" asp-action="ApprovePost" asp-route-id="@post.Id" class="btn btn-info" style="float: right;">
                    <i class="fas fa-check"></i>
                    <span>
                        Approve
                    </span>
                </a>
            }
            <a asp-area="" asp-controller="Profile" asp-action="Index" asp-route-username="@Model.Username" class="pull-left">
                <img src=@post.ApplicationUser.ImageUrl alt="Avatar" class="media-object avatar">
            </a>
            <div class="media-body">
                <p class="activity-title">
                    <a asp-area="" asp-controller="Profile" asp-action="Index" asp-route-username="@post.ApplicationUser.UserName">
                        <b>
                            @post.ApplicationUser.UserName
                        </b>
                    </a> pending blog
                    <a asp-area="" asp-controller="Post" asp-action="Index" asp-route-postId="@post.Id">
                        <b>post</b>
                    </a>
                </p>
                <small class="text-muted">@post.CreatedOn.ToString("dd-MMMM-yyyy HH:mm tt")</small>
                <div class="activity-attachment">
                    <h4>
                        <a asp-area="" asp-controller="Post" asp-action="Index" asp-route-postId="@post.Id">
                            @post.Title
                        </a>
                    </h4>
                    <div class="well well-sm">
                        @Html.Raw(post.ShortContent)
                    </div>
                </div>
            </div>
        </div>
    }
    <div class="row" style="text-align: center">
        @Html.PagedListPager((IPagedList)Model.PendingPosts,
                page => Url.Action("Index", "Profile",
        new { username = Model.Username, page = page }),
        PagedListRenderOptions.OnlyShowFivePagesAtATime)
    </div>
</div>