make views for testing data

This commit is contained in:
Francesco D'Amico
2025-03-30 15:56:17 +02:00
parent b2ba51d297
commit c48d1bb5b2
8 changed files with 201 additions and 8 deletions
@@ -0,0 +1,23 @@
@model Francesco.Recipes.World.Models.BackendModels.Category.Category
@{
ViewData["Title"] = "Category Details";
}
<h2>Category Details</h2>
<div>
<h4>Category</h4>
<hr />
<dl class="row">
<dt class="col-sm-2">
Name
</dt>
<dd class="col-sm-10">
@Model.Name
</dd>
</dl>
</div>
<div>
<a asp-action="Index" class="btn btn-primary">Back to List</a>
</div>
@@ -0,0 +1,28 @@
@model IEnumerable<Francesco.Recipes.World.Models.BackendModels.Category.Category>
@{
ViewData["Title"] = "Categories";
}
<h2>Categories</h2>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
@foreach (var category in Model)
{
<tr>
<td>@category.Name</td>
<td>
<a asp-action="Details" asp-route-id="@category.Id" class="btn btn-primary">Details</a>
<a asp-action="Recipes" asp-route-id="@category.Id" class="btn btn-secondary">Recipes</a>
</td>
</tr>
}
</tbody>
</table>