@model IEnumerable<CleanMVC.Application.DTOs.ProductDTO>

@{
    ViewData["Title"] = "Products Management";
}
<style>
    .modal-lg {
        max-width: 80%;
    }
</style>
<div>
    <h2>@ViewData["Title"]</h2>
</div>
<hr />
<div class="row">
    <div class="col-md-12">
        <div>
            <div class="pull-left">
                <a asp-action="Create" class="btn btn-primary">
                    <span title="Register New" class="fas fa-plus"></span> Register New
                </a>
            </div>
        </div>
    </div>
</div>
<br />
<div class="panel panel-default">
    <table class="table table-striped">
        <thead>
            <tr>
                <th>
                    @Html.DisplayNameFor(model => model.Name)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.Description)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.Price)
                </th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                <tr>
                    <td>
                        @Html.DisplayFor(modelItem => item.Name)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Description)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Price)
                    </td>
                    <td>
                        <a asp-action="Edit" asp-route-id="@item.Id" title="Edit" class="btn btn-warning">
                            <span class="fas fa-edit">Edit</span>
                        </a>

                        <a asp-action="Details" asp-route-id="@item.Id" title="Details" class="btn btn-primary">
                            <span class="fas fa-search">Details</span>
                        </a>

                        <a asp-action="Delete" asp-route-id="@item.Id" title="Delete" class="btn btn-danger">
                            <span class="fas fa-trash-alt">Delete</span>
                        </a>
                    </td>
                </tr>
            }
        </tbody>
    </table>
</div>