RazorPages/Pages/Climbs/Index.cshtml

55 lines
1.4 KiB
Plaintext

@page
@model RazorPages.Pages.Climbs.IndexModel
@{
ViewData["Title"] = "Index";
}
<h1>Index</h1>
<p>
<a asp-page="Create">Create New</a>
</p>
<table class="table">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.Climb[0].Name)
</th>
<th>
@Html.DisplayNameFor(model => model.Climb[0].Grade)
</th>
<th>
@Html.DisplayNameFor(model => model.Climb[0].Location)
</th>
<th>
@Html.DisplayNameFor(model => model.Climb[0].Description)
</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.Climb) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.Grade)
</td>
<td>
@Html.DisplayFor(modelItem => item.Location)
</td>
<td>
@Html.DisplayFor(modelItem => item.Description)
</td>
<td>
<a asp-page="./Edit" asp-route-id="@item.Id">Edit</a> |
<a asp-page="./Details" asp-route-id="@item.Id">Details</a> |
<a asp-page="./Delete" asp-route-id="@item.Id">Delete</a>
</td>
</tr>
}
</tbody>
</table>