Add gender requirement (آقا/خانم/فرقی نمی‌کند) + employee (کارجو) panel
CI/CD / CI · dotnet build (push) Successful in 6m23s
CI/CD / Deploy · hamkadr (push) Failing after 6m30s

- Gender enum + GenderRequirement on Shift/JobOpening + Gender on UserPreferences (migration)
- Employer PostShift/PostJob + admin Review have a gender select; parser detects آقا/خانم/مرد/زن
- Gender badge on cards + detail; gender filter on Shifts/Jobs; gender in preferences
- Recommendations exclude listings whose gender requirement conflicts with the person's gender
- Two panels: new /Me employee (کارجو) panel (recommendations + saved + applied + prefs) alongside /Employer; nav routes by role; /Account/Profile → /Me

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-04 00:19:32 +03:30
parent 8f5d926d42
commit 6cfdd16c42
35 changed files with 1177 additions and 123 deletions
@@ -49,6 +49,10 @@
<div class="info-row"><span class="k">ساعت</span><span class="v">@JalaliDate.Time(s.StartTime) تا @JalaliDate.Time(s.EndTime)</span></div>
<div class="info-row"><span class="k">مدت</span><span class="v">@JalaliDate.ToPersianDigits(s.DurationHours.ToString("0.#")) ساعت</span></div>
<div class="info-row"><span class="k">نقش مورد نیاز</span><span class="v">@(s.Role?.Name ?? s.SpecialtyRequired)</span></div>
@if (s.GenderRequirement != Gender.Any)
{
<div class="info-row"><span class="k">جنسیت</span><span class="v">@JalaliDate.GenderLabel(s.GenderRequirement)</span></div>
}
<div class="info-row"><span class="k">پرداخت</span><span class="v" style="color:var(--primary-dark)">@JalaliDate.PayLabel(s.PayType, s.PayAmount, s.SharePercent)</span></div>
<div style="padding-top:12px;">
<span class="k" style="font-size:13px; color:var(--muted);">بازه ساعت کاری در شبانه‌روز</span>
@@ -78,6 +78,14 @@
}
</select>
</div>
<div class="filter-group">
<label>جنسیت</label>
<select name="GenderFilter" onchange="this.form.submit()">
<option value="">فرقی نمی‌کند</option>
<option value="1" selected="@(Model.GenderFilter == JobsMedical.Web.Models.Gender.Male)">آقا</option>
<option value="2" selected="@(Model.GenderFilter == JobsMedical.Web.Models.Gender.Female)">خانم</option>
</select>
</div>
<div class="filter-group">
<label>نوع شیفت</label>
<select name="ShiftType" onchange="this.form.submit()">
@@ -19,6 +19,7 @@ public class IndexModel : PageModel
[BindProperty(SupportsGet = true)] public ShiftType? ShiftType { get; set; }
[BindProperty(SupportsGet = true)] public bool PaidOnly { get; set; }
[BindProperty(SupportsGet = true)] public bool ShareOnly { get; set; } // فقط شیفت‌های سهم درآمد
[BindProperty(SupportsGet = true)] public Gender? GenderFilter { get; set; }
// "Near me": the browser sends the visitor's coordinates and we sort by distance.
[BindProperty(SupportsGet = true)] public double? Lat { get; set; }
@@ -58,6 +59,9 @@ public class IndexModel : PageModel
if (ShiftType is not null) q = q.Where(s => s.ShiftType == ShiftType);
if (PaidOnly) q = q.Where(s => s.PayAmount != null);
if (ShareOnly) q = q.Where(s => s.SharePercent != null);
// A given gender sees listings open to them (their gender or "فرقی نمی‌کند").
if (GenderFilter is Gender g && g != Gender.Any)
q = q.Where(s => s.GenderRequirement == Gender.Any || s.GenderRequirement == g);
var results = await q.ToListAsync();