mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-09-03 08:10:43 +00:00
Website UI redesign and QOL changes (#601)
* Initial support for leaderboards and some refactoring * Start of UI redesign * Finish slot and user redesign, added deletion of comments, reviews, scores, and photos * Remove leftover debug print * Fix bug in permission check * Simplify sidebar code and add hearted and queued levels * Fix navbar scrolling on mobile and refactor SlotCardPartial
This commit is contained in:
parent
37b0925cba
commit
f4cad21061
40 changed files with 779 additions and 255 deletions
|
@ -1,3 +1,4 @@
|
|||
using LBPUnion.ProjectLighthouse.Levels;
|
||||
using LBPUnion.ProjectLighthouse.PlayerData;
|
||||
using LBPUnion.ProjectLighthouse.PlayerData.Profiles;
|
||||
using Microsoft.AspNetCore.Html;
|
||||
|
@ -13,7 +14,9 @@ public static class PartialExtensions
|
|||
|
||||
public static ViewDataDictionary<T> WithTime<T>(this ViewDataDictionary<T> viewData, string timeZone) => WithKeyValue(viewData, "TimeZone", timeZone);
|
||||
|
||||
private static ViewDataDictionary<T> WithKeyValue<T>(this ViewDataDictionary<T> viewData, string key, object value)
|
||||
public static ViewDataDictionary<T> CanDelete<T>(this ViewDataDictionary<T> viewData, bool canDelete) => WithKeyValue(viewData, "CanDelete", canDelete);
|
||||
|
||||
private static ViewDataDictionary<T> WithKeyValue<T>(this ViewDataDictionary<T> viewData, string key, object? value)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -33,6 +36,25 @@ public static class PartialExtensions
|
|||
public static Task<IHtmlContent> ToLink<T>(this User user, IHtmlHelper<T> helper, ViewDataDictionary<T> viewData, string language, string timeZone = "", bool includeStatus = false)
|
||||
=> helper.PartialAsync("Partials/Links/UserLinkPartial", user, viewData.WithLang(language).WithTime(timeZone).WithKeyValue("IncludeStatus", includeStatus));
|
||||
|
||||
public static Task<IHtmlContent> ToHtml<T>(this Photo photo, IHtmlHelper<T> helper, ViewDataDictionary<T> viewData, string language, string timeZone)
|
||||
=> helper.PartialAsync("Partials/PhotoPartial", photo, viewData.WithLang(language).WithTime(timeZone));
|
||||
public static Task<IHtmlContent> ToHtml<T>
|
||||
(
|
||||
this Slot slot,
|
||||
IHtmlHelper<T> helper,
|
||||
ViewDataDictionary<T> viewData,
|
||||
User? user,
|
||||
string callbackUrl,
|
||||
string language = "",
|
||||
string timeZone = "",
|
||||
bool isMobile = false,
|
||||
bool showLink = false,
|
||||
bool isMini = false
|
||||
) =>
|
||||
helper.PartialAsync("Partials/SlotCardPartial", slot, viewData.WithLang(language).WithTime(timeZone)
|
||||
.WithKeyValue("User", user)
|
||||
.WithKeyValue("CallbackUrl", callbackUrl)
|
||||
.WithKeyValue("ShowLink", showLink)
|
||||
.WithKeyValue("IsMobile", isMobile));
|
||||
|
||||
public static Task<IHtmlContent> ToHtml<T>(this Photo photo, IHtmlHelper<T> helper, ViewDataDictionary<T> viewData, string language, string timeZone, bool canDelete = false)
|
||||
=> helper.PartialAsync("Partials/PhotoPartial", photo, viewData.WithLang(language).WithTime(timeZone).CanDelete(canDelete));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue