Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create sidebar #33

Merged
merged 1 commit into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 2 additions & 22 deletions CheckDrive.Web/CheckDrive.Web/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - CheckDrive.Web</title>
<link href="https://cdn.syncfusion.com/ej2/25.1.35/bootstrap5.css" rel="stylesheet" />

<link href="https://cdn.syncfusion.com/ej2/20.1.55/bootstrap5-dark.css" rel="stylesheet" />
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/lib/bootstrap/dist/js/bootstrap.bundle.js" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css" integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A==" crossorigin="anonymous" referrerpolicy="no-referrer" />
Expand All @@ -16,27 +17,6 @@
<body>
<partial name="_Sidebar" />

<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container-fluid">
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">CheckDrive.Web</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="main-content">
<div class="container mt-5">
<div class="row justify-content-center">
Expand Down
121 changes: 119 additions & 2 deletions CheckDrive.Web/CheckDrive.Web/Views/Shared/_SideBar.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,124 @@
For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
List<Object> menuItems = new List<Object>();

menuItems.Add(new
{
text = "Common",
separator = true,
});
menuItems.Add(new
{
text = "Dashboard",
url = "/dashboard",
iconCss = "fa-solid fa-home",
});
menuItems.Add(new
{
text = "Sales",
url = "/sales",
iconCss = "fa-solid fa-money-bill-trend-up",
});
menuItems.Add(new
{
text = "Supplies",
iconCss = "fa-solid fa-truck-ramp-box",
url = "/supplies"
});

menuItems.Add(new
{
text = "Partners",
separator = true,
});

menuItems.Add(new
{
text = "Customers",
iconCss = "fa-solid fa-user-group",
url = "/customers"
});

menuItems.Add(new
{
text = "Suppliers",
iconCss = "fa-solid fa-people-arrows",
url = "/suppliers"
});

menuItems.Add(new
{
text = "Products",
separator = true,
});
menuItems.Add(new
{
text = "Products",
iconCss = "fa-solid fa-cube",
url = "/products"
});
menuItems.Add(new
{
text = "Categories",
iconCss = "fa-solid fa-box",
url = "/categories"
});

menuItems.Add(new
{
text = "Отчёты",
separator = true,
});
menuItems.Add(new
{
text = "Reports",
iconCss = "fa-solid fa-chart-simple",
url = "/reports"
});
menuItems.Add(new
{
text = "Settings",
iconCss = "fa-solid fa-gear",
url = "#"
});
}

<ejs-sidebar id="sidebar" width="290px">
</ejs-sidebar>
<ejs-sidebar id="sidebar" width="290px" enableDock dockSize="100px"
target=".dock-target" enableGestures="false">
<e-content-template>

<div class="logo-wrapper">
<div class="app-logo">
<img src='~/images/Logo.png' style="height: 50px; width:50px" />
</div>
<div class="w-100"></div>
<i id="sidebar-toggler" class="fa-solid"></i>
</div>

<div class="profile-wrapper">
<i class="fa-solid fa-user"></i>
<div class="titles d-flex flex-column ps-3">
<h6 class="mb-0" id="loginName">@ViewBag.User</h6>
</div>
</div>

<ejs-menu id="menu"
items="menuItems"
orientation="Vertical"
hamburgerMode></ejs-menu>
</e-content-template>
</ejs-sidebar>
<script>
var userLoginName = "JohnDoe";

document.getElementById("loginName").innerText = userLoginName;
</script>
<script>
document.addEventListener('DOMContentLoaded', function () {
dockBar = document.getElementById('sidebar').ej2_instances[0];
document.getElementById('sidebar-toggler').onclick = function () {
dockBar.toggle();
};
});
</script>
Loading
Loading