+
+
@Model.ProfileUser!.Username's user page
-
-
@Model.ProfileUser.Hearts
-
@Model.ProfileUser.Comments
-
@Model.ProfileUser.UsedSlots / @ServerStatics.EntitledSlots
-
@Model.ProfileUser.PhotosByMe
+
+ @Model.ProfileUser.Hearts
+ @Model.ProfileUser.Comments
+ @Model.ProfileUser.UsedSlots / @ServerStatics.EntitledSlots
+ @Model.ProfileUser.PhotosByMe
+
+
+
+
+ @if (Model.ProfileUser != Model.User && Model.User != null)
+ {
+ if (!Model.IsProfileUserHearted)
+ {
+
+
+ Heart
+
+ }
+ else
+ {
+
+
+ Unheart
+
+ }
+ }
+
+
+
+
Biography
+
@Model.ProfileUser.Biography
+
+
+
+
+
Recent Activity
+
Coming soon!
+
+
-
-
Biography
-
@Model.ProfileUser.Biography
-
@if (Model.Photos != null && Model.Photos.Count != 0)
{
diff --git a/ProjectLighthouse/Pages/UserPage.cshtml.cs b/ProjectLighthouse/Pages/UserPage.cshtml.cs
index 649a965d..2d300ada 100644
--- a/ProjectLighthouse/Pages/UserPage.cshtml.cs
+++ b/ProjectLighthouse/Pages/UserPage.cshtml.cs
@@ -16,6 +16,7 @@ namespace LBPUnion.ProjectLighthouse.Pages
public User? ProfileUser;
public List
? Photos;
+ public bool IsProfileUserHearted;
public async Task OnGet([FromRoute] int userId)
{
@@ -24,6 +25,14 @@ namespace LBPUnion.ProjectLighthouse.Pages
this.Photos = await this.Database.Photos.OrderByDescending(p => p.Timestamp).Where(p => p.CreatorId == userId).Take(5).ToListAsync();
+ if (this.User != null)
+ {
+
+ this.IsProfileUserHearted = (await this.Database.HeartedProfiles.FirstOrDefaultAsync
+ (u => u.UserId == this.User.UserId && u.HeartedUserId == this.ProfileUser.UserId)) !=
+ null;
+ }
+
return this.Page();
}
}