0
0

Add base bundles controller

This commit is contained in:
Sergey Chebotar 2023-02-16 07:47:09 +03:00
parent a27cab1321
commit 9107bb6788
3 changed files with 59 additions and 1 deletions

View File

@ -0,0 +1,20 @@
using Microsoft.AspNetCore.Mvc;
using MyDarling.Models;
namespace MyDarling.Controllers
{
public class BundlesController : Controller
{
private IRepository repository;
public BundlesController(IRepository repository)
{
this.repository = repository;
}
public ActionResult Index()
{
return View(repository);
}
}
}

View File

@ -0,0 +1,38 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@model MyDarling.Models.IRepository
<!DOCTYPE html>
<html>
<head>
<title>Bundles list</title>
<link href="/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
</head>
<body>
<container>
<table class="table table-striped">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Name</th>
<th scope="col">Descrition</th>
<th scope="col">Price</th>
</tr>
</thead>
<tbody>
@foreach (var bundle in Model.Bundles)
{
<tr>
<th scope="row">@bundle.Id</th>
<td>@bundle.Name</td>
<td>@bundle.Description</td>
<td>@bundle.Price</td>
</tr>
}
</tbody>
</table>
</container>
</body>
</html>

View File

@ -1,6 +1,6 @@
<nav class="navbar navbar-expand-lg navbar-dark fixed-top" id="mainNav"> <nav class="navbar navbar-expand-lg navbar-dark fixed-top" id="mainNav">
<div class="container px-4 px-lg-5"> <div class="container px-4 px-lg-5">
<a class="navbar-brand" href="#page-top"><img height="40" src="/assets/img/logo.svg"></a> <a class="navbar-brand" href="/Home/Index#page-top"><img height="40" src="/assets/img/logo.svg"></a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-bs-toggle="collapse" <button class="navbar-toggler navbar-toggler-right" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" data-bs-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false"
aria-label="Toggle navigation"> aria-label="Toggle navigation">