Add profile pictures

This commit is contained in:
jvyden 2022-01-21 05:37:06 -05:00
commit b41a8d93ab
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
3 changed files with 52 additions and 32 deletions

View file

@ -6,7 +6,10 @@
} }
<div class="ui grid"> <div class="ui grid">
<div class="eight wide column"> <div class="eight wide column" style="display: flex;">
<div style="margin-right: 10px; background-image: url('/gameAssets/@Model.WebsiteAvatarHash'); height: 100px; width: 100px; background-size: cover; background-position: center; border-radius: .28571429rem;">
</div>
<div style="height: fit-content; vertical-align: center; align-self: center">
@if (showLink) @if (showLink)
{ {
<h2 style="margin-bottom: 2px;"> <h2 style="margin-bottom: 2px;">
@ -29,5 +32,5 @@
<i class="purple camera icon" title="Uploaded Photos"></i><span>@Model.PhotosByMe</span> <i class="purple camera icon" title="Uploaded Photos"></i><span>@Model.PhotosByMe</span>
</div> </div>
</div> </div>
</div>
</div> </div>

View file

@ -38,7 +38,10 @@
} }
<div class="ui grid"> <div class="ui grid">
<div class="eight wide column"> <div class="eight wide column" style="display: flex">
<div style="margin-right: 10px; background-image: url('/gameAssets/@Model.ProfileUser.WebsiteAvatarHash'); height: 100px; width: 100px; background-size: cover; background-position: center; border-radius: .28571429rem;">
</div>
<div style="height: fit-content; vertical-align: center; align-self: center">
<h1>@Model.Title</h1> <h1>@Model.Title</h1>
<p> <p>
<i>@Model.ProfileUser!.Status</i> <i>@Model.ProfileUser!.Status</i>
@ -51,6 +54,7 @@
<i class="purple camera icon" title="Uploaded Photos"></i><span>@Model.ProfileUser.PhotosByMe</span> <i class="purple camera icon" title="Uploaded Photos"></i><span>@Model.ProfileUser.PhotosByMe</span>
</div> </div>
</div> </div>
</div>
<div class="eight wide right aligned column"> <div class="eight wide right aligned column">
<br> <br>
@if (Model.ProfileUser != Model.User && Model.User != null) @if (Model.ProfileUser != Model.User && Model.User != null)

View file

@ -25,6 +25,19 @@ public class User
/// </summary> /// </summary>
public string Biography { get; set; } 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] [NotMapped]
public int Reviews { public int Reviews {
get { get {