Merge branch 'master' of https://codefirst.iut.uca.fr/git/lucie.bedouret/blazorCourse
commit
41f56ceba2
@ -1,55 +1,45 @@
|
|||||||
@page "/inventory"
|
@page "/inventory"
|
||||||
@using myBlazorApp.Components
|
@using myBlazorApp.Components
|
||||||
@using System.Globalization
|
@using System.Globalization
|
||||||
@using myBlazorApp.Models;
|
@using myBlazorApp.Models;
|
||||||
|
|
||||||
<div class="inventory">
|
<div class="body">
|
||||||
<MyInventory ItemsInventory="@itemsInv"/>
|
<div class="inventory">
|
||||||
</div>
|
<MyInventory ItemsInventory="@itemsInv" />
|
||||||
|
</div>
|
||||||
<div id="ItemList">
|
|
||||||
<div>
|
|
||||||
<h3>List of Items</h3>
|
|
||||||
@*SearchBar*@
|
|
||||||
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<b>CurrentCulture</b>: @CultureInfo.CurrentCulture
|
|
||||||
</p>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="ItemList" class="align-end">
|
|
||||||
<div>
|
|
||||||
<p>
|
|
||||||
List of items
|
|
||||||
</p>
|
|
||||||
@*SearchBar*@
|
|
||||||
|
|
||||||
</div>
|
<div id="ItemList">
|
||||||
|
<div id="ItemList" class="align-end">
|
||||||
<DataGrid TItem="Item"
|
<div>
|
||||||
Data="@items"
|
<p>
|
||||||
ReadData="@OnReadData"
|
List of items
|
||||||
TotalItems="@totalItem"
|
</p>
|
||||||
PageSize="10"
|
@*SearchBar*@
|
||||||
ShowPager
|
|
||||||
Responsive>
|
</div>
|
||||||
<DataGridColumn TItem="Item" Field=""/>
|
|
||||||
<DataGridColumn TItem="Item" Field="@nameof(Item.DisplayName)" Caption="Display name" />
|
<DataGrid TItem="Item"
|
||||||
<DataGridColumn TItem="Item" Field="@nameof(Item.Id)" Caption="Image">
|
Data="@items"
|
||||||
<DisplayTemplate>
|
ReadData="@OnReadData"
|
||||||
@if (File.Exists($"{WebHostEnvironment.WebRootPath}/images/{context.Name}.png"))
|
TotalItems="@totalItem"
|
||||||
{
|
PageSize="10"
|
||||||
<img src="images/@(context.Name).png" class="img-thumbnail" title="@context.DisplayName" alt="@context.DisplayName" style="max-width: 150px"/>
|
ShowPager
|
||||||
}
|
Responsive>
|
||||||
else
|
<DataGridColumn TItem="Item" Field="" />
|
||||||
{
|
<DataGridColumn TItem="Item" Field="@nameof(Item.DisplayName)" Caption="Display name" />
|
||||||
<img src="images/default.png" class="img-thumbnail" title="@context.DisplayName" alt="@context.DisplayName" style="max-width: 150px"/>
|
<DataGridColumn TItem="Item" Field="@nameof(Item.Id)" Caption="Image">
|
||||||
}
|
<DisplayTemplate>
|
||||||
</DisplayTemplate>
|
@if (!string.IsNullOrWhiteSpace(context.ImageBase64))
|
||||||
</DataGridColumn>
|
{
|
||||||
</DataGrid>
|
<img src="data:image/png;base64, @(context.ImageBase64)" class="img-thumbnail" title="@context.DisplayName" alt="@context.DisplayName" style="min-width: 50px; max-width: 150px" />
|
||||||
</div>
|
}
|
||||||
</div>
|
else
|
||||||
|
{
|
||||||
|
<img src="images/default.png" class="img-thumbnail" title="@context.DisplayName" alt="@context.DisplayName" style="max-width: 150px" />
|
||||||
|
}
|
||||||
|
</DisplayTemplate>
|
||||||
|
</DataGridColumn>
|
||||||
|
</DataGrid>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
Loading…
Reference in new issue