parent
7a7d52d89f
commit
0c1ab868c4
@ -0,0 +1,69 @@
|
|||||||
|
@page "/add"
|
||||||
|
|
||||||
|
<h3>Add</h3>
|
||||||
|
|
||||||
|
<EditForm Model="@itemModel" OnValidSubmit="@HandleValidSubmit">
|
||||||
|
<DataAnnotationsValidator />
|
||||||
|
<ValidationSummary />
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<label for="display-name">
|
||||||
|
Display name:
|
||||||
|
<InputText id="display-name" @bind-Value="itemModel.DisplayName" />
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label for="name">
|
||||||
|
Name:
|
||||||
|
<InputText id="name" @bind-Value="itemModel.Name" />
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label for="stack-size">
|
||||||
|
Stack size:
|
||||||
|
<InputNumber id="stack-size" @bind-Value="itemModel.StackSize" />
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label for="max-durability">
|
||||||
|
Max durability:
|
||||||
|
<InputNumber id="max-durability" @bind-Value="itemModel.MaxDurability" />
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Enchant categories:
|
||||||
|
<div>
|
||||||
|
@foreach (var item in enchantCategories)
|
||||||
|
{
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" @onchange="@(e => OnEnchantCategoriesChange(item, e.Value))" />@item
|
||||||
|
</label>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Repair with:
|
||||||
|
<div>
|
||||||
|
@foreach (var item in repairWith)
|
||||||
|
{
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" @onchange="@(e => OnRepairWithChange(item, e.Value))" />@item
|
||||||
|
</label>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
Item image:
|
||||||
|
<InputFile OnChange="@LoadImage" accept=".png" />
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
Accept Condition:
|
||||||
|
<InputCheckbox @bind-Value="itemModel.AcceptCondition" />
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<button type="submit">Submit</button>
|
||||||
|
</EditForm>
|
@ -1,34 +1,34 @@
|
|||||||
@page "/list"
|
@page "/list"
|
||||||
|
@using BlazorTuto.Models
|
||||||
|
|
||||||
<h3>List</h3>
|
<h3>List</h3>
|
||||||
|
|
||||||
@if (items != null)
|
<div>
|
||||||
{
|
<NavLink class="btn btn-primary" href="Add" Match="NavLinkMatch.All">
|
||||||
<table class="table">
|
<i class="fa fa-plus"></i> Ajouter
|
||||||
<thead>
|
</NavLink>
|
||||||
<tr>
|
</div>
|
||||||
<th>Id</th>
|
|
||||||
<th>Display Name</th>
|
<DataGrid TItem="Item"
|
||||||
<th>Stack Size</th>
|
Data="@items"
|
||||||
<th>Maximum Durability</th>
|
ReadData="@OnReadData"
|
||||||
<th>Enchant Categories</th>
|
TotalItems="@totalItem"
|
||||||
<th>Repair With</th>
|
PageSize="10"
|
||||||
<th>Created Date</th>
|
ShowPager
|
||||||
</tr>
|
Responsive>
|
||||||
</thead>
|
<DataGridColumn TItem="Item" Field="@nameof(Item.Id)" Caption="#" />
|
||||||
<tbody>
|
<DataGridColumn TItem="Item" Field="@nameof(Item.DisplayName)" Caption="Display name" />
|
||||||
@foreach (var item in items)
|
<DataGridColumn TItem="Item" Field="@nameof(Item.StackSize)" Caption="Stack size" />
|
||||||
{
|
<DataGridColumn TItem="Item" Field="@nameof(Item.MaxDurability)" Caption="Maximum durability" />
|
||||||
<tr>
|
<DataGridColumn TItem="Item" Field="@nameof(Item.EnchantCategories)" Caption="Enchant categories">
|
||||||
<td>@item.Id</td>
|
<DisplayTemplate>
|
||||||
<td>@item.DisplayName</td>
|
@(string.Join(", ", ((Item)context).EnchantCategories))
|
||||||
<td>@item.StackSize</td>
|
</DisplayTemplate>
|
||||||
<td>@item.MaxDurability</td>
|
</DataGridColumn>
|
||||||
<td>@(string.Join(", ", item.EnchantCategories))</td>
|
<DataGridColumn TItem="Item" Field="@nameof(Item.RepairWith)" Caption="Repair with">
|
||||||
<td>@(string.Join(", ", item.RepairWith))</td>
|
<DisplayTemplate>
|
||||||
<td>@item.CreatedDate.ToShortDateString()</td>
|
@(string.Join(", ", ((Item)context).RepairWith))
|
||||||
</tr>
|
</DisplayTemplate>
|
||||||
}
|
</DataGridColumn>
|
||||||
</tbody>
|
<DataGridColumn TItem="Item" Field="@nameof(Item.CreatedDate)" Caption="Created date" DisplayFormat="{0:d}" DisplayFormatProvider="@System.Globalization.CultureInfo.GetCultureInfo("fr-FR")" />
|
||||||
</table>
|
</DataGrid>
|
||||||
}
|
|
Loading…
Reference in new issue