@model IEnumerable<CommandForm>

@{
    ViewData["Title"] = "Index";
}

<h2>Index</h2>

<p>
    <a asp-action="Create">Create New</a>
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Title)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Context)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ActionName)
        </th>
        <th></th>
    </tr>
    
@foreach (var item in Model) {
    <tr class="@(item.Context.Hidden?"disabled":null)">
        <td>
            @Html.DisplayFor(modelItem => item.Title)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Context)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ActionName)
        </td>
        <td>
            <a asp-action="Edit" asp-route-id="@item.Id">Edit</a> |
            <a asp-action="Details" asp-route-id="@item.Id">Details</a> |
            <a asp-action="Delete" asp-route-id="@item.Id">Delete</a>
        </td>
    </tr>
}
</table>
