Fix useless bare-divar.ir links + hide empty homepage shifts section
CI/CD / CI · dotnet build (push) Successful in 4m6s
CI/CD / Deploy · hamkadr (push) Successful in 3m35s

- Divar listings with no extractable post token were given SourceUrl «https://divar.ir» — a link
  that just opens Divar''s homepage, not the ad. Store null instead, and guard the contact-modal
  fallback to require a real path (so existing bare-domain links stop being offered too).
- Homepage «جدیدترین شیفت‌ها»: only render when there are real open shifts. Almost all aggregated
  ads are ongoing hiring (jobs), not dated shifts, so the section was showing a fabricated shift
  date (the «۱۸ خرداد» on the welcome page). Now it hides when empty.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-23 11:50:21 +03:30
parent fdeefb7625
commit 39c866f4c7
3 changed files with 19 additions and 19 deletions
+13 -15
View File
@@ -53,27 +53,25 @@
</div>
</section>
<section class="section">
<div class="container">
<div class="section-head">
<h2>جدیدترین شیفت‌ها</h2>
<a href="/Shifts">مشاهده همه ←</a>
</div>
@if (Model.LatestShifts.Count == 0)
{
<div class="empty-state">فعلاً شیفت بازی ثبت نشده است.</div>
}
else
{
@* Shifts are rare for aggregated content (most ads are ongoing hiring, not dated shifts) — only
show the section when there are real open shifts, so we never display a fabricated/empty date. *@
@if (Model.LatestShifts.Count > 0)
{
<section class="section">
<div class="container">
<div class="section-head">
<h2>جدیدترین شیفت‌ها</h2>
<a href="/Shifts">مشاهده همه ←</a>
</div>
<div class="grid grid-3">
@foreach (var s in Model.LatestShifts)
{
<partial name="_ShiftCard" model="s" />
}
</div>
}
</div>
</section>
</div>
</section>
}
@if (Model.LatestJobs.Count > 0)
{