Ajout vocabulaire
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
possiblité d'ajouter du vocabulaire et fix de 2/3 bugitosblazor
parent
f414f8c385
commit
50da11c8c1
@ -1,4 +1,4 @@
|
|||||||
@page "/add"
|
@page "/addUser"
|
||||||
@attribute [Authorize(Roles = "admin")]
|
@attribute [Authorize(Roles = "admin")]
|
||||||
@using adminBlazor.Models
|
@using adminBlazor.Models
|
||||||
<h3>Add</h3>
|
<h3>Add</h3>
|
@ -0,0 +1,44 @@
|
|||||||
|
@page "/addVoc"
|
||||||
|
@attribute [Authorize(Roles = "teacher")]
|
||||||
|
@using adminBlazor.Models
|
||||||
|
@using Blazorise.Extensions
|
||||||
|
<h3>Add Vocabulary List</h3>
|
||||||
|
|
||||||
|
<EditForm Model="@voc" OnValidSubmit="@HandleValidSubmit">
|
||||||
|
<DataAnnotationsValidator />
|
||||||
|
<ValidationSummary />
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<label for="name">
|
||||||
|
Name:
|
||||||
|
<InputText id="name" @bind-Value="voc.Name" />
|
||||||
|
<ValidationMessage For="@(() => voc.Name)"/>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<h4>Words:</h4>
|
||||||
|
@if (voc.Translations.IsNullOrEmpty() == false)
|
||||||
|
{
|
||||||
|
foreach (var word in voc.Translations)
|
||||||
|
{
|
||||||
|
{
|
||||||
|
<div class="word-container">
|
||||||
|
<label>
|
||||||
|
First Word:
|
||||||
|
<InputText @bind-Value="word.FirstWord"/>
|
||||||
|
</label>
|
||||||
|
<label>
|
||||||
|
Second Word:
|
||||||
|
<InputText @bind-Value="word.SecondWord"/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<button type="button" @onclick="() => RemoveWord(word)">Remove Word</button>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<p>No words</p>
|
||||||
|
}
|
||||||
|
<button type="button" @onclick="AddWord">Add Word</button>
|
||||||
|
<button type="submit">Submit</button>
|
||||||
|
</EditForm>
|
Loading…
Reference in new issue