Files

200 lines
11 KiB
Plaintext
Raw Permalink Normal View History

2021-07-15 11:51:06 +02:00
@using WotBlitzStatisticsPro.Blazor.Helpers
2022-05-05 12:28:16 +02:00
@using WotBlitzStatisticsPro.Blazor.Messages
2021-07-15 22:14:41 +02:00
@inherits PlayerInfoTanksListBase;
2021-07-15 11:51:06 +02:00
2021-07-15 22:14:41 +02:00
<div class="row">
<div class="col-lg-2 col-md-2">
<RadzenDropDown @bind-Value="@FilteredTiers" Multiple="true" TextProperty="ItemName" ValueProperty="ItemId" Style="width: 100%"
AllowClear="false"
Change=@OnFilterChange
Placeholder="@Localize["Filter tier..."]"
Data="@TierFilter"/>
</div>
<div class="col-lg-2 col-md-2">
<RadzenDropDown @bind-Value="@FilteredTankTypes" Multiple="true" TextProperty="ItemName" ValueProperty="ItemId" Style="width: 100%"
AllowClear="false"
Change=@OnFilterChange
Placeholder="@Localize["Filter tank types..."]"
Data="@TankTypesFilter">
<Template Context="data">
<RadzenImage Path="@data.ItemName" style="width: 24px; height: 24px;" />
</Template>
</RadzenDropDown>
</div>
<div class="col-lg-2 col-md-2">
<RadzenCheckBox @bind-Value=@FilterIsPremium TriState="true" TValue="bool?" Change=@(args => OnFilterChange(args)) /><RadzenLabel Text="@Localize["Premium tanks"]" Style="margin-left: 5px" Component="CheckBox" />
</div>
<div class="col-lg-2 col-md-2">
<RadzenDropDown @bind-Value="@FilteredNations" Multiple="true" TextProperty="ItemName" ValueProperty="ItemId" Style="width: 100%"
AllowClear="false"
Change=@OnFilterChange
Placeholder="@Localize["Filter nations..."]"
Data="@NationsFilter">
<Template Context="data">
<RadzenImage Path="@data.ItemName" style="width: 35px; height: 23px; border-radius: 4px;" />
</Template>
</RadzenDropDown>
</div>
<div class="col-lg-2 col-md-2">
<RadzenDropDown @bind-Value="@FilteredMastery" Multiple="true" TextProperty="ItemName" ValueProperty="ItemId" Style="width: 100%"
AllowClear="false"
Change=@OnFilterChange
Placeholder="@Localize["Filter mark of mastery..."]"
Data="@MasteryFilter">
<Template Context="data">
<RadzenImage Path="@data.ItemName" style="width: 24px; height: 24px;" />
</Template>
</RadzenDropDown>
</div>
<div class="col-lg-2 col-md-2">
<RadzenNumeric TValue="int?" @bind-Value=@MinBattles Placeholder="@Localize["Min battles"]" Change=@(args => OnFilterChange(args)) />
</div>
</div>
2021-07-15 11:51:06 +02:00
<RadzenDataGrid AllowFiltering="true"
AllowColumnResize="true"
2021-07-15 22:14:41 +02:00
FilterMode="FilterMode.Simple"
2021-12-01 16:06:56 +01:00
PageSize="20"
2021-07-15 11:51:06 +02:00
AllowPaging="true"
AllowSorting="true"
2021-07-15 22:14:41 +02:00
Data="@FilteredTankList"
2021-07-15 11:51:06 +02:00
TItem="ITank"
ColumnWidth="300px"
2021-07-15 22:14:41 +02:00
LogicalFilterOperator="LogicalFilterOperator.Or"
@ref="TanksGrid">
2021-07-15 11:51:06 +02:00
<Columns>
2021-07-23 12:29:37 +02:00
<RadzenDataGridColumn TItem="ITank" Property="Tier" Sortable="true" Filterable="false" Title="" Frozen="false" Width="34px" TextAlign="TextAlign.Center">
2021-07-15 11:51:06 +02:00
<Template Context="data">
<b>@data.Tier.RomanNumber()</b>
</Template>
</RadzenDataGridColumn>
2021-07-23 12:29:37 +02:00
<RadzenDataGridColumn TItem="ITank" Property="TankTypeId" Filterable="false" Sortable="true" Title="" Frozen="false" Width="34px" TextAlign="TextAlign.Center">
2021-07-15 11:51:06 +02:00
<Template Context="data">
2021-07-23 12:29:37 +02:00
<RadzenImage Path="@data.TankTypeId.TankTypeAsset(data.IsPremium)" MouseEnter="@(args => ShowTooltip(args, data.TankType, new TooltipOptions(){ Style = "background-color:#2F3D43" }) )" style="width: 24px; height: 24px;" />
2021-07-15 11:51:06 +02:00
</Template>
</RadzenDataGridColumn>
2021-07-23 12:29:37 +02:00
<RadzenDataGridColumn TItem="ITank" Property="TankNationId" Filterable="false" Sortable="true" Title="" Frozen="false" Width="50px" TextAlign="TextAlign.Center">
2021-07-15 11:51:06 +02:00
<Template Context="data">
2021-07-23 12:29:37 +02:00
<RadzenImage Path="@data.TankNationId.NationAsset()" MouseEnter="@(args => ShowTooltip(args, data.TankNation, new TooltipOptions(){ Style = "background-color:#2F3D43" }) )" style="width: 35px; height: 23px; border-radius: 4px;" />
2021-07-15 11:51:06 +02:00
</Template>
</RadzenDataGridColumn>
2021-07-23 12:29:37 +02:00
<RadzenDataGridColumn TItem="ITank" Property="MarkOfMastery" Filterable="false" Sortable="true" Title="" Frozen="false" Width="34px" TextAlign="TextAlign.Center">
2021-07-15 11:51:06 +02:00
<Template Context="data">
<RadzenImage Path="@data.MarkOfMastery.IconAsset()" style="width: 24px; height: 24px;" />
</Template>
</RadzenDataGridColumn>
<RadzenDataGridColumn TItem="ITank" Title="" Sortable="false" Filterable="false" Width="55px">
<Template Context="data">
<RadzenImage Path="@data.PreviewImage" style="width: 50px; height: 40px; border-radius: 8px;"
2022-05-05 12:28:16 +02:00
MouseEnter="@(args => ShowTankTooltip(args, data.PreviewImage, data.TankNationId, new TooltipOptions(){ Style = "background-color:#2F3D43" }) )"
Click="@(async (args) => { await Mediator.Publish(new OpenTankDialogMessage(data)); })" />
2021-07-15 11:51:06 +02:00
</Template>
</RadzenDataGridColumn>
2021-07-23 12:29:37 +02:00
<RadzenDataGridColumn TItem="ITank" Property="Name" Filterable="false" Sortable="true" Title="@Localize["Tank"]" Frozen="false" Width="100px" TextAlign="TextAlign.Left">
2021-07-15 22:14:41 +02:00
<FooterTemplate>
@Localize["Tanks"]: <b>@TanksGrid.View.Count()</b> @Localize["of"] <b>@TanksList.Count()</b>
</FooterTemplate>
</RadzenDataGridColumn>
<RadzenDataGridColumn TItem="ITank" Property="Battles" Filterable="false" Sortable="true" Title="⚔" Frozen="false" Width="70px" TextAlign="TextAlign.Center">
<FooterTemplate>
<b>@TotalBattles.ToString("N0")</b>
2021-07-15 22:14:41 +02:00
</FooterTemplate>
</RadzenDataGridColumn>
2021-07-15 13:57:09 +02:00
<RadzenDataGridColumn TItem="ITank" Property="WinRate"
Filterable="false"
Sortable="true"
Title="🏳"
Frozen="false"
Width="50px"
TextAlign="TextAlign.Center">
<Template Context="data">
2021-11-24 15:54:44 +01:00
<span title="@($"{data.Wins:N0} / {data.Losses:N0}")">@data.WinRate.ToString("N0")%</span>
2021-07-15 13:57:09 +02:00
<div style="background-color: @data.WinRate.ScaleColor(); width: 100%; height: 5px; margin-left: 2px; margin-right: 2px;"></div>
</Template>
2021-07-15 22:14:41 +02:00
<FooterTemplate>
<b>∼@AvgWinRate%</b>
<div style="background-color: @AvgWinRate.ScaleColor(); width: 100%; height: 5px; margin-left: 2px; margin-right: 2px;"></div>
</FooterTemplate>
2021-07-15 13:57:09 +02:00
</RadzenDataGridColumn>
<RadzenDataGridColumn TItem="ITank" Property="Wn7"
Filterable="false"
Sortable="true"
Title="@Localize["Wn7"]"
Frozen="false"
Width="80px"
TextAlign="TextAlign.Center">
2021-07-15 13:57:09 +02:00
<Template Context="data">
@data.Wn7.ToString("N0")
<div style="background-color: @data.Wn7.Wn7ScaleColor(); width: 100%; height: 5px; margin-left: 2px; margin-right: 2px;"></div>
</Template>
2021-07-15 22:14:41 +02:00
<FooterTemplate>
<b>∼@AvgWn7.ToString("N0")%</b>
<div style="background-color: @AvgWn7.Wn7ScaleColor(); width: 100%; height: 5px; margin-left: 2px; margin-right: 2px;"></div>
</FooterTemplate>
</RadzenDataGridColumn>
<RadzenDataGridColumn TItem="ITank" Property="AvgDamage"
Filterable="false"
Sortable="true"
Title="💣"
Frozen="false"
Width="80px"
TextAlign="TextAlign.Center"
FormatString="{0:N0}">
<FooterTemplate>
<b>∼@AvgTotalDamage.ToString("N0")</b>
</FooterTemplate>
</RadzenDataGridColumn>
<RadzenDataGridColumn TItem="ITank" Property="AvgXp"
Filterable="false"
Sortable="true"
Title="⭐"
Frozen="false"
Width="80px"
TextAlign="TextAlign.Center"
FormatString="{0:N0}">
<FooterTemplate>
<b>∼@AvgTotalXp.ToString("N0")</b>
</FooterTemplate>
2021-07-15 13:57:09 +02:00
</RadzenDataGridColumn>
<RadzenDataGridColumn TItem="ITank" Property="MaxXp"
Filterable="false"
Sortable="true"
Title="🌟"
Frozen="false"
Width="80px"
TextAlign="TextAlign.Center"
FormatString="{0:N0}" />
2021-07-15 22:14:41 +02:00
<RadzenDataGridColumn TItem="ITank" Property="SurvivalRate"
Filterable="false"
Sortable="true"
Title="⚰"
Frozen="false"
Width="50px"
2021-07-15 11:51:06 +02:00
TextAlign="TextAlign.Center"
2021-07-15 22:14:41 +02:00
FormatString="{0:N0}%">
<FooterTemplate>
<b>∼@AvgSurvivalRate.ToString("N0")%</b>
</FooterTemplate>
</RadzenDataGridColumn>
<RadzenDataGridColumn TItem="ITank" Property="LastBattleTime"
Filterable="false"
Sortable="true"
Title="⌚"
Frozen="false"
Width="100px"
2021-07-15 11:51:06 +02:00
TextAlign="TextAlign.Center"
2021-07-15 13:57:09 +02:00
FormatString="{0:d}"
SortOrder="SortOrder.Descending">
<Template Context="data">
@data.LastBattleTime.ConvertToLocalTime().ToString("g")
</Template>
</RadzenDataGridColumn>
2021-07-15 11:51:06 +02:00
</Columns>
</RadzenDataGrid>
2021-07-23 12:29:37 +02:00
@code {
void ShowTankTooltip(ElementReference elementReference, string img, string nationId, TooltipOptions options = null) => TooltipService.Open(elementReference, ds =>
@<div style="background-image: url('@nationId.NationAsset()'); background-repeat: no-repeat;">
<img src=@img style="width: 360px; height: 263px; " />
</div>, options);
}