mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-21 09:49:34 +00:00
Refresh the website's UI
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
This commit is contained in:
parent
f06fcc4847
commit
3e8344c8f3
54 changed files with 9695 additions and 176 deletions
|
@ -0,0 +1,35 @@
|
|||
using LBPUnion.ProjectLighthouse.Levels;
|
||||
using LBPUnion.ProjectLighthouse.PlayerData;
|
||||
using LBPUnion.ProjectLighthouse.PlayerData.Profiles;
|
||||
using Microsoft.AspNetCore.Html;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse.Servers.Website.Extensions;
|
||||
|
||||
public static class PartialExtensions
|
||||
{
|
||||
// ReSharper disable once SuggestBaseTypeForParameter
|
||||
public static ViewDataDictionary<T> WithLang<T>(this ViewDataDictionary<T> viewData, string language)
|
||||
{
|
||||
try
|
||||
{
|
||||
return new(viewData)
|
||||
{
|
||||
{
|
||||
"Language", language
|
||||
},
|
||||
};
|
||||
}
|
||||
catch
|
||||
{
|
||||
return viewData;
|
||||
}
|
||||
}
|
||||
|
||||
public static Task<IHtmlContent> ToLink<T>(this User user, IHtmlHelper<T> helper, ViewDataDictionary<T> viewData, string language)
|
||||
=> helper.PartialAsync("Partials/Links/UserLinkPartial", user, viewData.WithLang(language));
|
||||
|
||||
public static Task<IHtmlContent> ToHtml<T>(this Photo photo, IHtmlHelper<T> helper, ViewDataDictionary<T> viewData, string language)
|
||||
=> helper.PartialAsync("Partials/PhotoPartial", photo, viewData.WithLang(language));
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
using LBPUnion.ProjectLighthouse.Middlewares;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse.Servers.Website.Middlewares;
|
||||
|
||||
public class HandlePageErrorMiddleware : Middleware
|
||||
{
|
||||
public HandlePageErrorMiddleware(RequestDelegate next) : base(next)
|
||||
{}
|
||||
|
||||
public override async Task InvokeAsync(HttpContext ctx)
|
||||
{
|
||||
await this.next(ctx);
|
||||
// ReSharper disable once ConditionalAccessQualifierIsNonNullableAccordingToAPIContract
|
||||
if (ctx.Response.StatusCode == 404 && !ctx.Request.Path.StartsWithSegments("/gameAssets"))
|
||||
{
|
||||
try
|
||||
{
|
||||
ctx.Request.Path = "/404";
|
||||
}
|
||||
finally
|
||||
{
|
||||
// not much we can do to save us, carry on anyways
|
||||
await next(ctx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
@if (!this.Request.IsMobile())
|
||||
{
|
||||
<div class="ui center aligned grid">
|
||||
<div class="ui grid">
|
||||
@foreach (AdminPanelStatistic statistic in Model.Statistics)
|
||||
{
|
||||
@await Html.PartialAsync("Partials/AdminPanelStatisticPartial", statistic)
|
||||
|
@ -41,7 +41,7 @@ else
|
|||
}
|
||||
}
|
||||
|
||||
<a class="ui blue button" href="/moderation">
|
||||
<a class="ui green button" href="/moderation">
|
||||
<i class="user shield icon"></i>
|
||||
<span>View Mod Panel</span>
|
||||
</a>
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
@page "/404"
|
||||
@model LBPUnion.ProjectLighthouse.Servers.Website.Pages.Errors.NotFoundPage
|
||||
|
||||
@{
|
||||
Layout = "Layouts/BaseLayout";
|
||||
Model.Title = "Not Found";
|
||||
Model.Description = "The page was not found.";
|
||||
}
|
||||
|
||||
<p>@Model.Description</p>
|
||||
<p>This may be due to a lack of permission such as not being signed in, or maybe the page just isn't there.</p>
|
|
@ -0,0 +1,15 @@
|
|||
using LBPUnion.ProjectLighthouse.Servers.Website.Pages.Layouts;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse.Servers.Website.Pages.Errors;
|
||||
|
||||
public class NotFoundPage : BaseLayout
|
||||
{
|
||||
public NotFoundPage(Database database) : base(database)
|
||||
{}
|
||||
|
||||
public void OnGet()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
|
@ -4,14 +4,19 @@
|
|||
@using LBPUnion.ProjectLighthouse.PlayerData.Profiles
|
||||
@using LBPUnion.ProjectLighthouse.Levels
|
||||
@using LBPUnion.ProjectLighthouse.Localization.StringLists
|
||||
@using LBPUnion.ProjectLighthouse.Servers.Website.Extensions
|
||||
@model LBPUnion.ProjectLighthouse.Servers.Website.Pages.LandingPage
|
||||
|
||||
@{
|
||||
Layout = "Layouts/BaseLayout";
|
||||
Model.ShowTitleInPage = false;
|
||||
|
||||
bool isMobile = this.Request.IsMobile();
|
||||
string language = Model.GetLanguage();
|
||||
}
|
||||
<h1>@Model.Translate(LandingPageStrings.Welcome, ServerConfiguration.Instance.Customization.ServerName)</h1>
|
||||
<h1 class="lighthouse-welcome lighthouse-title">
|
||||
@Model.Translate(LandingPageStrings.Welcome, ServerConfiguration.Instance.Customization.ServerName)
|
||||
</h1>
|
||||
|
||||
@if (Model.User != null)
|
||||
{
|
||||
|
@ -24,25 +29,26 @@
|
|||
}
|
||||
}
|
||||
|
||||
@if (Model.PlayersOnlineCount == 1)
|
||||
@if (Model.PlayersOnline.Count == 1)
|
||||
{
|
||||
<p>@Model.Translate(LandingPageStrings.UsersSingle)</p>
|
||||
@foreach (User user in Model.PlayersOnline)
|
||||
{
|
||||
<a href="/user/@user.UserId" title="@user.Status.ToString()">@user.Username</a>
|
||||
}
|
||||
}
|
||||
|
||||
else if (Model.PlayersOnlineCount == 0)
|
||||
else if (Model.PlayersOnline.Count == 0)
|
||||
{
|
||||
<p>@Model.Translate(LandingPageStrings.UsersNone)</p>
|
||||
}
|
||||
else
|
||||
{
|
||||
<p>@Model.Translate(LandingPageStrings.UsersMultiple, Model.PlayersOnlineCount)</p>
|
||||
@foreach (User user in Model.PlayersOnline)
|
||||
<p>@Model.Translate(LandingPageStrings.UsersMultiple, Model.PlayersOnline.Count)</p>
|
||||
}
|
||||
|
||||
@{
|
||||
int i = 0;
|
||||
foreach (User user in Model.PlayersOnline)
|
||||
{
|
||||
<a href="/user/@user.UserId" title="@user.Status.ToString()">@user.Username</a>
|
||||
i++;
|
||||
@await user.ToLink(Html, ViewData, language)if (i != Model.PlayersOnline.Count){<span>,</span>} @* whitespace has forced my hand *@
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,8 +56,8 @@ else
|
|||
|
||||
<div class="@(isMobile ? "" : "ui center aligned grid")">
|
||||
<div class="eight wide column">
|
||||
<div class="ui pink segment">
|
||||
<h1><i class="ribbon icon"></i>@Model.Translate(LandingPageStrings.LatestTeamPicks)</h1>
|
||||
<div class="ui inverted pink segment">
|
||||
<h1><i class="star icon"></i>@Model.Translate(LandingPageStrings.LatestTeamPicks)</h1>
|
||||
<div class="ui divider"></div>
|
||||
<div class="ui left aligned segment">
|
||||
@foreach (Slot slot in Model.LatestTeamPicks!) @* Can't reach a point where this is null *@
|
||||
|
@ -67,8 +73,8 @@ else
|
|||
<br>
|
||||
}
|
||||
<div class="eight wide column">
|
||||
<div class="ui blue segment">
|
||||
<h1><i class="certificate icon"></i>@Model.Translate(LandingPageStrings.NewestLevels)</h1>
|
||||
<div class="ui inverted blue segment">
|
||||
<h1><i class="globe americas icon"></i>@Model.Translate(LandingPageStrings.NewestLevels)</h1>
|
||||
<div class="ui divider"></div>
|
||||
<div class="ui left aligned segment">
|
||||
@foreach (Slot slot in Model.NewestLevels!) @* Can't reach a point where this is null *@
|
||||
|
|
|
@ -18,8 +18,6 @@ public class LandingPage : BaseLayout
|
|||
public int PendingAuthAttempts;
|
||||
public List<User> PlayersOnline = new();
|
||||
|
||||
public int PlayersOnlineCount;
|
||||
|
||||
public List<Slot>? LatestTeamPicks;
|
||||
public List<Slot>? NewestLevels;
|
||||
|
||||
|
@ -29,8 +27,6 @@ public class LandingPage : BaseLayout
|
|||
User? user = this.Database.UserFromWebRequest(this.Request);
|
||||
if (user != null && user.PasswordResetRequired) return this.Redirect("~/passwordResetRequired");
|
||||
|
||||
this.PlayersOnlineCount = await StatisticsHelper.RecentMatches();
|
||||
|
||||
if (user != null)
|
||||
this.PendingAuthAttempts = await this.Database.AuthenticationAttempts.Include
|
||||
(a => a.GameToken)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
@model LBPUnion.ProjectLighthouse.Servers.Website.Pages.Layouts.BaseLayout
|
||||
|
||||
@{
|
||||
if (Model!.User == null)
|
||||
if (Model.User == null)
|
||||
{
|
||||
Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderLoginRegister, "/login", "sign in"));
|
||||
}
|
||||
|
@ -16,30 +16,22 @@
|
|||
{
|
||||
Model.NavigationItems.Add(new PageNavigationItem(BaseLayoutStrings.HeaderAuthentication, "/authentication", "key"));
|
||||
}
|
||||
Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderProfile, "/user/" + Model.User.UserId, "user alternate"));
|
||||
|
||||
@if (Model.User.IsAdmin)
|
||||
{
|
||||
Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderAdminPanel, "/admin", "cogs"));
|
||||
Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderAdminPanel, "/admin", "wrench", "yellow"));
|
||||
}
|
||||
else if (Model.User.IsModerator)
|
||||
{
|
||||
Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderModPanel, "/moderation", "user shield"));
|
||||
Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderModPanel, "/moderation", "user shield", "green"));
|
||||
}
|
||||
Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderLogout, "/logout", "user alternate slash")); // should always be last
|
||||
}
|
||||
|
||||
Model.IsMobile = Model.Request.IsMobile();
|
||||
|
||||
string title;
|
||||
if (Model.Title == string.Empty)
|
||||
{
|
||||
title = ServerConfiguration.Instance.Customization.ServerName;
|
||||
}
|
||||
else
|
||||
{
|
||||
title = $"{Model.Title} - {ServerConfiguration.Instance.Customization.ServerName}";
|
||||
}
|
||||
string title = Model.Title == string.Empty
|
||||
? ServerConfiguration.Instance.Customization.ServerName
|
||||
: $"{Model.Title} - {ServerConfiguration.Instance.Customization.ServerName}";
|
||||
}
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
@ -48,7 +40,7 @@
|
|||
<head>
|
||||
<title>@title</title>
|
||||
<link rel="stylesheet" type="text/css" href="~/css/styles.css">
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/fomantic-ui@2.8.8/dist/semantic.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="~/css/semantic.min.css">
|
||||
|
||||
@* Favicon *@
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
|
||||
|
@ -85,37 +77,56 @@
|
|||
<body>
|
||||
<div class="pageContainer">
|
||||
<header class="lighthouse-header">
|
||||
<div class="ui attached menu">
|
||||
<div class="ui inverted attached menu">
|
||||
<div class="ui container">
|
||||
@{
|
||||
string mobileIconStyle = Model.IsMobile ? "margin-right: 0;" : "";
|
||||
}
|
||||
@foreach (PageNavigationItem navigationItem in Model!.NavigationItems)
|
||||
|
||||
<a class="item home-logo" href="/">
|
||||
<img src="~/logo-mono.png" alt="Home" class="logo-mono"/>
|
||||
<img src="~/logo-color.png" alt="Home" class="logo-color"/>
|
||||
</a>
|
||||
@foreach (PageNavigationItem navigationItem in Model.NavigationItems)
|
||||
{
|
||||
<a class="item" href="@navigationItem.Url">
|
||||
@if (navigationItem.Icon != null)
|
||||
{
|
||||
<i class="@navigationItem.Icon icon" style="@mobileIconStyle"></i>
|
||||
<i class="@navigationItem.CustomColor @navigationItem.Icon icon" style="@mobileIconStyle"></i>
|
||||
}
|
||||
|
||||
@if (!Model.IsMobile)
|
||||
{
|
||||
@Model.Translate(navigationItem.Name)
|
||||
<span class="ui inline @navigationItem.CustomColor text">@Model.Translate(navigationItem.Name)</span>
|
||||
}
|
||||
</a>
|
||||
}
|
||||
<div class="right menu">
|
||||
@foreach (PageNavigationItem navigationItem in Model!.NavigationItemsRight)
|
||||
@foreach (PageNavigationItem navigationItem in Model.NavigationItemsRight)
|
||||
{
|
||||
<a class="item" href="@navigationItem.Url">
|
||||
@if (navigationItem.Icon != null)
|
||||
{
|
||||
<i class="@navigationItem.Icon icon" style="@mobileIconStyle"></i>
|
||||
<i class="@navigationItem.CustomColor @navigationItem.Icon icon" style="@mobileIconStyle"></i>
|
||||
}
|
||||
|
||||
@if (!Model.IsMobile)
|
||||
{
|
||||
@Model.Translate(navigationItem.Name)
|
||||
<span class="ui inline @navigationItem.CustomColor text">@Model.Translate(navigationItem.Name)</span>
|
||||
}
|
||||
</a>
|
||||
}
|
||||
|
||||
@if (Model.User != null)
|
||||
{
|
||||
<a class="item" href="/user/@Model.User.UserId">
|
||||
<img src="/gameAssets/@Model.User.WebsiteAvatarHash"
|
||||
onerror="this.onerror='';this.src='/gameAssets/@ServerConfiguration.Instance.WebsiteConfiguration.MissingIconHash'"
|
||||
alt=""
|
||||
class="lighthouse-avatar"/>
|
||||
@if (!Model.IsMobile)
|
||||
{
|
||||
<b class="lighthouse-name">@Model.User.Username</b>
|
||||
}
|
||||
</a>
|
||||
}
|
||||
|
@ -123,7 +134,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<noscript>
|
||||
<div class="ui bottom attached yellow message small">
|
||||
<div class="ui bottom attached red message">
|
||||
<div class="ui container">
|
||||
<div style="display: flex; align-items: center; font-size: 1.2rem;">
|
||||
<i class="warning icon"></i>
|
||||
|
@ -160,13 +171,19 @@
|
|||
</header>
|
||||
<div class="main">
|
||||
<div class="ui container">
|
||||
<br>
|
||||
@if (Model.ShowTitleInPage)
|
||||
{
|
||||
<h1>@Model.Title</h1>
|
||||
@{
|
||||
// on mobile, only show page contents
|
||||
string segment = Model.IsMobile ? "" : "ui attached segment";
|
||||
}
|
||||
@RenderBody()
|
||||
<div style="height: 50px;"></div> @* makes it look nicer *@
|
||||
<div class="@segment">
|
||||
<div style="height: 17px"></div>
|
||||
@if (Model.ShowTitleInPage)
|
||||
{
|
||||
<h1 class="lighthouse-title">@Model.Title</h1>
|
||||
}
|
||||
@RenderBody()
|
||||
<div style="height: 17px"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer>
|
||||
|
|
|
@ -30,11 +30,10 @@ public class BaseLayout : PageModel
|
|||
public BaseLayout(Database database)
|
||||
{
|
||||
this.Database = database;
|
||||
|
||||
this.NavigationItems.Add(new PageNavigationItem(BaseLayoutStrings.HeaderHome, "/", "home"));
|
||||
|
||||
this.NavigationItems.Add(new PageNavigationItem(BaseLayoutStrings.HeaderUsers, "/users/0", "user friends"));
|
||||
this.NavigationItems.Add(new PageNavigationItem(BaseLayoutStrings.HeaderPhotos, "/photos/0", "camera"));
|
||||
this.NavigationItems.Add(new PageNavigationItem(BaseLayoutStrings.HeaderSlots, "/slots/0", "certificate"));
|
||||
this.NavigationItems.Add(new PageNavigationItem(BaseLayoutStrings.HeaderSlots, "/slots/0", "globe americas"));
|
||||
}
|
||||
|
||||
public new User? User {
|
||||
|
|
|
@ -48,6 +48,6 @@ else
|
|||
</a><br/><br/>
|
||||
|
||||
<a href="/moderation/hiddenLevels/0" class="ui yellow button">
|
||||
<i class="certificate icon"></i>
|
||||
<i class="globe americas icon"></i>
|
||||
<span>View hidden levels</span>
|
||||
</a>
|
|
@ -1,6 +1,13 @@
|
|||
@using System.Web
|
||||
@using System.IO
|
||||
@using LBPUnion.ProjectLighthouse.Localization
|
||||
@using LBPUnion.ProjectLighthouse.PlayerData.Profiles
|
||||
@using LBPUnion.ProjectLighthouse.Servers.Website.Extensions
|
||||
|
||||
@{
|
||||
string language = (string?)ViewData["Language"] ?? LocalizationManager.DefaultLang;
|
||||
}
|
||||
|
||||
<div class="ui yellow segment" id="comments">
|
||||
<h2>Comments</h2>
|
||||
@if (Model.Comments.Count == 0 && Model.CommentsEnabled)
|
||||
|
@ -66,7 +73,7 @@
|
|||
</div>
|
||||
|
||||
<div class="comment">
|
||||
<b><a href="/user/@comment.PosterUserId">@comment.Poster.Username</a>: </b>
|
||||
<b>@await comment.Poster.ToLink(Html, ViewData, language): </b>
|
||||
@if (comment.Deleted)
|
||||
{
|
||||
<i>
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
@using LBPUnion.ProjectLighthouse.Localization
|
||||
@model LBPUnion.ProjectLighthouse.PlayerData.Profiles.User
|
||||
|
||||
@{
|
||||
string language = (string?)ViewData["Language"] ?? LocalizationManager.DefaultLang;
|
||||
}
|
||||
|
||||
<a href="/user/@Model.UserId" title="@Model.Status.ToTranslatedString(language)" class="user-link">
|
||||
<img src="/gameAssets/@Model.WebsiteAvatarHash" alt=""/>
|
||||
@Model.Username
|
||||
</a>
|
|
@ -1,9 +1,14 @@
|
|||
@using System.Globalization
|
||||
@using System.Web
|
||||
@using LBPUnion.ProjectLighthouse.Levels
|
||||
@using LBPUnion.ProjectLighthouse.Localization
|
||||
@using LBPUnion.ProjectLighthouse.PlayerData
|
||||
@using LBPUnion.ProjectLighthouse.Servers.Website.Extensions
|
||||
@model LBPUnion.ProjectLighthouse.PlayerData.Photo
|
||||
|
||||
@{
|
||||
string language = (string?)ViewData["Language"] ?? LocalizationManager.DefaultLang;
|
||||
}
|
||||
|
||||
<div style="position: relative">
|
||||
<canvas class="hide-subjects" id="canvas-subjects-@Model.PhotoId" width="1920" height="1080"
|
||||
|
@ -16,10 +21,14 @@
|
|||
|
||||
<p>
|
||||
<i>
|
||||
Taken by
|
||||
<b>
|
||||
<a href="/user/@Model.Creator?.UserId">@Model.Creator?.Username</a>
|
||||
</b>
|
||||
Taken
|
||||
@if (Model.Creator != null)
|
||||
{
|
||||
<span>by</span>
|
||||
<b>
|
||||
@await Model.Creator.ToLink(Html, ViewData, language)
|
||||
</b>
|
||||
}
|
||||
@if (Model.Slot != null)
|
||||
{
|
||||
switch (Model.Slot.Type)
|
||||
|
@ -44,13 +53,16 @@
|
|||
</i>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Photo contains @Model.Subjects.Count @(Model.Subjects.Count == 1 ? "person" : "people"):</b>
|
||||
</p>
|
||||
@if (Model.Subjects.Count > 0)
|
||||
{
|
||||
<p>
|
||||
<b>Photo contains @Model.Subjects.Count @(Model.Subjects.Count == 1 ? "person" : "people"):</b>
|
||||
</p>
|
||||
}
|
||||
<div id="hover-subjects-@Model.PhotoId">
|
||||
@foreach (PhotoSubject subject in Model.Subjects)
|
||||
{
|
||||
<a href="/user/@subject.UserId">@subject.User.Username</a>
|
||||
@await subject.User.ToLink(Html, ViewData, language)
|
||||
}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
@using System.Web
|
||||
@using LBPUnion.ProjectLighthouse
|
||||
@using LBPUnion.ProjectLighthouse.Configuration
|
||||
@using LBPUnion.ProjectLighthouse.Localization
|
||||
@using LBPUnion.ProjectLighthouse.PlayerData
|
||||
@using LBPUnion.ProjectLighthouse.PlayerData.Profiles
|
||||
@using LBPUnion.ProjectLighthouse.Servers.Website.Extensions
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@model LBPUnion.ProjectLighthouse.Levels.Slot
|
||||
|
||||
|
@ -15,6 +17,7 @@
|
|||
|
||||
bool isMobile = (bool?)ViewData["IsMobile"] ?? false;
|
||||
bool mini = (bool?)ViewData["IsMini"] ?? false;
|
||||
string language = (string?)ViewData["Language"] ?? LocalizationManager.DefaultLang;
|
||||
|
||||
bool isQueued = false;
|
||||
bool isHearted = false;
|
||||
|
@ -81,13 +84,16 @@
|
|||
|
||||
@if (Model.GameVersion == GameVersion.LittleBigPlanet1)
|
||||
{
|
||||
<i class="yellow star icon" title="LBP1 Stars"></i>
|
||||
<i class="yellow star icon" title="Star Rating"></i>
|
||||
<span>@(Math.Round(Model.RatingLBP1 * 10) / 10)</span>
|
||||
}
|
||||
</div>
|
||||
<p>
|
||||
<i>Created by <a href="/user/@Model.Creator?.UserId">@Model.Creator?.Username</a> for @Model.GameVersion.ToPrettyString()</i>
|
||||
</p>
|
||||
@if (Model.Creator != null)
|
||||
{
|
||||
<p>
|
||||
<i>Created by @await Model.Creator.ToLink(Html, ViewData, language) on @Model.GameVersion.ToPrettyString()</i>
|
||||
</p>
|
||||
}
|
||||
</div>
|
||||
<div class="cardButtons">
|
||||
<br>
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
@Model.Username
|
||||
</h1>
|
||||
}
|
||||
<p>
|
||||
<span>
|
||||
<i>@Model.Status.ToTranslatedString(language)</i>
|
||||
</p>
|
||||
</span>
|
||||
<div class="cardStatsUnderTitle">
|
||||
<i class="pink heart icon" title="Hearts"></i> <span>@Model.Hearts</span>
|
||||
<i class="blue comment icon" title="Comments"></i> <span>@Model.Comments</span>
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
@page "/passwordResetRequired"
|
||||
@using LBPUnion.ProjectLighthouse.Localization.StringLists
|
||||
@using LBPUnion.ProjectLighthouse.Servers.Website.Pages.Layouts
|
||||
@model LBPUnion.ProjectLighthouse.Servers.Website.Pages.PasswordResetRequiredPage
|
||||
|
||||
@{
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
@page "/photos/{pageNumber:int}"
|
||||
@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.PhotosPage
|
||||
|
||||
@{
|
||||
Layout = "Layouts/BaseLayout";
|
||||
Model.Title = Model.Translate(BaseLayoutStrings.HeaderPhotos);
|
||||
|
||||
string language = Model.GetLanguage();
|
||||
}
|
||||
|
||||
<p>There are @Model.PhotoCount total photos!</p>
|
||||
|
@ -22,7 +25,7 @@
|
|||
@foreach (Photo photo in Model.Photos)
|
||||
{
|
||||
<div class="ui segment">
|
||||
@await Html.PartialAsync("Partials/PhotoPartial", photo)
|
||||
@await photo.ToHtml(Html, ViewData, language)
|
||||
</div>
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
@using LBPUnion.ProjectLighthouse.Extensions
|
||||
@using LBPUnion.ProjectLighthouse.PlayerData
|
||||
@using LBPUnion.ProjectLighthouse.PlayerData.Reviews
|
||||
@using LBPUnion.ProjectLighthouse.Servers.Website.Extensions
|
||||
@model LBPUnion.ProjectLighthouse.Servers.Website.Pages.SlotPage
|
||||
|
||||
@{
|
||||
|
@ -15,6 +16,7 @@
|
|||
Model.Description = HttpUtility.HtmlDecode(Model.Slot?.Description ?? "");
|
||||
|
||||
bool isMobile = this.Request.IsMobile();
|
||||
string language = Model.GetLanguage();
|
||||
}
|
||||
|
||||
@if (Model.Slot!.Hidden)
|
||||
|
@ -46,13 +48,17 @@
|
|||
})
|
||||
<br>
|
||||
|
||||
<div class="ui grid">
|
||||
<div class="@(isMobile ? "" : "ui grid")">
|
||||
<div class="eight wide column">
|
||||
<div class="ui blue segment">
|
||||
<h2>Description</h2>
|
||||
<p style="overflow-wrap: anywhere">@HttpUtility.HtmlDecode(string.IsNullOrEmpty(Model.Slot?.Description) ? "This level has no description." : Model.Slot.Description)</p>
|
||||
</div>
|
||||
</div>
|
||||
@if (isMobile)
|
||||
{
|
||||
<br/>
|
||||
}
|
||||
<div class="eight wide column">
|
||||
<div class="ui red segment">
|
||||
<h2>Tags</h2>
|
||||
|
@ -72,9 +78,17 @@
|
|||
}
|
||||
</div>
|
||||
</div>
|
||||
@if (isMobile)
|
||||
{
|
||||
<br/>
|
||||
}
|
||||
<div class="eight wide column">
|
||||
@await Html.PartialAsync("Partials/CommentsPartial")
|
||||
@await Html.PartialAsync("Partials/CommentsPartial", ViewData.WithLang(language))
|
||||
</div>
|
||||
@if (isMobile)
|
||||
{
|
||||
<br/>
|
||||
}
|
||||
<div class="eight wide column">
|
||||
<div class="ui purple segment">
|
||||
<h2>Reviews</h2>
|
||||
|
@ -173,6 +187,10 @@
|
|||
}
|
||||
}
|
||||
</div>
|
||||
@if (isMobile)
|
||||
{
|
||||
<br/>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -185,11 +203,15 @@
|
|||
@foreach (Photo photo in Model.Photos)
|
||||
{
|
||||
<div class="eight wide column">
|
||||
@await Html.PartialAsync("Partials/PhotoPartial", photo)
|
||||
@await photo.ToHtml(Html, ViewData, language)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@if (isMobile)
|
||||
{
|
||||
<br/>
|
||||
}
|
||||
}
|
||||
|
||||
@if (Model.User != null && Model.User.IsModerator)
|
||||
|
@ -201,7 +223,7 @@
|
|||
{
|
||||
<a href="/moderation/slot/@Model.Slot.SlotId/removeTeamPick">
|
||||
<div class="ui pink button">
|
||||
<i class="ribbon icon"></i>
|
||||
<i class="star icon"></i>
|
||||
<span>Remove Team Pick</span>
|
||||
</div>
|
||||
</a>
|
||||
|
@ -210,7 +232,7 @@
|
|||
{
|
||||
<a href="/moderation/slot/@Model.Slot?.SlotId/teamPick">
|
||||
<div class="ui pink button">
|
||||
<i class="ribbon icon"></i>
|
||||
<i class="star icon"></i>
|
||||
<span>Team Pick</span>
|
||||
</div>
|
||||
</a>
|
||||
|
@ -241,4 +263,8 @@
|
|||
</a>
|
||||
}
|
||||
</div>
|
||||
@if (isMobile)
|
||||
{
|
||||
<br/>
|
||||
}
|
||||
}
|
|
@ -7,6 +7,8 @@
|
|||
@{
|
||||
Layout = "Layouts/BaseLayout";
|
||||
Model.Title = Model.Translate(BaseLayoutStrings.HeaderSlots);
|
||||
|
||||
bool isMobile = Model.Request.IsMobile();
|
||||
}
|
||||
|
||||
<p>There are @Model.SlotCount total levels!</p>
|
||||
|
@ -21,7 +23,6 @@
|
|||
|
||||
@foreach (Slot slot in Model.Slots)
|
||||
{
|
||||
bool isMobile = Model.Request.IsMobile();
|
||||
<div class="ui segment">
|
||||
@await Html.PartialAsync("Partials/SlotCardPartial", slot, new ViewDataDictionary(ViewData)
|
||||
{
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
@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
|
||||
|
||||
|
@ -13,6 +14,9 @@
|
|||
|
||||
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)
|
||||
|
@ -34,7 +38,7 @@
|
|||
</div>
|
||||
}
|
||||
|
||||
<div class="ui grid">
|
||||
<div class="@(isMobile ? "" : "ui grid")">
|
||||
<div class="eight wide column">
|
||||
@await Html.PartialAsync("Partials/UserCardPartial", Model.ProfileUser, new ViewDataDictionary(ViewData)
|
||||
{
|
||||
|
@ -74,8 +78,17 @@
|
|||
<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>
|
||||
|
@ -89,12 +102,20 @@
|
|||
}
|
||||
</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>
|
||||
|
||||
|
||||
|
@ -106,15 +127,20 @@
|
|||
<div class="ui center aligned grid">
|
||||
@foreach (Photo photo in Model.Photos)
|
||||
{
|
||||
<div class="eight wide column">
|
||||
@await Html.PartialAsync("Partials/PhotoPartial", photo)
|
||||
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")
|
||||
@await Html.PartialAsync("Partials/CommentsPartial", ViewData.WithLang(language))
|
||||
|
||||
@if (Model.User != null && Model.User.IsModerator)
|
||||
{
|
||||
|
@ -156,4 +182,8 @@
|
|||
@await Html.PartialAsync("Partials/AdminSetGrantedSlotsFormPartial", Model.ProfileUser)
|
||||
}
|
||||
</div>
|
||||
@if (isMobile)
|
||||
{
|
||||
<br/>
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:String x:Key="/Default/CodeInspection/WebPathMapping/MappedPaths/=CSS/@EntryIndexedValue">..\ProjectLighthouse\StaticFiles\css</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/WebPathMapping/PathsInCorrectCasing/=CSS/@EntryIndexedValue">css</s:String></wpf:ResourceDictionary>
|
|
@ -2,6 +2,7 @@ using System.Globalization;
|
|||
using System.Reflection;
|
||||
using LBPUnion.ProjectLighthouse.Localization;
|
||||
using LBPUnion.ProjectLighthouse.Middlewares;
|
||||
using LBPUnion.ProjectLighthouse.Servers.Website.Middlewares;
|
||||
using Microsoft.AspNetCore.HttpOverrides;
|
||||
using Microsoft.AspNetCore.Localization;
|
||||
using Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation;
|
||||
|
@ -77,6 +78,7 @@ public class WebsiteStartup
|
|||
|
||||
app.UseForwardedHeaders();
|
||||
|
||||
app.UseMiddleware<HandlePageErrorMiddleware>();
|
||||
app.UseMiddleware<RequestLogMiddleware>();
|
||||
|
||||
app.UseRouting();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue