mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-30 12:42:27 +00:00
Squashed commit of the following: commit 47d268cc29560e72b5102eabc80d1f5743c103bb Author: jvyden <jvyden@jvyden.xyz> Date: Fri Aug 19 21:14:09 2022 -0400 Make profile pictures square commit a5ae8a53918708fea215a5676beea2116078bd34 Merge: f5d8a9ef06fcc4
Author: jvyden <jvyden@jvyden.xyz> Date: Fri Aug 19 18:43:26 2022 -0400 Merge branch 'main' into ui-refresh commit f5d8a9e5ed2d9aaafd63d113a5b064d042f7ba48 Merge: fbf16952ad9804
Author: jvyden <jvyden@jvyden.xyz> Date: Fri Aug 19 17:03:33 2022 -0400 Merge branch 'main' into ui-refresh commit fbf16953893b2e294df21a0c60e561dbb409aa92 Author: jvyden <jvyden@jvyden.xyz> Date: Fri Aug 19 17:02:32 2022 -0400 Fix test failures commit 70cb5513cb8bae9d85b2b04bc9a3fb194f0a66a5 Author: jvyden <jvyden@jvyden.xyz> Date: Fri Aug 19 16:56:43 2022 -0400 Improve 404 logic commit b2743c4c8af736d2501c7bdd47cce19a6a01902d Author: jvyden <jvyden@jvyden.xyz> Date: Fri Aug 19 16:44:36 2022 -0400 Add 404 page commit 3d0926d3c99d347617e5147ac632d8ec6bab18f9 Author: jvyden <jvyden@jvyden.xyz> Date: Fri Aug 19 16:27:03 2022 -0400 Update icons for slots and team picks commit c61405d83d71d9e67ab4c2775f76b3f7d6c2e827 Author: jvyden <jvyden@jvyden.xyz> Date: Fri Aug 19 16:12:45 2022 -0400 Add background color, put content on segment commit f7d9ee6a0accc9d664f8d2aefabcce4eb8789cd6 Author: jvyden <jvyden@jvyden.xyz> Date: Fri Aug 19 15:53:58 2022 -0400 Add colors to mod/admin panel buttons, update fomantic commit e680c5e6eb14f22792dc62bda029072d3f11f423 Author: jvyden <jvyden@jvyden.xyz> Date: Fri Aug 19 03:20:16 2022 -0400 Fix landing page title commit c779aa4b417af623aa47db0ce9875f49a9ee5c4b Author: jvyden <jvyden@jvyden.xyz> Date: Fri Aug 19 03:13:32 2022 -0400 Remove useless css commit 57f6387c1214b319fe3e0b14df32a7bbecf51548 Author: jvyden <jvyden@jvyden.xyz> Date: Fri Aug 19 03:11:45 2022 -0400 Add hover effect to logo commit 15746911f92037abec115a83fa625ef0fda39e3a Author: jvyden <jvyden@jvyden.xyz> Date: Fri Aug 19 02:39:04 2022 -0400 Change currently_online string to english better commit b98a90f1e9f0b3af7e65104cdd0acbc74c6a244e Author: jvyden <jvyden@jvyden.xyz> Date: Fri Aug 19 02:33:41 2022 -0400 Run GameApiTests sequentially, fix web tests commit 630c08d3b80b74be11b0648b24011f89de705130 Author: jvyden <jvyden@jvyden.xyz> Date: Fri Aug 19 02:20:01 2022 -0400 Add user links to comments commit a91f136c87bc973300c74d6f97696cd7cbf1046a Author: jvyden <jvyden@jvyden.xyz> Date: Fri Aug 19 02:14:22 2022 -0400 Add ability for photos to have user links commit d9e2a58e37dafe842b0b10b463cde1a2cb962052 Author: jvyden <jvyden@jvyden.xyz> Date: Fri Aug 19 01:33:21 2022 -0400 Add ability to link to users and include their profile picture commit 200196ce1f58638da7da368025ec0a88cacc14b6 Author: jvyden <jvyden@jvyden.xyz> Date: Fri Aug 19 01:33:07 2022 -0400 Rename "users" to "people" in Landing Page commit 07d229821099c069979a21bbd529b549c6f4e6b6 Author: jvyden <jvyden@jvyden.xyz> Date: Fri Aug 19 00:59:17 2022 -0400 Fix bug with name on mobile commit aecad7aeb69b63c0e517e85fba0c4de292d202f4 Author: jvyden <jvyden@jvyden.xyz> Date: Fri Aug 19 00:44:56 2022 -0400 Make gap between header and title 17px commit 46fa79b84e46b7ae90232724d82f7bd9e1a74f17 Author: jvyden <jvyden@jvyden.xyz> Date: Fri Aug 19 00:40:00 2022 -0400 Fix user card stats oddity commit 3b4c19f5b7e0199baeb88e27c918fbb17b5f777a Author: jvyden <jvyden@jvyden.xyz> Date: Fri Aug 19 00:24:38 2022 -0400 Mobile improvements, make avatars rounded commit cf9533410042cabf456be0cba34ac5d80ef86046 Author: jvyden <jvyden@jvyden.xyz> Date: Fri Aug 19 00:02:01 2022 -0400 Redesign header commit f24aec0367d8375f3eaea94ea3579d86256c94be Author: jvyden <jvyden@jvyden.xyz> Date: Thu Aug 18 23:36:42 2022 -0400 Fix runtime compilation not working commit 3147e12865feecf792a46088711691160c76b0c6 Author: jvyden <jvyden@jvyden.xyz> Date: Thu Aug 18 22:43:21 2022 -0400 Add support for custom fomantic theme
189 lines
No EOL
5.6 KiB
Text
189 lines
No EOL
5.6 KiB
Text
@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
|
|
@using LBPUnion.ProjectLighthouse.Types
|
|
@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 = this.Request.IsMobile();
|
|
string language = Model.GetLanguage();
|
|
}
|
|
|
|
@if (Model.ProfileUser.IsBanned)
|
|
{
|
|
<div class="ui inverted red segment">
|
|
<h2>User is currently banned!</h2>
|
|
@if (Model.User != null && Model.User.IsModerator)
|
|
{
|
|
<b>Reason:</b>
|
|
<span>"@Model.ProfileUser.BannedReason"</span>
|
|
<p>
|
|
<i>Note: Only you and other moderators may view the ban reason.</i>
|
|
</p>
|
|
}
|
|
else
|
|
{
|
|
<p>For shame...</p>
|
|
}
|
|
</div>
|
|
}
|
|
|
|
<div class="@(isMobile ? "" : "ui grid")">
|
|
<div class="eight wide column">
|
|
@await Html.PartialAsync("Partials/UserCardPartial", Model.ProfileUser, new ViewDataDictionary(ViewData)
|
|
{
|
|
{
|
|
"ShowLink", false
|
|
},
|
|
{
|
|
"IsMobile", Model.Request.IsMobile()
|
|
},
|
|
{
|
|
"Language", Model.GetLanguage()
|
|
}
|
|
})
|
|
</div>
|
|
<div class="eight wide right aligned column">
|
|
<br>
|
|
@if (Model.ProfileUser != Model.User && Model.User != null)
|
|
{
|
|
if (!Model.IsProfileUserHearted)
|
|
{
|
|
<a class="ui pink button" href="/user/@Model.ProfileUser.UserId/heart">
|
|
<i class="heart icon"></i>
|
|
<span>Heart</span>
|
|
</a>
|
|
}
|
|
else
|
|
{
|
|
<a class="ui pink button" href="/user/@Model.ProfileUser.UserId/unheart">
|
|
<i class="heart broken icon"></i>
|
|
<span>Unheart</span>
|
|
</a>
|
|
}
|
|
}
|
|
@if (Model.ProfileUser == Model.User)
|
|
{
|
|
<a class="ui blue button" href="/passwordReset">
|
|
<i class="key icon"></i>
|
|
<span>@Model.Translate(GeneralStrings.ResetPassword)</span>
|
|
</a>
|
|
|
|
<a href="/logout" class="ui red button">
|
|
<i class="user slash icon"></i>
|
|
@Model.Translate(BaseLayoutStrings.HeaderLogout)
|
|
</a>
|
|
}
|
|
</div>
|
|
@if (isMobile)
|
|
{
|
|
<br/>
|
|
}
|
|
<div class="eight wide column">
|
|
<div class="ui blue segment">
|
|
<h2>@Model.Translate(ProfileStrings.Biography)</h2>
|
|
@if (string.IsNullOrWhiteSpace(Model.ProfileUser.Biography))
|
|
{
|
|
<p>@Model.Translate(ProfileStrings.NoBiography, Model.ProfileUser.Username)</p>
|
|
}
|
|
else
|
|
{
|
|
<p>@HttpUtility.HtmlDecode(Model.ProfileUser.Biography)</p>
|
|
}
|
|
</div>
|
|
</div>
|
|
@if (isMobile)
|
|
{
|
|
<br/>
|
|
}
|
|
<div class="eight wide column">
|
|
<div class="ui red segment">
|
|
<h2>@Model.Translate(GeneralStrings.RecentActivity)</h2>
|
|
<p>@Model.Translate(GeneralStrings.Soon)</p>
|
|
</div>
|
|
</div>
|
|
@if (isMobile)
|
|
{
|
|
<br/>
|
|
}
|
|
</div>
|
|
|
|
|
|
@if (Model.Photos != null && Model.Photos.Count != 0)
|
|
{
|
|
<div class="ui purple segment">
|
|
<h2>@Model.Translate(GeneralStrings.RecentPhotos)</h2>
|
|
|
|
<div class="ui center aligned grid">
|
|
@foreach (Photo photo in Model.Photos)
|
|
{
|
|
string width = isMobile ? "sixteen" : "eight";
|
|
<div class="@width wide column">
|
|
@await photo.ToHtml(Html, ViewData, language)
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
@if (isMobile)
|
|
{
|
|
<br/>
|
|
}
|
|
}
|
|
|
|
@await Html.PartialAsync("Partials/CommentsPartial", ViewData.WithLang(language))
|
|
|
|
@if (Model.User != null && Model.User.IsModerator)
|
|
{
|
|
<div class="ui green segment">
|
|
<h2>Moderation Options</h2>
|
|
|
|
@if (!Model.ProfileUser.IsBanned)
|
|
{
|
|
<div>
|
|
<a class="ui red button" href="/moderation/newCase?type=@((int)CaseType.UserBan)&affectedId=@Model.ProfileUser.UserId">
|
|
<i class="ban icon"></i>
|
|
<span>Ban User</span>
|
|
</a>
|
|
</div>
|
|
<div class="ui fitted hidden divider"></div>
|
|
}
|
|
|
|
@if (Model.ProfileUser.CommentsEnabled)
|
|
{
|
|
<div>
|
|
<a class="ui yellow button" href="/moderation/newCase?type=@((int)CaseType.UserDisableComments)&affectedId=@Model.ProfileUser.UserId">
|
|
<i class="lock icon"></i>
|
|
<span>Disable Comments</span>
|
|
</a>
|
|
</div>
|
|
<div class="ui fitted hidden divider"></div>
|
|
}
|
|
|
|
<div>
|
|
<a class="ui red button" href="/moderation/user/@Model.ProfileUser.UserId/wipePlanets">
|
|
<i class="trash alternate icon"></i>
|
|
<span>Wipe user's earth decorations</span>
|
|
</a>
|
|
</div>
|
|
<div class="ui fitted hidden divider"></div>
|
|
|
|
@if (Model.User.IsAdmin)
|
|
{
|
|
@await Html.PartialAsync("Partials/AdminSetGrantedSlotsFormPartial", Model.ProfileUser)
|
|
}
|
|
</div>
|
|
@if (isMobile)
|
|
{
|
|
<br/>
|
|
}
|
|
} |