Move recommendations to a dedicated page + consolidate preferences there
CI/CD / CI · dotnet build (push) Successful in 49s
CI/CD / Deploy · hamkadr (push) Successful in 1m17s

The personalized «پیشنهادهای ویژه شما» feed lived on the homepage and its settings on a separate
/Preferences page. New /Recommendations page combines both — the recommendation cards plus the
preference controls (role/city/shift-type/pay/gender) that drive them, so the settings sit next to
their result. Saving prefs reloads the feed in place.

- Homepage: recommendation section replaced with a CTA card linking to /Recommendations; the model
  no longer loads recommendations.
- Nav: « پیشنهادها» entry added.
- /Preferences now redirects to /Recommendations (old links/bookmarks keep working).
- Page is NoIndex (personalized to the visitor).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-23 11:41:17 +03:30
parent 1f628d971e
commit fdeefb7625
6 changed files with 176 additions and 66 deletions
@@ -0,0 +1,94 @@
@page "/Recommendations"
@model JobsMedical.Web.Pages.Recommendations.IndexModel
@{
ViewData["Title"] = "پیشنهادهای ویژه شما";
ViewData["Description"] = "پیشنهادهای شخصی‌سازی‌شدهٔ شیفت و استخدام برای شما در همکادر — بر اساس نقش، شهر و فعالیت شما.";
ViewData["NoIndex"] = true; // personalized to the visitor — not an indexable page
}
<div class="page-head">
<div class="container">
<h1>✨ پیشنهادهای ویژه شما</h1>
<p class="muted">
@(Model.HasPersonalization
? "بر اساس علاقه‌مندی‌ها و فعالیت شما انتخاب شده‌اند. علاقه‌مندی‌ها را پایین‌تر تنظیم کن."
: "نقش، شهر و نوع شیفت دلخواهت را تنظیم کن تا بهترین فرصت‌ها را برایت پیدا کنیم.")
</p>
</div>
</div>
<div class="container section">
@if (Model.Saved)
{
<div class="alert alert-success">✓ علاقه‌مندی‌ها ذخیره شد — پیشنهادها به‌روزرسانی شدند.</div>
}
@* Preferences — the settings that drive the feed, collapsed by default once personalized. *@
<details class="card card-pad" style="margin-bottom:18px;" @(Model.HasPersonalization ? "" : "open")>
<summary style="font-weight:800; cursor:pointer; font-size:16px;">⚙️ تنظیم علاقه‌مندی‌ها</summary>
<form method="post" style="margin-top:14px;">
<div class="grid grid-3">
<div class="filter-group">
<label>نقش / رشته</label>
<select name="RoleId">
<option value="">مهم نیست</option>
@foreach (var r in Model.Roles)
{
<option value="@r.Id" selected="@(Model.RoleId == r.Id)">@r.Name</option>
}
</select>
</div>
<div class="filter-group">
<label>شهر</label>
<select name="CityId">
<option value="">مهم نیست</option>
@foreach (var c in Model.Cities)
{
<option value="@c.Id" selected="@(Model.CityId == c.Id)">@c.Name</option>
}
</select>
</div>
<div class="filter-group">
<label>نوع شیفت ترجیحی</label>
<select name="PreferredShiftType">
<option value="">مهم نیست</option>
<option value="0" selected="@(Model.PreferredShiftType == ShiftType.Day)">صبح</option>
<option value="1" selected="@(Model.PreferredShiftType == ShiftType.Evening)">عصر</option>
<option value="2" selected="@(Model.PreferredShiftType == ShiftType.Night)">شب</option>
<option value="3" selected="@(Model.PreferredShiftType == ShiftType.OnCall)">آنکال</option>
</select>
</div>
<div class="filter-group">
<label>جنسیت شما</label>
<select name="Gender">
<option value="0" selected="@(Model.Gender == JobsMedical.Web.Models.Gender.Any)">نمی‌خواهم بگویم</option>
<option value="1" selected="@(Model.Gender == JobsMedical.Web.Models.Gender.Male)">آقا</option>
<option value="2" selected="@(Model.Gender == JobsMedical.Web.Models.Gender.Female)">خانم</option>
</select>
</div>
<div class="filter-group">
<label>حداقل حقوق مورد انتظار (تومان)</label>
<input type="number" name="MinPay" value="@Model.MinPay" placeholder="مثلاً ۲۰۰۰۰۰۰۰" dir="ltr" />
</div>
</div>
<button type="submit" class="btn btn-primary btn-block btn-lg" style="margin-top:6px;">ذخیره و دیدن پیشنهادها</button>
</form>
</details>
@if (Model.Recommendations.Count > 0)
{
<div class="grid grid-3">
@foreach (var rec in Model.Recommendations)
{
<partial name="_RecommendationCard" model="rec" />
}
</div>
}
else
{
<div class="card empty-state">
هنوز پیشنهادی برای شما نیست. علاقه‌مندی‌هایت را تنظیم کن یا چند فرصت را در
<a asp-page="/Jobs/Index">استخدام</a> و <a asp-page="/Shifts/Index">شیفت‌ها</a> ببین تا پیشنهادها شخصی شوند.
</div>
}
</div>