Hide facility/location when it's the «نامشخص» placeholder — omit, don't print it
CI/CD / CI · dotnet build (push) Successful in 1m6s
CI/CD / Deploy · hamkadr (push) Successful in 1m33s

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 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-20 22:57:36 +03:30
parent baa617daa9
commit a16a805869
5 changed files with 26 additions and 11 deletions
@@ -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<JobsMedical.Web.Models.ContactMethod>()).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) { <span class="badge badge-verified">✓ مرکز تأیید شده</span> }
</div>
<h1 style="margin-top:8px;">@j.Title</h1>
<p class="muted">🏥 @f.Name — 📍 @f.City?.Name@(f.District is not null ? "، " + f.District.Name : "")</p>
<p class="muted">@(hasFac ? "🏥 " + f.Name + " — " : "")📍 @f.City?.Name@(f.District is not null ? "، " + f.District.Name : "")</p>
</div>
</div>
@@ -144,7 +147,7 @@
@if (j.Facility is not null)
{
<details style="margin-top:6px;">
<summary class="muted" style="font-size:12px; cursor:pointer;">شکایت از این مرکز (@j.Facility.Name)</summary>
<summary class="muted" style="font-size:12px; cursor:pointer;">شکایت از این @(hasFac ? "مرکز (" + j.Facility.Name + ")" : "آگهی")</summary>
<form method="post" action="/report" style="margin-top:8px;">
<input type="hidden" name="targetType" value="Facility" />
<input type="hidden" name="targetId" value="@j.Facility.Id" />
@@ -27,7 +27,10 @@
{
<span class="badge badge-gender">@JalaliDate.GenderLabel(Model.GenderRequirement)</span>
}
@if (JobsMedical.Web.Services.SeoJsonLd.HasRealEmployer(Model.Facility))
{
<span>🏥 @JobsMedical.Web.Services.SearchHighlight.Mark(Model.Facility?.Name, q)</span>
}
</div>
<div class="row">📍 @Model.Facility?.City?.Name@(Model.Facility?.District is not null ? "، " + Model.Facility.District.Name : "")</div>
@if (Model.DistanceKm is double km)
@@ -19,7 +19,10 @@
{
<span class="badge badge-gender">@JalaliDate.GenderLabel(s.GenderRequirement)</span>
}
@if (JobsMedical.Web.Services.SeoJsonLd.HasRealEmployer(s.Facility))
{
<span>🏥 @s.Facility?.Name</span>
}
<span>📍 @s.Facility?.City?.Name</span>
</div>
<div class="row">📅 @JalaliDate.WeekDayName(s.Date)، @JalaliDate.ToLongDate(s.Date) — 🕐 @JalaliDate.Time(s.StartTime)</div>
@@ -23,7 +23,10 @@
{
<span class="badge badge-verified">✓ تأیید شده</span>
}
@if (JobsMedical.Web.Services.SeoJsonLd.HasRealEmployer(Model.Facility))
{
<span>🏥 @JobsMedical.Web.Services.SearchHighlight.Mark(Model.Facility?.Name, q)</span>
}
</div>
<div class="row loc-row">📍 @Model.Facility?.City?.Name@(Model.Facility?.District is not null ? "، " + Model.Facility.District.Name : "")</div>
@if (Model.DistanceKm is double km)
@@ -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<JobsMedical.Web.Models.ContactMethod>()).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 @@
<span class="badge badge-verified">✓ مرکز تأیید شده</span>
}
</div>
<h1 style="margin-top:8px;">@s.SpecialtyRequired — @f.Name</h1>
<h1 style="margin-top:8px;">@s.SpecialtyRequired@(hasFac ? " — " + f.Name : "")</h1>
<p class="muted">📍 @f.City?.Name @(string.IsNullOrEmpty(f.Address) ? "" : "، " + f.Address)</p>
</div>
</div>
@@ -102,7 +105,7 @@
</div>
}
@if (Model.MoreAtFacility.Count > 0)
@if (hasFac && Model.MoreAtFacility.Count > 0)
{
<h3 style="margin:26px 0 14px;">شیفت‌های دیگر این مرکز</h3>
<div class="grid grid-3">
@@ -160,7 +163,7 @@
</form>
</details>
<details style="margin-top:6px;">
<summary class="muted" style="font-size:12px; cursor:pointer;">شکایت از این مرکز (@f.Name)</summary>
<summary class="muted" style="font-size:12px; cursor:pointer;">شکایت از این @(hasFac ? "مرکز (" + f.Name + ")" : "آگهی")</summary>
<form method="post" action="/report" style="margin-top:8px;">
<input type="hidden" name="targetType" value="Facility" />
<input type="hidden" name="targetId" value="@f.Id" />