commit
ff6bda4f2a
@ -0,0 +1,26 @@
|
||||
@page "/editVoc/{Id:int}"
|
||||
@using adminBlazor.Models
|
||||
|
||||
|
||||
<h3>Edit</h3>
|
||||
<h4>Voc id : @Id</h4>
|
||||
<EditForm Model="@voc" OnValidSubmit="@HandleValidSubmit">
|
||||
<DataAnnotationsValidator />
|
||||
<ValidationSummary />
|
||||
|
||||
<p>
|
||||
<label for="name">
|
||||
Name:
|
||||
<InputText id="name" @bind-Value="voc.name" />
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for="image">
|
||||
Image:
|
||||
<InputText id="image" @bind-Value="voc.image" />
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<button type="submit">Submit</button>
|
||||
</EditForm>
|
@ -0,0 +1,43 @@
|
||||
@page "/voc"
|
||||
@using adminBlazor.Models
|
||||
|
||||
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css">
|
||||
|
||||
<link href="_content/Blazorise/blazorise.css" rel="stylesheet" />
|
||||
<link href="_content/Blazorise.Bootstrap/blazorise.bootstrap.css" rel="stylesheet" />
|
||||
<h3>Vocabulary Lists</h3>
|
||||
|
||||
<DataGrid TItem="VocabularyList"
|
||||
Data="@_vocList"
|
||||
ReadData="@OnReadData"
|
||||
TotalItems="@totalVocList"
|
||||
PageSize="10"
|
||||
ShowPager
|
||||
Responsive>
|
||||
|
||||
<DataGridColumn TItem="VocabularyList" Field="@nameof(VocabularyList.id)" Caption="id" />
|
||||
<DataGridColumn TItem="VocabularyList" Field="@nameof(VocabularyList.name)" Caption="Name" />
|
||||
<DataGridColumn TItem="VocabularyList" Field="@nameof(VocabularyList.image)" Caption="Image" />
|
||||
<DataGridColumn TItem="VocabularyList" Field="@nameof(VocabularyList.aut)" Caption="Author ID">
|
||||
<DisplayTemplate>
|
||||
@if (context is VocabularyList voc)
|
||||
{
|
||||
@if (voc.aut != null)
|
||||
{
|
||||
@voc.aut
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>No author</span>
|
||||
}
|
||||
}
|
||||
</DisplayTemplate>
|
||||
</DataGridColumn>
|
||||
|
||||
<DataGridColumn TItem="VocabularyList" Field="@nameof(VocabularyList.id)" Caption="Modifier">
|
||||
<DisplayTemplate>
|
||||
<a href="editVoc/@(context.id)" class="btn btn-primary"><i class="fa fa-edit"></i> Editer</a>
|
||||
</DisplayTemplate>
|
||||
</DataGridColumn>
|
||||
</DataGrid>
|
Loading…
Reference in new issue