From b41a8d93ab6ee368de245bc670acdfb9a0f138fc Mon Sep 17 00:00:00 2001 From: jvyden Date: Fri, 21 Jan 2022 05:37:06 -0500 Subject: [PATCH] Add profile pictures --- .../Pages/Partials/UserCardPartial.cshtml | 47 ++++++++++--------- ProjectLighthouse/Pages/UserPage.cshtml | 24 ++++++---- ProjectLighthouse/Types/User.cs | 13 +++++ 3 files changed, 52 insertions(+), 32 deletions(-) diff --git a/ProjectLighthouse/Pages/Partials/UserCardPartial.cshtml b/ProjectLighthouse/Pages/Partials/UserCardPartial.cshtml index 6832c030..ec1c2b06 100644 --- a/ProjectLighthouse/Pages/Partials/UserCardPartial.cshtml +++ b/ProjectLighthouse/Pages/Partials/UserCardPartial.cshtml @@ -6,28 +6,31 @@ }
-
- @if (showLink) - { -

- @Model.Username -

- } - else - { -

- @Model.Username -

- } -

- @Model.Status -

-
- @Model.Hearts - @Model.Comments - @Model.UsedSlots / @ServerSettings.Instance.EntitledSlots - @Model.PhotosByMe +
+
+
+
+ @if (showLink) + { +

+ @Model.Username +

+ } + else + { +

+ @Model.Username +

+ } +

+ @Model.Status +

+
+ @Model.Hearts + @Model.Comments + @Model.UsedSlots / @ServerSettings.Instance.EntitledSlots + @Model.PhotosByMe +
-
\ No newline at end of file diff --git a/ProjectLighthouse/Pages/UserPage.cshtml b/ProjectLighthouse/Pages/UserPage.cshtml index f70ceeb2..87f6ecc0 100644 --- a/ProjectLighthouse/Pages/UserPage.cshtml +++ b/ProjectLighthouse/Pages/UserPage.cshtml @@ -38,17 +38,21 @@ }
-
-

@Model.Title

-

- @Model.ProfileUser!.Status -

+
+
+
+
+

@Model.Title

+

+ @Model.ProfileUser!.Status +

-
- @Model.ProfileUser.Hearts - @Model.ProfileUser.Comments - @Model.ProfileUser.UsedSlots / @ServerSettings.Instance.EntitledSlots - @Model.ProfileUser.PhotosByMe +
+ @Model.ProfileUser.Hearts + @Model.ProfileUser.Comments + @Model.ProfileUser.UsedSlots / @ServerSettings.Instance.EntitledSlots + @Model.ProfileUser.PhotosByMe +
diff --git a/ProjectLighthouse/Types/User.cs b/ProjectLighthouse/Types/User.cs index 3e2384e4..e47b45a4 100644 --- a/ProjectLighthouse/Types/User.cs +++ b/ProjectLighthouse/Types/User.cs @@ -25,6 +25,19 @@ public class User /// public string Biography { get; set; } + [NotMapped] + public string WebsiteAvatarHash { + get { + string avatarHash = this.IconHash; + + if (string.IsNullOrWhiteSpace(avatarHash)) avatarHash = this.YayHash; + if (string.IsNullOrWhiteSpace(avatarHash)) avatarHash = this.MehHash; + if (string.IsNullOrWhiteSpace(avatarHash)) avatarHash = this.BooHash; + + return avatarHash; + } + } + [NotMapped] public int Reviews { get {