Сделал шаблон для личного кабинета пользователя

This commit is contained in:
Никита Потапов 2024-05-29 14:23:16 +04:00
parent 099384e070
commit bcd851627e
5 changed files with 19 additions and 9 deletions

View File

@ -94,5 +94,16 @@ namespace PolyclinicWebAppImplementer.Controllers
LoginManager.LogginedUser = null; LoginManager.LogginedUser = null;
return RedirectToAction("Login"); return RedirectToAction("Login");
} }
[HttpGet]
[HttpPost]
public IActionResult Privacy()
{
if (LoginManager.LogginedUser == null)
{
return RedirectToAction("Login");
}
return View();
}
} }
} }

View File

@ -8,7 +8,7 @@
public static (string Controller, string Action, string Title, PageVisible Visible) Symptomes = ("Symptomes", "", "Симптомы", PageVisible.AllowOnlyAuthorized); public static (string Controller, string Action, string Title, PageVisible Visible) Symptomes = ("Symptomes", "", "Симптомы", PageVisible.AllowOnlyAuthorized);
public static (string Controller, string Action, string Title, PageVisible Visible) Login = ("User", "Login", "Вход", PageVisible.AllowOnlyNotAuthorized); public static (string Controller, string Action, string Title, PageVisible Visible) Login = ("User", "Login", "Вход", PageVisible.AllowOnlyNotAuthorized);
public static (string Controller, string Action, string Title, PageVisible Visible) Register = ("User", "Register", "Регистрация", PageVisible.AllowOnlyNotAuthorized); public static (string Controller, string Action, string Title, PageVisible Visible) Register = ("User", "Register", "Регистрация", PageVisible.AllowOnlyNotAuthorized);
public static (string Controller, string Action, string Title, PageVisible Visible) Privacy = ("Home", "Privacy", "Политика приватности", PageVisible.AllowAnyBody); public static (string Controller, string Action, string Title, PageVisible Visible) Privacy = ("User", "Privacy", "Личный кабинет", PageVisible.AllowOnlyAuthorized);
public static (string Controller, string Action, string Title, PageVisible Visible) AddRecipeToCourse = ("Home", "AddRecipeToCourse", "Привязка рецепта", PageVisible.AllowOnlyAuthorized); public static (string Controller, string Action, string Title, PageVisible Visible) AddRecipeToCourse = ("Home", "AddRecipeToCourse", "Привязка рецепта", PageVisible.AllowOnlyAuthorized);
public static (string Controller, string Action, string Title, PageVisible Visible) MedicamentsByDiagnoses = ("Home", "MedicamentsByDiagnoses", "Лекарства по болезням", PageVisible.AllowOnlyAuthorized); public static (string Controller, string Action, string Title, PageVisible Visible) MedicamentsByDiagnoses = ("Home", "MedicamentsByDiagnoses", "Лекарства по болезням", PageVisible.AllowOnlyAuthorized);
public static (string Controller, string Action, string Title, PageVisible Visible) DiagnosesReport = ("Home", "DiagnosesReport", "Отчет по болезням", PageVisible.AllowOnlyAuthorized); public static (string Controller, string Action, string Title, PageVisible Visible) DiagnosesReport = ("Home", "DiagnosesReport", "Отчет по болезням", PageVisible.AllowOnlyAuthorized);

View File

@ -1,6 +0,0 @@
@{
ViewBag.SelectedSiteMenuItem = SiteMenuItems.Privacy;
}
<h1>Политика приватности</h1>
<p>Здесь нет никакой приватности</p>

View File

@ -71,8 +71,7 @@
<footer class="border-top footer text-muted bg-light fixed-bottom"> <footer class="border-top footer text-muted bg-light fixed-bottom">
<div class="container"> <div class="container">
&copy; 2024 - Поликлиника БудьтеБольны - <a asp-area="" asp-controller="Home" asp-action="Privacy">Политика конфиденциалности</a> &copy; 2024 - Поликлиника БудьтеБольны</div>
</div>
</footer> </footer>
<script src="~/lib/jquery/dist/jquery.min.js"></script> <script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script> <script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>

View File

@ -0,0 +1,6 @@
@{
ViewBag.SelectedSiteMenuItem = SiteMenuItems.Privacy;
}
<h4>Личный кабинет</h4>
<p>Здесь будут данные пользователя</p>