Отредактировал layout
This commit is contained in:
parent
bee93877d1
commit
4197f4e557
19
Polyclinic/PolyclinicWebView/SiteMenuItems.cs
Normal file
19
Polyclinic/PolyclinicWebView/SiteMenuItems.cs
Normal file
@ -0,0 +1,19 @@
|
||||
namespace PolyclinicWebView
|
||||
{
|
||||
public static class SiteMenuItems
|
||||
{
|
||||
public static (string Url, string Title) Index = ("", "Главная");
|
||||
public static (string Url, string Title) Courses = ("Courses", "Курсы");
|
||||
public static (string Url, string Title) Diagnoses = ("Diagnoses", "Болезни");
|
||||
public static (string Url, string Title) Medicaments = ("Medicaments", "Лекарства");
|
||||
public static (string Url, string Title) Procedures = ("Procedures", "Процедуры");
|
||||
public static (string Url, string Title) Recipes = ("Recipes", "Рецепты");
|
||||
public static (string Url, string Title) Symptomes = ("Symptomes", "Симптомы");
|
||||
public static (string Url, string Title) Users = ("Users", "Пользователи");
|
||||
|
||||
public static List<(string Url, string Title)> MenuItemsOrder = new List<(string Url, string Title)>
|
||||
{
|
||||
Index, Courses, Diagnoses, Medicaments, Procedures, Recipes, Symptomes, Users
|
||||
};
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@
|
||||
For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
||||
*@
|
||||
@{
|
||||
ViewBag.SelectedSiteMenuItem = SiteMenuItems.Courses;
|
||||
}
|
||||
<div>
|
||||
<table class="table">
|
||||
|
@ -2,4 +2,5 @@
|
||||
For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
||||
*@
|
||||
@{
|
||||
ViewBag.SelectedSiteMenuItem = SiteMenuItems.Diagnoses;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
@{
|
||||
ViewData["Title"] = "Home Page";
|
||||
ViewBag.SelectedSiteMenuItem = SiteMenuItems.Index;
|
||||
}
|
||||
|
||||
<div class="text-center">
|
||||
|
@ -1,7 +1,7 @@
|
||||
@using PolyclinicContracts.ViewModels
|
||||
@model List<MedicamentViewModel>
|
||||
@{
|
||||
ViewData["Title"] = "Medicaments";
|
||||
ViewBag.SelectedSiteMenuItem = SiteMenuItems.Medicaments;
|
||||
}
|
||||
<div class="text-center">
|
||||
<h1 class="display-4">Препараты</h1>
|
||||
|
@ -2,4 +2,5 @@
|
||||
For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
||||
*@
|
||||
@{
|
||||
ViewBag.SelectedSiteMenuItem = SiteMenuItems.Procedures;
|
||||
}
|
||||
|
@ -2,4 +2,5 @@
|
||||
For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
||||
*@
|
||||
@{
|
||||
ViewBag.SelectedSiteMenuItem = SiteMenuItems.Recipes;
|
||||
}
|
||||
|
@ -2,4 +2,5 @@
|
||||
For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
||||
*@
|
||||
@{
|
||||
ViewBag.SelectedSiteMenuItem = SiteMenuItems.Symptomes;
|
||||
}
|
||||
|
@ -2,4 +2,5 @@
|
||||
For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
||||
*@
|
||||
@{
|
||||
ViewBag.SelectedSiteMenuItem = SiteMenuItems.Users;
|
||||
}
|
||||
|
@ -3,7 +3,16 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@ViewData["Title"] - PolyclinicWebView</title>
|
||||
<title>
|
||||
@if (ViewData.ContainsKey("SelectedSiteMenuItem"))
|
||||
{
|
||||
@ViewBag.SelectedSiteMenuItem.Item2
|
||||
}
|
||||
else if (ViewData.ContainsKey("Title"))
|
||||
{
|
||||
@ViewData["Title"]
|
||||
}
|
||||
</title>
|
||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
|
||||
<link rel="stylesheet" href="~/PolyclinicWebView.styles.css" asp-append-version="true" />
|
||||
@ -18,33 +27,20 @@
|
||||
</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 fw-bold" asp-area="" asp-controller="Home" asp-action="Index">Главная</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Register">Регистрация</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Courses">Курсы приема препаратов</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Diagnoses">Диагнозы</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Medicaments">Препараты</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Procedures">Процедуры</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Recipes">Рецепты</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Symptomes">Симптомы</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Users">Пользователи</a>
|
||||
</li>
|
||||
@foreach (var menuItem in SiteMenuItems.MenuItemsOrder)
|
||||
{
|
||||
<li class="menu-item">
|
||||
@Html.RouteLink(menuItem.Title, new
|
||||
{
|
||||
controller = "Home",
|
||||
action = menuItem.Url
|
||||
}, new
|
||||
{
|
||||
@class = "nav-link text-dark" + (menuItem.Equals(ViewBag.SelectedSiteMenuItem) ? " fw-bold" : "")
|
||||
}
|
||||
)
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user