feat: simple player layout

This commit is contained in:
Mikhail Shabanov committed 2021-07-21 15:44:14 +02:00
1 parent 08946996a5
commit df29327231
6 files changed
+91 -8

No files matched your search

@@ -6,10 +6,20 @@
Style="width: 100%; margin-top: 10px;" />
@if (AccountInfo != null)
{
@AccountInfo.Nickname @if (AccountInfo.ClanInfo != null)
{
<span style="color: @Constants.ClanTagColor;"> [<span style="font-weight: bolder;">@AccountInfo.ClanInfo.Tag</span>]</span>
}
<h1>
@AccountInfo.Nickname @if (AccountInfo.ClanInfo != null)
{
<span style="color: @Constants.ClanTagColor;"> [<span style="font-weight: bolder;">@AccountInfo.ClanInfo.Tag</span>]</span>
}
</h1>
<div style="margin-top: 10px; margin-bottom: 20px;">
<div>
<small>@Localize["Created"]: <b>@AccountInfo.CreatedAt.ToString("d") | @AccountInfo.CreatedAt.SinceTime(Localize)</b></small>
</div>
<div>
@Localize["Last battle"]: <b>@AccountInfo.LastBattleTime.ToString("g") | @AccountInfo.LastBattleTime.SinceTime(Localize)</b>
</div>
</div>
<RadzenTabs >
<Tabs>
<RadzenTabsItem Icon="person_outline" >
@@ -0,0 +1,4 @@
dates-section {
margin-top: 10px;
margin-bottom: 10px;
}
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Localization;
using WotBlitzStatisticsPro.Blazor.GraphQl;
using WotBlitzStatisticsPro.Blazor.Services;
@@ -14,6 +15,10 @@ namespace WotBlitzStatisticsPro.Blazor.Pages
[Inject]
public ILocalStorageService LocalStorageService { get; set; }
[Inject]
public IStringLocalizer<App> Localize { get; set; }
[Parameter]
public long AccountId { get; set; }
@@ -1,6 +1,58 @@
@AccountInfo.WinRate %
@using WotBlitzStatisticsPro.Blazor.Helpers
@inject IStringLocalizer<App> Localize;
<RadzenCard>
<div class="row">
<div class="col-md-6 col-lg-6">
<table class="table" width="250px">
<tbody>
<tr>
<td>@Localize["Battles"]:</td>
<td><b>@AccountInfo.Battles.ToString("N0")</b></td>
</tr>
<tr>
<td>@Localize["Win rate"]:</td>
<td>
<b>@AccountInfo.WinRate.ToString("N2")%</b>
<div style="background-color: @AccountInfo.WinRate.ScaleColor(); width: 100%; height: 5px; margin-left: 2px; margin-right: 2px;"></div>
</td>
</tr>
<tr>
<td>@Localize["Wn7"]:</td>
<td>
<b>@AccountInfo.Wn7.ToString("N2")</b>
<div style="background-color: @AccountInfo.Wn7.Wn7ScaleColor(); width: 100%; height: 5px; margin-left: 2px; margin-right: 2px;"></div>
</td>
</tr>
<tr>
<td>@Localize["Average Damage"]:</td>
<td><b>@AccountInfo.AvgDamage.ToString("N0")</b></td>
</tr>
<tr>
<td>@Localize["Average XP"]:</td>
<td><b>@AccountInfo.AvgXp.ToString("N0")</b></td>
</tr>
</tbody>
</table>
</div>
<div class="col-md-6 col-lg-6">
@if(MostRelevantTank != null)
{
<p>@MostRelevantTank.Name</p>
}
</div>
</div>
</RadzenCard>
@code {
[Parameter]
public IAccount AccountInfo { get; set; }
public ITank? MostRelevantTank;
protected override void OnInitialized()
{
MostRelevantTank = AccountInfo?.Tanks?.Where(t => t.Battles > 50).OrderByDescending(t => t.Wn7).FirstOrDefault();
}
}
@@ -117,8 +117,14 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Average Damage" xml:space="preserve">
<value>Mittlerer Schaden</value>
</data>
<data name="Average XP" xml:space="preserve">
<value>Mittlere EP</value>
</data>
<data name="Battles" xml:space="preserve">
<value>Schlachten</value>
<value>Gefechte</value>
</data>
<data name="Cancel" xml:space="preserve">
<value>Abbrechen</value>
@@ -151,7 +157,7 @@
<value>vor Stunden</value>
</data>
<data name="Last battle" xml:space="preserve">
<value>Letzte Schlacht</value>
<value>Letzte Gefecht</value>
</data>
<data name="Login with WG.net ID" xml:space="preserve">
<value>Anmelden mit WG.net-ID</value>
@@ -199,7 +205,7 @@
<value>Willkommen bei der WOT Blitz statistics!</value>
</data>
<data name="Win rate" xml:space="preserve">
<value>Gewinnrate</value>
<value>Sieg</value>
</data>
<data name="years ago" xml:space="preserve">
<value>vor Jahren</value>
@@ -117,6 +117,12 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Average Damage" xml:space="preserve">
<value>Средний урон</value>
</data>
<data name="Average XP" xml:space="preserve">
<value>Средний опыт</value>
</data>
<data name="Battles" xml:space="preserve">
<value>Количество боёв</value>
</data>