huge commit for webfront facelift

This commit is contained in:
RaidMax
2022-04-19 18:43:58 -05:00
parent 4023ca37d4
commit 4fbe0ee0ed
105 changed files with 2981 additions and 2545 deletions

View File

@ -14,5 +14,6 @@ namespace WebfrontCore.ViewModels
public string Value { get; set; }
public Dictionary<string, string> Values { get; set; }
public bool Checked { get; set; }
public bool Required { get; set; }
}
}

View File

@ -11,6 +11,8 @@ namespace WebfrontCore.ViewModels
/// number of items offset from the start of the list
/// </summary>
public int Offset { get; set; }
public int Count { get; set; }
/// <summary>
/// show only a certain type of penalty

View File

@ -3,17 +3,16 @@ using SharedLibraryCore.Database.Models;
namespace WebfrontCore.ViewModels
{
public class ScoreboardInfo
{
public string ServerName { get; set; }
public long ServerId { get; set; }
public string MapName { get; set; }
public string OrderByKey { get; set; }
public bool ShouldOrderDescending { get; set; }
public List<ClientScoreboardInfo> ClientInfo { get; set; }
public string ServerName { get; set; }
public string ServerId { get; set; }
public string MapName { get; set; }
public string OrderByKey { get; set; }
public bool ShouldOrderDescending { get; set; }
public List<ClientScoreboardInfo> ClientInfo { get; set; }
}
public class ClientScoreboardInfo
{
public string ClientName { get; set; }

View File

@ -0,0 +1,21 @@
using System.Collections.Generic;
namespace WebfrontCore.ViewModels;
public class SideContextMenuItem
{
public bool IsLink { get; set; }
public bool IsButton { get; set; }
public bool IsActive { get; set; }
public string Title { get; set; }
public string Reference { get; set; }
public string Icon { get; set; }
public string Tooltip { get; set; }
}
public class SideContextMenuItems
{
public string MenuTitle { get; set; }
public List<SideContextMenuItem> Items { get; set; } = new();
}

View File

@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace WebfrontCore.ViewModels;
public class TableInfo
{
public string Header { get; set; }
public List<ColumnDefinition> Columns { get; } = new();
public List<RowDefinition> Rows { get; } = new();
public int InitialRowCount { get; }
public TableInfo(int initialRowCount = 0)
{
InitialRowCount = initialRowCount;
}
}
public class RowDefinition
{
public List<string> Datum { get; } = new();
}
public class ColumnDefinition
{
public string Title { get; set; }
public string ColumnSpan { get; set; }
}
public static class TableInfoExtensions
{
public static TableInfo WithColumns(this TableInfo info, IEnumerable<string> columns)
{
info.Columns.AddRange(columns.Select(column => new ColumnDefinition
{
Title = column
}));
return info;
}
public static TableInfo WithRows<T>(this TableInfo info, IEnumerable<T> source,
Func<T, IEnumerable<string>> selector)
{
info.Rows.AddRange(source.Select(row =>
{
var rowDef = new RowDefinition();
rowDef.Datum.AddRange(selector(row));
return rowDef;
}));
return info;
}
}