added tags in supplies requisition modal.

This commit is contained in:
DESKTOP-GENO133\IvanPlex
2024-02-11 12:46:34 -07:00
parent f581e55842
commit bcafd9e97e

View File

@@ -4,6 +4,7 @@
@{ @{
var userConfig = config.GetUserConfig(User); var userConfig = config.GetUserConfig(User);
var userLanguage = userConfig.UserLanguage; var userLanguage = userConfig.UserLanguage;
var recordTags = Model.SelectMany(x => x.Tags).Distinct();
} }
@model List<SupplyRecord> @model List<SupplyRecord>
<div class="modal-header"> <div class="modal-header">
@@ -14,10 +15,16 @@
@if (Model.Any()) @if (Model.Any())
{ {
<div class="row"> <div class="row">
<div class="col-12" style="max-height:50vh; overflow-y:auto;"> <div class="col-12" style="max-height:50vh; overflow-y:auto;" id="suppliesTable">
<div class="alert alert-warning" role="alert"> <div class="alert alert-warning" role="alert">
@translator.Translate(userLanguage,"Supplies are requisitioned immediately after the record is created and cannot be modified. If you have incorrectly entered the amount you needed you will need to correct it in the Supplies tab.") @translator.Translate(userLanguage,"Supplies are requisitioned immediately after the record is created and cannot be modified. If you have incorrectly entered the amount you needed you will need to correct it in the Supplies tab.")
</div> </div>
<div class="d-flex align-items-center flex-wrap">
@foreach (string recordTag in recordTags)
{
<span onclick="filterTable('suppliesTable', this)" class="user-select-none ms-2 rounded-pill badge bg-secondary tagfilter" style="cursor:pointer;">@recordTag</span>
}
</div>
<table class="table table-hover"> <table class="table table-hover">
<thead class="sticky-top"> <thead class="sticky-top">
<tr class="d-flex"> <tr class="d-flex">
@@ -32,7 +39,7 @@
<tbody> <tbody>
@foreach (SupplyRecord supplyRecord in Model) @foreach (SupplyRecord supplyRecord in Model)
{ {
<tr class="d-flex" id="supplyRows"> <tr class="d-flex" id="supplyRows" data-tags='@string.Join(" ", supplyRecord.Tags)'>
<td class="col-1"><input class="form-check-input" type="checkbox" onchange="toggleQuantityFieldDisabled(this)" value="@supplyRecord.Id"></td> <td class="col-1"><input class="form-check-input" type="checkbox" onchange="toggleQuantityFieldDisabled(this)" value="@supplyRecord.Id"></td>
<td class="col-2"><input type="text" inputmode="decimal" disabled onchange="recalculateTotal()" class="form-control"></td> <td class="col-2"><input type="text" inputmode="decimal" disabled onchange="recalculateTotal()" class="form-control"></td>
<td class="col-2 supplyquantity">@supplyRecord.Quantity</td> <td class="col-2 supplyquantity">@supplyRecord.Quantity</td>