mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Add machine families to book admin page.
This commit is contained in:
@@ -36,6 +36,8 @@
|
||||
@inject DocumentCompaniesService CompaniesService
|
||||
@inject DocumentRolesService DocumentRolesService
|
||||
@inject CompaniesByBookService CompaniesByBookService
|
||||
@inject MachineFamiliesService MachineFamiliesService
|
||||
@inject BooksByMachineFamilyService BooksByMachineFamilyService
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IWebHostEnvironment Host
|
||||
@inject IJSRuntime JSRuntime
|
||||
@@ -239,8 +241,8 @@
|
||||
}
|
||||
</Select>
|
||||
</Field>
|
||||
<Button Color="Color.Primary" Clicked="@CancelAddCpu" Disabled="@_savingCompany">@L["Cancel"]</Button>
|
||||
<Button Color="Color.Success" Clicked="@ConfirmAddCpu" Disabled="@_savingCompany">@L["Add"]</Button>
|
||||
<Button Color="Color.Primary" Clicked="@CancelAddCompany" Disabled="@_savingCompany">@L["Cancel"]</Button>
|
||||
<Button Color="Color.Success" Clicked="@ConfirmAddCompany" Disabled="@_savingCompany">@L["Add"]</Button>
|
||||
</div>
|
||||
}
|
||||
@if (_bookCompanies?.Count > 0)
|
||||
@@ -269,7 +271,55 @@
|
||||
@item.Role
|
||||
</td>
|
||||
<td>
|
||||
<Button Color="Color.Danger" Clicked="() => {ShowCpuDeleteModal(item.Id);}" Disabled="@_addingCompany">@L["Delete"]</Button>
|
||||
<Button Color="Color.Danger" Clicked="() => {ShowCompanyDeleteModal(item.Id);}" Disabled="@_addingCompany">@L["Delete"]</Button>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
|
||||
<hr />
|
||||
<h3>@L["Machine families this book talks about"]</h3>
|
||||
<Button Color="Color.Success" Clicked="OnAddFamilyClick" Disabled="_addingMachineFamily">@L["Add new (machine family)"]</Button>
|
||||
@if (_addingMachineFamily)
|
||||
{
|
||||
<div>
|
||||
<Field>
|
||||
<FieldLabel>@L["Family"]</FieldLabel>
|
||||
<Select Disabled="_savingMachineFamily" TValue="int?" @bind-SelectedValue="@_addingMachineFamilyId">
|
||||
@foreach (var family in _machineFamilies)
|
||||
{
|
||||
<SelectItem TValue="int?" Value="@family.Id">@family.Name</SelectItem>
|
||||
}
|
||||
</Select>
|
||||
</Field>
|
||||
<Button Color="Color.Primary" Clicked="@CancelAddFamily" Disabled="@_savingMachineFamily">@L["Cancel"]</Button>
|
||||
<Button Color="Color.Success" Clicked="@ConfirmAddFamily" Disabled="@_savingMachineFamily">@L["Add"]</Button>
|
||||
</div>
|
||||
}
|
||||
@if (_bookMachineFamilies?.Count > 0)
|
||||
{
|
||||
<div>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@L["Family"]
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in _bookMachineFamilies)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@item.MachineFamily
|
||||
</td>
|
||||
<td>
|
||||
<Button Color="Color.Danger" Clicked="() => {ShowMachineFamilyDeleteModal(item.Id);}" Disabled="@_addingMachineFamily">@L["Delete"]</Button>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user