Adding agents table UI
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
@page "/agents"
|
||||
@using Chrono.Model
|
||||
|
||||
<PageTitle>Agents</PageTitle>
|
||||
|
||||
<div class="agents-page">
|
||||
<div class="agents-header">
|
||||
<h1>Agents</h1>
|
||||
<p class="text-secondary">@agents.Count agents in the database</p>
|
||||
</div>
|
||||
|
||||
<TelerikGrid Data="@agents"
|
||||
Sortable="true"
|
||||
FilterMode="@GridFilterMode.FilterRow"
|
||||
Pageable="true"
|
||||
PageSize="250"
|
||||
Resizable="true"
|
||||
Height="700px"
|
||||
class="agents-grid">
|
||||
<GridColumns>
|
||||
<GridColumn Title="Im." Width="30px">
|
||||
<Template>
|
||||
@if (((CardData)context).HasImmortalize)
|
||||
{
|
||||
<i class="bi bi-star-fill" style="color: #ffd700;" title="Immortalizes"></i>
|
||||
}
|
||||
</Template>
|
||||
</GridColumn>
|
||||
<GridColumn Field="@nameof(CardData.Name)" Title="Card" Width="220px">
|
||||
<Template>
|
||||
<div class="agent-name-cell">
|
||||
<img src="@(((CardData)context).ImagePath)" alt="@(((CardData)context).Name)" class="agent-thumb"/>
|
||||
<span>@(((CardData)context).Name)</span>
|
||||
</div>
|
||||
</Template>
|
||||
</GridColumn>
|
||||
<GridColumn Field="@nameof(CardData.Cost)" Title="Cost" Width="60px"/>
|
||||
<GridColumn Field="@nameof(CardData.Faction)" Title="Faction" Width="110px"/>
|
||||
<GridColumn Field="@nameof(CardData.Attack)" Title="ATK" Width="60px"/>
|
||||
<GridColumn Field="@nameof(CardData.Health)" Title="HP" Width="60px"/>
|
||||
<GridColumn Field="@nameof(CardData.Description)" Title="Description" Width="400px"/>
|
||||
|
||||
</GridColumns>
|
||||
</TelerikGrid>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private List<CardData> agents = [];
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
agents = CardDatabase.Cards
|
||||
.Where(c => c.Category == "Agent")
|
||||
.OrderBy(c => c.Cost)
|
||||
.ThenBy(c => c.Name)
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user