124 lines
5.8 KiB
Plaintext
124 lines
5.8 KiB
Plaintext
@inherits BaseComp
|
|
|
|
@if (addVisible)
|
|
{
|
|
<div class="modal" tabindex="-1" style="display:block; background-color: rgba(10,10,10,.6);" role="dialog">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<div class="modal-title fs-4">@Traduci("nuovo")</div>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" @onclick="ToggleAdd">
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
@if (newRecord != null)
|
|
{
|
|
<div class="row">
|
|
<div class="input-group mb-2">
|
|
<span class="input-group-text" id="basic-addon1">@Traduci("descrizione")</span>
|
|
<input type="text" class="form-control text-end" @bind="@newRecord.Description" />
|
|
</div>
|
|
</div>
|
|
}
|
|
@if (!string.IsNullOrEmpty(errorMsg))
|
|
{
|
|
<div class="alert alert-danger my-3">
|
|
@errorMsg
|
|
</div>
|
|
}
|
|
<div class="row">
|
|
<div class="col">
|
|
<button class="btn btn-success w-100" @onclick="DoAdd"><i class="fa-solid fa-save"></i> @Traduci("salva")</button>
|
|
</div>
|
|
<div class="col">
|
|
<button class="btn btn-warning w-100" @onclick="ToggleAdd">@Traduci("annulla") <i class="fa-solid fa-ban"></i></button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
|
|
@if (isLoading || ListRecords == null)
|
|
{
|
|
<LoadingData></LoadingData>
|
|
}
|
|
else if (totalCount == 0)
|
|
{
|
|
<div class="alert alert-info text-center display-4">@Traduci("noRecord")</div>
|
|
}
|
|
else
|
|
{
|
|
<table class="table table-sm table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>
|
|
<button class="btn btn-sm btn-primary" title="@Traduci("reset")" @onclick="DoReset"><i class="fa-solid fa-arrow-rotate-right"></i></button>
|
|
</th>
|
|
@if (selRecord == null)
|
|
{
|
|
<th>@Traduci("ord")</th>
|
|
<th>@Traduci("descrizione")</th>
|
|
<th class="text-center">@Traduci("cicli_fasi")</th>
|
|
<th class="text-center">@Traduci("cicli_tags")</th>
|
|
<th class="text-center">@Traduci("cicli_drivers")</th>
|
|
<th>
|
|
<button class="btn btn-sm btn-success" @onclick="ToggleAdd"><i class="fa-solid fa-plus"></i></button>
|
|
</th>
|
|
}
|
|
else
|
|
{
|
|
<th>@Traduci("descrizione")</th>
|
|
}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var item in ListRecords)
|
|
{
|
|
string cssBtnUp = editRecord == null && item.Index > 1 ? "btn-outline-primary" : "btn-outline-secondary opacity-50 disabled";
|
|
string cssBtnDown = editRecord == null && item.Index < totalCount ? "btn-outline-primary" : "btn-outline-secondary opacity-50 disabled";
|
|
|
|
<tr class="@checkSel(item)">
|
|
<td class="text-start text-nowrap">
|
|
<button class="btn btn-sm btn-primary" @onclick="() => DoSelect(item)"><i class="fa-solid fa-magnifying-glass"></i></button>
|
|
<button class="btn btn-sm btn-info" @onclick="() => DoEdit(item)"><i class="fa-solid fa-pencil"></i></button>
|
|
</td>
|
|
@if (selRecord == null)
|
|
{
|
|
<td class="text-nowrap">
|
|
|
|
<button class="btn @cssBtnUp btn-sm fa-solid fa-caret-up" @onclick="() => MoveRec(item, true)"></button>
|
|
@item.Index
|
|
<button class="btn @cssBtnDown btn-sm fa-solid fa-caret-down" @onclick="() => MoveRec(item, false)"></button>
|
|
</td>
|
|
<td>@item.Description</td>
|
|
<td class="text-center">@item.NumChild</td>
|
|
<td class="text-center">
|
|
<TagDisplay ParentId="@item.JobID" AllTagsList="ListAllTags" EnableEdit="true" ActiveTagsList="@item.TagList" DisplayAs="TagDisplay.TagMode.badge" EC_ReqSave="DoSaveTags"></TagDisplay>
|
|
</td>
|
|
<td class="text-center">
|
|
<TagDisplay AllTagsList="ListCostDrivers" EnableEdit="false" ActiveTagsList="@ListDriversName(item)" BaseCss="bg-primary bg-gradient bg-opacity-50 text-dark" DisplayAs="TagDisplay.TagMode.pill"></TagDisplay>
|
|
</td>
|
|
<td>
|
|
@if (item.Lock || item.NumChild > 0)
|
|
{
|
|
<button class="btn btn-sm btn-secondary opacity-50" disabled title="@Traduci("childCorrelati")"><i class="fa-solid fa-trash-can"></i></button>
|
|
}
|
|
else
|
|
{
|
|
<button class="btn btn-sm btn-danger" @onclick="() => DoDelete(item)"><i class="fa-solid fa-trash-can"></i></button>
|
|
}
|
|
</td>
|
|
}
|
|
else
|
|
{
|
|
<td>@item.Description</td>
|
|
}
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
}
|
|
|
|
<BootstrapModal @ref=Modal Title=@mTitle Message=@mMessage Mode="BootstrapModal.ModalMode.Confirm" UserOptions=@modalOpt></BootstrapModal> |