78 lines
2.2 KiB
Plaintext
78 lines
2.2 KiB
Plaintext
|
@model IEnumerable<ThAmCo.Events.Data.Event>
|
||
|
|
||
|
@{
|
||
|
ViewData["Title"] = "Index";
|
||
|
}
|
||
|
|
||
|
<h2>Index</h2>
|
||
|
|
||
|
<p>
|
||
|
<a asp-action="Create">Create New</a>
|
||
|
</p>
|
||
|
<table class="table">
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th>
|
||
|
@Html.DisplayNameFor(model => model.Title)
|
||
|
</th>
|
||
|
<th>
|
||
|
@Html.DisplayNameFor(model => model.Date)
|
||
|
</th>
|
||
|
<th>
|
||
|
@Html.DisplayNameFor(model => model.Duration)
|
||
|
</th>
|
||
|
<th>
|
||
|
@Html.DisplayNameFor(model => model.TypeId)
|
||
|
</th>
|
||
|
<th>
|
||
|
BookingCount
|
||
|
</th>
|
||
|
<th>
|
||
|
VenueReference
|
||
|
</th>
|
||
|
<th></th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
@foreach (var item in Model) {
|
||
|
<tr>
|
||
|
<td>
|
||
|
@Html.DisplayFor(modelItem => item.Title)
|
||
|
</td>
|
||
|
<td>
|
||
|
@Html.DisplayFor(modelItem => item.Date)
|
||
|
</td>
|
||
|
<td>
|
||
|
@Html.DisplayFor(modelItem => item.Duration)
|
||
|
</td>
|
||
|
<td>
|
||
|
@Html.DisplayFor(modelItem => item.TypeId)
|
||
|
</td>
|
||
|
<td>
|
||
|
@item.Bookings.Count
|
||
|
</td>
|
||
|
<td>
|
||
|
@Html.DisplayFor(modelItem => item.VenueReference)
|
||
|
</td>
|
||
|
<td>
|
||
|
@if (item.Staffings.Count < Math.Ceiling((double)item.Bookings.Count / 10))
|
||
|
{
|
||
|
@Html.Raw("⚠ Only have " + item.Staffings.Count + " staff members, " + Math.Ceiling((double)item.Bookings.Count / 10) + " are required.")
|
||
|
}
|
||
|
</td>
|
||
|
<td>
|
||
|
@if (item.Staffings == null || !item.Staffings.Any(s => s.Staff.FirstAid))
|
||
|
{
|
||
|
@Html.Raw("⚠ There is no first aid staff member.")
|
||
|
}
|
||
|
</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>
|
||
|
}
|
||
|
</tbody>
|
||
|
</table>
|