This repository has been archived on 2023-10-28. You can view files and clone it, but cannot push or open issues or pull requests.
pwt-0x01-ng/Areas/Admin/Views/Carousel/Select.cshtml
surtur 6a154f2f90
All checks were successful
continuous-integration/drone/push Build is passing
mv: js to site.js
site.js is already included in _Layout
2021-02-12 22:05:55 +01:00

46 lines
1.6 KiB
Plaintext

@model CarouselViewModel
@{
ViewData["Title"] = "Carousel Select";
}
<h2>@ViewData["Title"]</h2>
<h3>@ViewData["Message"]</h3>
<p>Select all data from carousel.</p>
<br/>
<a asp-action="Create">Create new carousel item</a>
<br/><br/>
@{
if (Model?.Carousels != null && Model.Carousels.Count > 0) {
<table id="carousel_table" class="table table-responsive table-striped table-bordered">
<tr>
<th class="col-sm-1">@Html.DisplayNameFor(model => model.Carousels[0].id)</th>
<th class="col-sm-1">@Html.DisplayNameFor(model => model.Carousels[0].DataTarget)</th>
<th class="col-sm-2">@Html.DisplayNameFor(model => model.Carousels[0].ImageSrc)</th>
<th class="col-sm-2">@Html.DisplayNameFor(model => model.Carousels[0].ImageAlt)</th>
<th class="col-sm-4">@Html.DisplayNameFor(model => model.Carousels[0].CarouselContent)</th>
<th class="col-sm-1">Edit</th>
<th class="col-sm-1">Delete</th>
</tr>
@{
foreach (var carousel_item in Model.Carousels)
{
<tr>
<td class="col-sm-1">@carousel_item.id</td>
<td class="col-sm-1">@carousel_item.DataTarget</td>
<td class="col-sm-2">@carousel_item.ImageSrc</td>
<td class="col-sm-2">@carousel_item.ImageAlt</td>
<td class="col-sm-4">@carousel_item.CarouselContent</td>
<td class="col-sm-1"><a asp-action="Edit" asp-route-id="@carousel_item.id">Edit</a></td>
<td class="col-sm-1"><a asp-action="Delete" asp-route-id="@carousel_item.id" onclick="return item_deletion_confirmation();">Delete</a></td>
</tr>
}
}
</table>
}
else
{
<h2>Carousel is empty</h2>
}
}