@model IEnumerable<BlogPost>
@{
    ViewData["Title"] = "User posts";
}

<h2>Index</h2>
<p class="text-success">@ViewData["StatusMessage"]</p>
<p>
    <a asp-action="Create">Create New</a>
</p>
<table class="table">
    <tr>
        <th>
            Author"]
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Content)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.DateModified)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Photo)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.UserModified)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Rate)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Title)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Visible)
        </th>
        <th></th>
    </tr>
    
@foreach (var item in Model) {
    <tr>
        <td>
            @item.Author?.UserName
        </td>
        <td>
            <div md-content="@item.Content"/>
        </td>
        <td>
            <table>
                <tr>
                    <td>
            @Html.DisplayFor(modelItem => item.DateModified)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Photo)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.UserModified)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Rate)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Title)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Visible)
        </td>
                </tr>
            </table>
        </td>
        <td>
            <ul class="actiongroup">
                <li>
            <a asp-action="Edit" asp-route-id="@item.Id">Edit</a>
            </li><li>
            <a asp-action="Details" asp-route-id="@item.Id">Details</a>
            </li><li>
            <a asp-action="Delete" asp-route-id="@item.Id">Delete</a>
            </li>
            </ul>
        </td>
    </tr>
}
</table>



