Files
hamkadr/src/JobsMedical.Web/Pages/Talent/Details.cshtml
T
soroush.asadi 4c0b29addf
CI/CD / CI · dotnet build (push) Successful in 2m26s
CI/CD / Deploy · hamkadr (push) Successful in 58s
Contact reveal modal: click phone/contact on cards and detail pages
Adds a lazy-loaded contact modal. Any element with data-contact-type +
data-contact-id (the «📞 تماس» button on shift/job/talent/recommendation cards,
and the contact CTA on the three detail pages) opens a modal that fetches the
listing's numbers from a new GET /contact endpoint and renders them with click-
to-call links. Numbers are loaded only on click, so they never sit in list-page
HTML (privacy / anti-scrape). The endpoint logs the same Apply interest signal
for shift/job that the old inline-reveal POST did, and falls back to the
facility phone (or Divar source link for talent) when an ad has no own contacts.

Verified locally: GET /contact?type=shift&id=1 → {title, contacts:[{value:
'021-82032000', href:'tel:...'}]}, and the modal opens and renders on the shift
detail page.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 09:04:08 +03:30

67 lines
3.5 KiB
Plaintext

@page "{id:int}"
@model JobsMedical.Web.Pages.Talent.DetailsModel
@{
var t = Model.Item!;
var heading = string.IsNullOrWhiteSpace(t.PersonName) ? (t.Role?.Name ?? "آماده به کار") : t.PersonName!;
ViewData["Title"] = $"{heading} — آماده به کار";
// Personal contact info: keep this page out of search indexes.
ViewData["NoIndex"] = true;
string comp;
if (t.PayType == JobsMedical.Web.Models.PayType.Percentage && t.SharePercent is int sp)
comp = $"{JalaliDate.ToPersianDigits(sp.ToString())}٪ سهم درآمد";
else if (t.PayAmount is long pa && pa > 0)
comp = JalaliDate.Toman(pa) + " مدنظر";
else
comp = "توافقی";
}
<div class="page-head">
<div class="container">
<h1>@heading</h1>
<p class="muted">آماده همکاری @(t.Role is not null ? "— " + t.Role.Name : "") · 📍 @t.City?.Name@(t.District?.Name is not null ? "، " + t.District.Name : (t.AreaNote is not null ? "، " + t.AreaNote : ""))</p>
</div>
</div>
<div class="container section">
<div class="detail-grid">
<div>
<div class="card card-pad">
<div class="row" style="gap:8px; flex-wrap:wrap;">
@if (t.Role is not null) { <span class="badge badge-type">@t.Role.Name</span> }
<span class="badge badge-talent">آماده به کار</span>
@if (t.YearsExperience is int yrs && yrs > 0) { <span class="badge badge-day">@JalaliDate.ToPersianDigits(yrs.ToString()) سال سابقه</span> }
@if (t.IsLicensed) { <span class="badge badge-verified">پروانه‌دار</span> }
@if (t.Gender != JobsMedical.Web.Models.Gender.Any) { <span class="badge badge-gender">@JalaliDate.GenderLabel(t.Gender)</span> }
@if (t.Availability is JobsMedical.Web.Models.EmploymentType emp)
{
<span class="badge badge-job">@(emp switch {
JobsMedical.Web.Models.EmploymentType.FullTime => "تمام‌وقت",
JobsMedical.Web.Models.EmploymentType.PartTime => "پاره‌وقت",
JobsMedical.Web.Models.EmploymentType.Contract => "قراردادی",
_ => "طرح" })</span>
}
</div>
@if (!string.IsNullOrWhiteSpace(t.AreaNote))
{
<p style="margin:12px 0 0;"><strong>محدوده کاری:</strong> @t.AreaNote</p>
}
<p style="margin:12px 0 0;"><strong>دستمزد مدنظر:</strong> @comp</p>
@if (!string.IsNullOrWhiteSpace(t.Description))
{
<hr style="border:none; border-top:1px solid var(--line); margin:16px 0;" />
<p style="white-space:pre-wrap; margin:0;">@t.Description</p>
}
</div>
</div>
<aside>
<div class="card card-pad">
<h3 style="margin-top:0;">راه‌های ارتباطی</h3>
<button type="button" class="btn btn-accent btn-block btn-lg contact-trigger"
data-contact-type="talent" data-contact-id="@t.Id">📞 مشاهده راه‌های ارتباطی</button>
<p class="muted" style="font-size:12px; margin:10px 0 0;">با کلیک، شماره تماس و راه‌های ارتباطی نمایش داده می‌شود.</p>
</div>
</aside>
</div>
</div>