Add gender requirement (آقا/خانم/فرقی نمیکند) + employee (کارجو) panel
- 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:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user