@page "/user/{userId:int}" @using System.Web @using LBPUnion.ProjectLighthouse.Extensions @using LBPUnion.ProjectLighthouse.Localization.StringLists @using LBPUnion.ProjectLighthouse.Servers.Website.Extensions @using LBPUnion.ProjectLighthouse.Types.Entities.Level @using LBPUnion.ProjectLighthouse.Types.Entities.Profile @using LBPUnion.ProjectLighthouse.Types.Moderation.Cases @model LBPUnion.ProjectLighthouse.Servers.Website.Pages.UserPage @{ Layout = "Layouts/BaseLayout"; Model.ShowTitleInPage = false; Model.Title = Model.Translate(ProfileStrings.Title, Model.ProfileUser!.Username); Model.Description = Model.ProfileUser!.Biography; bool isMobile = Request.IsMobile(); string language = Model.GetLanguage(); string timeZone = Model.GetTimeZone(); } @if (Model.ProfileUser.IsBanned) {

This user is currently banned.

@if (Model.User != null && Model.User.IsModerator) { Reason: "@Model.ProfileUser.BannedReason" } else {

This user has been banned for violating the Terms of Service. Remember to follow the rules!

}
}
@await Html.PartialAsync("Partials/UserCardPartial", Model.ProfileUser, new ViewDataDictionary(ViewData) { { "ShowLink", false }, { "IsMobile", Model.Request.IsMobile() }, { "Language", Model.GetLanguage() }, { "TimeZone", Model.GetTimeZone() }, })

@if (Model.ProfileUser != Model.User && Model.User != null) { if (!Model.IsProfileUserBlocked) { Block } else { Unblock } if (!Model.IsProfileUserHearted) { Heart } else { Unheart } } @if (Model.ProfileUser == Model.User) { Privacy Settings } @if (Model.ProfileUser == Model.User || (Model.User?.IsModerator ?? false)) { Profile Settings } @if (Model.ProfileUser == Model.User) { @Model.Translate(BaseLayoutStrings.HeaderLogout) }
@if (isMobile) {
} @if (Model.CanViewProfile) {

@Model.Translate(ProfileStrings.Biography)

@if (string.IsNullOrWhiteSpace(Model.ProfileUser.Biography)) {

@Model.Translate(ProfileStrings.NoBiography, Model.ProfileUser.Username)

} else {

@HttpUtility.HtmlDecode(Model.ProfileUser.Biography)

}
@if (isMobile) {
}

@Model.Translate(GeneralStrings.RecentActivity)

@Model.Translate(GeneralStrings.Soon)

@if (isMobile) {
} }
@if (!Model.CanViewProfile) {

The user's privacy settings prevent you from viewing this page.

} else {
@{ string outerDiv = isMobile ? "horizontal-scroll" : "three wide column"; string innerDiv = isMobile ? "ui top attached tabular menu horizontal-scroll" : "ui vertical fluid tabular menu"; }
@{ string divLength = isMobile ? "sixteen" : "thirteen"; }
@if (Model.ProfileUser.IsBanned) {

Comments are disabled because the user is banned.

} else { @await Html.PartialAsync("Partials/CommentsPartial", new ViewDataDictionary(ViewData.WithLang(language).WithTime(timeZone)) { { "PageOwner", Model.ProfileUser.UserId }, }) }
@if (Model.Photos != null && Model.Photos.Count != 0) {
@foreach (PhotoEntity photo in Model.Photos) { string width = isMobile ? "sixteen" : "eight"; bool canDelete = Model.User != null && (Model.User.IsModerator || Model.User.UserId == photo.CreatorId);
@await photo.ToHtml(Html, ViewData, language, timeZone, canDelete)
}
@if (isMobile) {
} } else {

This user hasn't uploaded any photos

}
@if (!Model.CanViewSlots) {

The user's privacy settings prevent you from viewing this page.

} else {
@if (Model.Slots?.Count == 0) {

This user hasn't published any levels

} @foreach (SlotEntity slot in Model.Slots ?? new List()) {
@await slot.ToHtml(Html, ViewData, Model.User, $"~/user/{Model.ProfileUser.UserId}#levels", language, timeZone, isMobile, true)
}
}

@Model.Translate(GeneralStrings.Soon)

@if (Model.User == Model.ProfileUser) {
@if (Model.HeartedSlots?.Count == 0) {

You haven't hearted any levels

} else {

You have hearted @(Model.HeartedSlots?.Count) levels

} @foreach (SlotEntity slot in Model.HeartedSlots ?? new List()) {
@await slot.ToHtml(Html, ViewData, Model.User, $"~/user/{Model.ProfileUser.UserId}#hearted", language, timeZone, isMobile, true)
}
@if (Model.QueuedSlots?.Count == 0) {

You haven't queued any levels

} else {

There are @(Model.QueuedSlots?.Count) levels in your queue

} @foreach (SlotEntity slot in Model.QueuedSlots ?? new List()) {
@await slot.ToHtml(Html, ViewData, Model.User, $"~/user/{Model.ProfileUser.UserId}#queued", language, timeZone, isMobile, true)
}
}
} @if (Model.User != null && Model.User.IsModerator) {

Moderation Options

@if (!Model.ProfileUser.IsBanned) {
Ban User
}
Wipe Earth Decorations
@if (!Model.CommentsDisabledByModerator) {
Forcibly Disable Comments
} @if (Model.User.IsAdmin) { @await Html.PartialAsync("Partials/AdminSetGrantedSlotsFormPartial", Model.ProfileUser) }
@if (isMobile) {
} }