diff --git a/src/JobsMedical.Web/Pages/Me/Index.cshtml b/src/JobsMedical.Web/Pages/Me/Index.cshtml
index 772f252..3a1e07d 100644
--- a/src/JobsMedical.Web/Pages/Me/Index.cshtml
+++ b/src/JobsMedical.Web/Pages/Me/Index.cshtml
@@ -16,8 +16,6 @@
};
}
-
پنل کارجو
diff --git a/src/JobsMedical.Web/Pages/Shared/_Layout.cshtml b/src/JobsMedical.Web/Pages/Shared/_Layout.cshtml
index 597dfd7..4dc39c4 100644
--- a/src/JobsMedical.Web/Pages/Shared/_Layout.cshtml
+++ b/src/JobsMedical.Web/Pages/Shared/_Layout.cshtml
@@ -6,20 +6,26 @@
var title = ViewData["Title"] as string;
int unreadCount = 0;
int meId = 0;
- string? meName = null;
+ string? meFullName = null;
+ string? mePhone = null;
bool meHasAvatar = false;
if (User.Identity?.IsAuthenticated == true && int.TryParse(User.FindFirstValue(ClaimTypes.NameIdentifier), out meId))
{
unreadCount = await Notifications.UnreadCountAsync(meId);
var info = await Db.Users.Where(u => u.Id == meId)
.Select(u => new { u.FullName, u.Phone, HasAvatar = u.Avatar != null }).FirstOrDefaultAsync();
- meName = string.IsNullOrWhiteSpace(info?.FullName) ? info?.Phone : info!.FullName;
+ meFullName = string.IsNullOrWhiteSpace(info?.FullName) ? null : info!.FullName!.Trim();
+ mePhone = info?.Phone;
meHasAvatar = info?.HasAvatar ?? false;
}
- // Person glyph when there's no real name yet (avoid showing a phone digit like "0").
- var meInitial = (!string.IsNullOrWhiteSpace(meName) && !char.IsDigit(meName!.Trim()[0]))
- ? meName!.Trim().Substring(0, 1) : "👤";
- var meLabel = (!string.IsNullOrWhiteSpace(meName) && !char.IsDigit(meName!.Trim()[0])) ? meName! : "حساب من";
+ // Avatar glyph/label: prefer a real name; never show a bare phone digit like "0".
+ var meInitial = meFullName is not null ? meFullName.Substring(0, 1) : "👤";
+ var meLabel = meFullName ?? "حساب من";
+
+ // Single, role-aware dashboard entry — the full menu lives in the panel sub-nav (_PanelNav).
+ var dashUrl = "/Me/Index"; var dashLabel = "داشبورد من"; var dashIcon = "🗂️";
+ if (User.IsInRole("Admin")) { dashUrl = "/Admin/Overview"; dashLabel = "پنل مدیریت"; dashIcon = "🛠️"; }
+ else if (User.IsInRole("FacilityAdmin")) { dashUrl = "/Employer/Index"; dashLabel = "پنل کارفرما"; dashIcon = "🏥"; }
// --- SEO context ---
var baseUrl = $"{Context.Request.Scheme}://{Context.Request.Host}";
@@ -33,6 +39,11 @@
string[] noindexPrefixes = { "/Admin", "/Me", "/Employer", "/Account", "/Preferences" };
var noIndex = (ViewData["NoIndex"] as bool? ?? false)
|| noindexPrefixes.Any(p => path.StartsWith(p, StringComparison.OrdinalIgnoreCase));
+
+ // Show the centralized dashboard sub-nav on any logged-in panel page.
+ string[] panelPrefixes = { "/Admin", "/Me", "/Employer", "/Preferences" };
+ var showPanelNav = User.Identity?.IsAuthenticated == true
+ && panelPrefixes.Any(p => path.StartsWith(p, StringComparison.OrdinalIgnoreCase));
}
@@ -126,22 +137,26 @@
▾