Files
hamkadr/src/JobsMedical.Web/Pages/Shared/_Layout.cshtml
T

115 lines
5.9 KiB
Plaintext
Raw Normal View History

@using System.Security.Claims
@inject JobsMedical.Web.Services.NotificationService Notifications
@{
var title = ViewData["Title"] as string;
int unreadCount = 0;
if (User.Identity?.IsAuthenticated == true && int.TryParse(User.FindFirstValue(ClaimTypes.NameIdentifier), out var _uid))
{
unreadCount = await Notifications.UnreadCountAsync(_uid);
}
}
<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@(title is null ? "همکادر | شیفت و استخدام کادر درمان" : title + " | همکادر")</title>
<meta name="description" content="@(ViewData["Description"] as string ?? "همکادر؛ سامانه یافتن شیفت و موقعیت استخدامی برای کادر درمان (پزشک، پرستار، ماما و تکنسین) در بیمارستان‌ها و کلینیک‌های تهران.")" />
@* Preload the body-weight font so the swap from Tahoma happens fast. Vazirmatn is
self-hosted under wwwroot/fonts (@@font-face in site.css) — no external CDN. *@
<link rel="preload" href="~/fonts/Vazirmatn-Regular.woff2" as="font" type="font/woff2" crossorigin />
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
@* PWA: installable app (Web/Windows/Android via this manifest; iOS via apple-* tags) *@
<link rel="manifest" href="/manifest.webmanifest" />
<meta name="theme-color" content="#0e8f8a" />
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<meta name="apple-mobile-web-app-title" content="همکادر" />
</head>
<body>
<header class="site-header">
<div class="container header-inner">
<a class="brand" asp-page="/Index">
<span class="brand-mark">ه</span>
<span class="brand-text">همکادر</span>
</a>
2026-06-04 14:07:22 +03:30
@* Always-visible bell on mobile (next to the burger) so notifications stay one tap away *@
@if (User.Identity?.IsAuthenticated == true)
{
<a class="bell-mobile" asp-page="/Me/Notifications" title="اعلان‌ها">🔔@if (unreadCount > 0) {<span class="bell-badge">@JalaliDate.ToPersianDigits(unreadCount > 99 ? "99+" : unreadCount.ToString())</span>}</a>
}
<input type="checkbox" id="nav-toggle" class="nav-toggle" hidden />
<label for="nav-toggle" class="nav-burger" aria-label="باز/بستن منو">
<span></span><span></span><span></span>
</label>
<div class="nav-collapse">
<nav class="main-nav">
<a asp-page="/Index">خانه</a>
<a asp-page="/Shifts/Index">شیفت‌ها</a>
<a asp-page="/Jobs/Index">استخدام</a>
<a asp-page="/Calendar/Index">تقویم هفتگی</a>
<a asp-page="/Download">دریافت اپ</a>
<a asp-page="/Facilities/Index">مراکز درمانی</a>
<a asp-page="/Preferences/Index">علاقه‌مندی‌ها</a>
</nav>
<div class="header-actions">
@if (User.Identity?.IsAuthenticated == true)
{
2026-06-04 14:07:22 +03:30
@if (User.IsInRole("Admin"))
{
<a class="nav-action" asp-page="/Admin/Overview">پنل مدیریت</a>
<a class="nav-action" asp-page="/Admin/Settings">تنظیمات</a>
2026-06-04 14:07:22 +03:30
}
@if (User.IsInRole("FacilityAdmin"))
{
<a class="nav-action" asp-page="/Employer/Index">پنل کارفرما</a>
}
<a class="nav-action bell-inline" asp-page="/Me/Notifications" title="اعلان‌ها"><span class="bell-ico">🔔</span><span class="bell-label">اعلان‌ها</span>@if (unreadCount > 0) {<span class="bell-badge">@JalaliDate.ToPersianDigits(unreadCount > 99 ? "99+" : unreadCount.ToString())</span>}</a>
2026-06-04 14:07:22 +03:30
<a class="nav-action" asp-page="/Me/Index">پنل کارجو</a>
<form method="post" asp-page="/Account/Logout" style="display:contents;">
<button type="submit" class="btn btn-outline btn-sm">خروج</button>
</form>
}
2026-06-04 14:07:22 +03:30
else
{
2026-06-04 14:07:22 +03:30
<a class="btn btn-outline btn-sm" asp-page="/Account/Login">ورود</a>
}
2026-06-04 14:07:22 +03:30
</div>
</div>
</div>
</header>
<main role="main">
@RenderBody()
</main>
<footer class="site-footer">
<div class="container footer-inner">
<div>
<span class="brand-mark sm">ه</span>
<strong>همکادر</strong>
<p class="muted">سامانه واسط میان کادر درمان و مراکز درمانی برای شیفت و استخدام</p>
</div>
<div class="muted">
<a asp-page="/Download" style="font-weight:700;">📲 دریافت اپلیکیشن</a>
· © ۱۴۰۵ همکادر — همه حقوق محفوظ است
</div>
</div>
</footer>
@* Register the PWA service worker (offline + push notifications). *@
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', function () { navigator.serviceWorker.register('/sw.js').catch(function () {}); });
}
</script>
@await RenderSectionAsync("Scripts", required: false)
</body>
</html>