From a16a805869d6928ef724b6c0d8c4e81c2813073e Mon Sep 17 00:00:00 2001 From: "soroush.asadi" Date: Sat, 20 Jun 2026 22:57:36 +0330 Subject: [PATCH] =?UTF-8?q?Hide=20facility/location=20when=20it's=20the=20?= =?UTF-8?q?=C2=AB=D9=86=D8=A7=D9=85=D8=B4=D8=AE=D8=B5=C2=BB=20placeholder?= =?UTF-8?q?=20=E2=80=94=20omit,=20don't=20print=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a listing's facility is the unknown placeholder, don't show «مرکز درمانی (نامشخص)» anywhere — just leave the location out. Gated on HasRealEmployer: - cards (shift/job/recommendation): the 🏥 facility line is omitted - shift detail: H1 drops the «— نامشخص» suffix; title/description use city only; «شیفت‌های دیگر این مرکز» hidden; report label generic - job detail: subtitle drops 🏥, keeps 📍 city; title/description city-only Co-Authored-By: Claude Opus 4.8 --- src/JobsMedical.Web/Pages/Jobs/Details.cshtml | 9 ++++++--- src/JobsMedical.Web/Pages/Shared/_JobCard.cshtml | 5 ++++- .../Pages/Shared/_RecommendationCard.cshtml | 5 ++++- src/JobsMedical.Web/Pages/Shared/_ShiftCard.cshtml | 5 ++++- src/JobsMedical.Web/Pages/Shifts/Details.cshtml | 13 ++++++++----- 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/JobsMedical.Web/Pages/Jobs/Details.cshtml b/src/JobsMedical.Web/Pages/Jobs/Details.cshtml index fe307d2..d91807b 100644 --- a/src/JobsMedical.Web/Pages/Jobs/Details.cshtml +++ b/src/JobsMedical.Web/Pages/Jobs/Details.cshtml @@ -3,13 +3,16 @@ @{ var j = Model.Job!; var f = j.Facility!; + var hasFac = JobsMedical.Web.Services.SeoJsonLd.HasRealEmployer(f); // false for the «نامشخص» placeholder var jobContacts = (j.Contacts ?? new List()).ToList(); // Map: listing's own approx coords (aggregated) then facility's; aggregated = approximate area. var mapLat = j.Lat ?? f.Lat; var mapLng = j.Lng ?? f.Lng; var mapApprox = j.Source == JobsMedical.Web.Models.ShiftSource.Aggregated; ViewData["Title"] = j.Title; - ViewData["Description"] = $"{j.Title} در {f.Name}، {f.City?.Name}. موقعیت استخدامی برای {j.Role?.Name}."; + ViewData["Description"] = hasFac + ? $"{j.Title} در {f.Name}، {f.City?.Name}. موقعیت استخدامی برای {j.Role?.Name}." + : $"{j.Title} در {f.City?.Name}. موقعیت استخدامی برای {j.Role?.Name}."; // Don't let Google index filled/expired openings (avoids dead "Job for jobs" results). if (j.Status != JobsMedical.Web.Models.ShiftStatus.Open) ViewData["NoIndex"] = true; string empLabel = j.EmploymentType switch @@ -37,7 +40,7 @@ @if (f.IsVerified) { ✓ مرکز تأیید شده }

@j.Title

-

🏥 @f.Name — 📍 @f.City?.Name@(f.District is not null ? "، " + f.District.Name : "")

+

@(hasFac ? "🏥 " + f.Name + " — " : "")📍 @f.City?.Name@(f.District is not null ? "، " + f.District.Name : "")

@@ -144,7 +147,7 @@ @if (j.Facility is not null) {
- شکایت از این مرکز (@j.Facility.Name) + شکایت از این @(hasFac ? "مرکز (" + j.Facility.Name + ")" : "آگهی")
diff --git a/src/JobsMedical.Web/Pages/Shared/_JobCard.cshtml b/src/JobsMedical.Web/Pages/Shared/_JobCard.cshtml index 304b1e0..4d14bc2 100644 --- a/src/JobsMedical.Web/Pages/Shared/_JobCard.cshtml +++ b/src/JobsMedical.Web/Pages/Shared/_JobCard.cshtml @@ -27,7 +27,10 @@ { @JalaliDate.GenderLabel(Model.GenderRequirement) } - 🏥 @JobsMedical.Web.Services.SearchHighlight.Mark(Model.Facility?.Name, q) + @if (JobsMedical.Web.Services.SeoJsonLd.HasRealEmployer(Model.Facility)) + { + 🏥 @JobsMedical.Web.Services.SearchHighlight.Mark(Model.Facility?.Name, q) + }
📍 @Model.Facility?.City?.Name@(Model.Facility?.District is not null ? "، " + Model.Facility.District.Name : "")
@if (Model.DistanceKm is double km) diff --git a/src/JobsMedical.Web/Pages/Shared/_RecommendationCard.cshtml b/src/JobsMedical.Web/Pages/Shared/_RecommendationCard.cshtml index d070c61..2ca4d77 100644 --- a/src/JobsMedical.Web/Pages/Shared/_RecommendationCard.cshtml +++ b/src/JobsMedical.Web/Pages/Shared/_RecommendationCard.cshtml @@ -19,7 +19,10 @@ { @JalaliDate.GenderLabel(s.GenderRequirement) } - 🏥 @s.Facility?.Name + @if (JobsMedical.Web.Services.SeoJsonLd.HasRealEmployer(s.Facility)) + { + 🏥 @s.Facility?.Name + } 📍 @s.Facility?.City?.Name
📅 @JalaliDate.WeekDayName(s.Date)، @JalaliDate.ToLongDate(s.Date) — 🕐 @JalaliDate.Time(s.StartTime)
diff --git a/src/JobsMedical.Web/Pages/Shared/_ShiftCard.cshtml b/src/JobsMedical.Web/Pages/Shared/_ShiftCard.cshtml index f32089c..06430c4 100644 --- a/src/JobsMedical.Web/Pages/Shared/_ShiftCard.cshtml +++ b/src/JobsMedical.Web/Pages/Shared/_ShiftCard.cshtml @@ -23,7 +23,10 @@ { ✓ تأیید شده } - 🏥 @JobsMedical.Web.Services.SearchHighlight.Mark(Model.Facility?.Name, q) + @if (JobsMedical.Web.Services.SeoJsonLd.HasRealEmployer(Model.Facility)) + { + 🏥 @JobsMedical.Web.Services.SearchHighlight.Mark(Model.Facility?.Name, q) + }
📍 @Model.Facility?.City?.Name@(Model.Facility?.District is not null ? "، " + Model.Facility.District.Name : "")
@if (Model.DistanceKm is double km) diff --git a/src/JobsMedical.Web/Pages/Shifts/Details.cshtml b/src/JobsMedical.Web/Pages/Shifts/Details.cshtml index 12af487..0276ee2 100644 --- a/src/JobsMedical.Web/Pages/Shifts/Details.cshtml +++ b/src/JobsMedical.Web/Pages/Shifts/Details.cshtml @@ -3,14 +3,17 @@ @{ var s = Model.Shift!; var f = s.Facility!; + var hasFac = JobsMedical.Web.Services.SeoJsonLd.HasRealEmployer(f); // false for the «نامشخص» placeholder var shiftContacts = (s.Contacts ?? new List()).ToList(); // Map: prefer the listing's own approx coords (aggregated ads) then the facility's. Aggregated = // approximate → shown as an area circle with a disclaimer, never a precise pin. var mapLat = s.Lat ?? f.Lat; var mapLng = s.Lng ?? f.Lng; var mapApprox = s.Source == JobsMedical.Web.Models.ShiftSource.Aggregated; - ViewData["Title"] = $"شیفت {s.SpecialtyRequired} - {f.Name}"; - ViewData["Description"] = $"شیفت {s.SpecialtyRequired} در {f.Name}، {f.City?.Name}، تاریخ {JalaliDate.ToLongDate(s.Date)} از ساعت {JalaliDate.Time(s.StartTime)}."; + ViewData["Title"] = hasFac ? $"شیفت {s.SpecialtyRequired} - {f.Name}" : $"شیفت {s.SpecialtyRequired} — {f.City?.Name}"; + ViewData["Description"] = hasFac + ? $"شیفت {s.SpecialtyRequired} در {f.Name}، {f.City?.Name}، تاریخ {JalaliDate.ToLongDate(s.Date)} از ساعت {JalaliDate.Time(s.StartTime)}." + : $"شیفت {s.SpecialtyRequired} در {f.City?.Name}، تاریخ {JalaliDate.ToLongDate(s.Date)} از ساعت {JalaliDate.Time(s.StartTime)}."; // Past/filled shifts shouldn't stay in the index as dead pages. if (s.Status != JobsMedical.Web.Models.ShiftStatus.Open || s.Date < DateOnly.FromDateTime(DateTime.UtcNow)) ViewData["NoIndex"] = true; @@ -36,7 +39,7 @@ ✓ مرکز تأیید شده } -

@s.SpecialtyRequired — @f.Name

+

@s.SpecialtyRequired@(hasFac ? " — " + f.Name : "")

📍 @f.City?.Name @(string.IsNullOrEmpty(f.Address) ? "" : "، " + f.Address)

@@ -102,7 +105,7 @@ } - @if (Model.MoreAtFacility.Count > 0) + @if (hasFac && Model.MoreAtFacility.Count > 0) {

شیفت‌های دیگر این مرکز

@@ -160,7 +163,7 @@
- شکایت از این مرکز (@f.Name) + شکایت از این @(hasFac ? "مرکز (" + f.Name + ")" : "آگهی")