Add per-user Like (پسندیدن) with a liked page and counts
Logged-in users can like a listing (job/shift/talent); dislike is removed per request — only likes.
- Like model (polymorphic by TargetType+TargetId) + EF migration; unique per (user, listing).
- POST /like toggles the like (auth required) and returns {liked, count}.
- Detail pages: the old ♡ Save / ✕ Dismiss buttons are replaced by a single heart Like button that
shows the live count and toggles in place; clicking while logged out redirects to login.
- New «❤️ پسندیدهها» page (/Me/Liked) lists everything the user liked (open listings only), with a
nav entry shown only when authenticated.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -60,6 +60,11 @@
|
||||
<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>
|
||||
<button type="button" class="btn @(Model.IsLiked ? "btn-accent" : "btn-outline") btn-block like-trigger" style="margin-top:10px;"
|
||||
data-like-type="talent" data-like-id="@t.Id" data-liked="@(Model.IsLiked ? "true" : "false")">
|
||||
<span class="like-ico">@(Model.IsLiked ? "♥" : "♡")</span> پسندیدم
|
||||
<span class="like-count">@JalaliDate.ToPersianDigits(Model.LikeCount.ToString())</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@if (t.Lat is not null && t.Lng is not null)
|
||||
|
||||
Reference in New Issue
Block a user