continue rework of profile
start moving profile info out of javascript into componentview rework meta data to include count and offset
This commit is contained in:
@ -33,7 +33,7 @@ namespace WebfrontCore.ViewComponents
|
||||
$"{showEvadeString(p)}{p.AutomatedOffense}" :
|
||||
$"{showEvadeString(p)}{p.Offense}",
|
||||
#endif
|
||||
Type = p.Type.ToString(),
|
||||
PenaltyType = p.Type.ToString(),
|
||||
TimePunished = Utilities.GetTimePassed(p.When, false),
|
||||
// show time passed if ban
|
||||
TimeRemaining = DateTime.UtcNow > p.Expires ? "" : $"{((p.Expires ?? DateTime.MaxValue).Year == DateTime.MaxValue.Year ? Utilities.GetTimePassed(p.When, true) : Utilities.TimeSpanText((p.Expires ?? DateTime.MaxValue) - DateTime.UtcNow))}",
|
||||
|
15
WebfrontCore/ViewComponents/ProfileMetaListViewComponent.cs
Normal file
15
WebfrontCore/ViewComponents/ProfileMetaListViewComponent.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SharedLibraryCore.Services;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WebfrontCore.ViewComponents
|
||||
{
|
||||
public class ProfileMetaListViewComponent : ViewComponent
|
||||
{
|
||||
public async Task<IViewComponentResult> InvokeAsync(int clientId, int count, int offset)
|
||||
{
|
||||
var meta = await MetaService.GetRuntimeMeta(clientId, offset, count);
|
||||
return View("_List", meta);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user