@page "/user/{userId:int}"
@using System.Web
@using LBPUnion.ProjectLighthouse.Administration
@using LBPUnion.ProjectLighthouse.Extensions
@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 (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)
{
}
@if (Model.Photos != null && Model.Photos.Count != 0)
{
@Model.Translate(GeneralStrings.RecentPhotos)
@foreach (Photo photo in Model.Photos)
{
string width = isMobile ? "sixteen" : "eight";
@await photo.ToHtml(Html, ViewData, language, timeZone)
}
@if (isMobile)
{
}
}
@await Html.PartialAsync("Partials/CommentsPartial", ViewData.WithLang(language).WithTime(timeZone))
@if (Model.User != null && Model.User.IsModerator)
{
Moderation Options
@if (!Model.ProfileUser.IsBanned)
{
}
@if (Model.ProfileUser.CommentsEnabled)
{
}
@if (Model.User.IsAdmin)
{
@await Html.PartialAsync("Partials/AdminSetGrantedSlotsFormPartial", Model.ProfileUser)
}
@if (isMobile)
{
}
}