@page "/user/{userId:int}" @using System.Web @using LBPUnion.ProjectLighthouse.Administration @using LBPUnion.ProjectLighthouse.Extensions @using LBPUnion.ProjectLighthouse.Levels @using LBPUnion.ProjectLighthouse.Localization.StringLists @using LBPUnion.ProjectLighthouse.PlayerData @using LBPUnion.ProjectLighthouse.Servers.Website.Extensions @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) {

User is currently banned!

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

Note: Only you and other moderators may view the ban reason.

} else {

For shame...

}
}
@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.IsProfileUserHearted) { Heart } else { Unheart } } @if (Model.ProfileUser == Model.User || (Model.User?.IsModerator ?? false)) { Settings } @if (Model.ProfileUser == Model.User) { @Model.Translate(BaseLayoutStrings.HeaderLogout) }
@if (isMobile) {
}

@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) {
}
@{ 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"; }
@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 (Photo 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.Slots?.Count == 0) {

This user hasn't published any levels

} @foreach (Slot 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 (Slot 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 (Slot 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
} @if (Model.ProfileUser.CommentsEnabled) {
Disable Comments
}
Wipe user's earth decorations
@if (Model.User.IsAdmin) { @await Html.PartialAsync("Partials/AdminSetGrantedSlotsFormPartial", Model.ProfileUser) }
@if (isMobile) {
} }