changes
This commit is contained in:
@@ -40,6 +40,73 @@
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
/* DOWNLOAD BUTTONS - NEW STYLES */
|
||||
.cm-download-pdf {
|
||||
background: linear-gradient(100deg, #4c6fff 0%, #8e54e9 100%) !important;
|
||||
color: #fff !important;
|
||||
border: none !important;
|
||||
font-weight: 600 !important;
|
||||
font-size: 12.5px !important;
|
||||
padding: 8px 16px !important;
|
||||
border-radius: 8px !important;
|
||||
box-shadow: 0 4px 14px rgba(76,111,255,0.4) !important;
|
||||
transition: all 0.2s ease !important;
|
||||
text-decoration: none !important;
|
||||
display: inline-flex !important;
|
||||
align-items: center !important;
|
||||
gap: 6px !important;
|
||||
}
|
||||
.cm-download-pdf:hover {
|
||||
transform: translateY(-1px) !important;
|
||||
box-shadow: 0 6px 20px rgba(76,111,255,0.5) !important;
|
||||
color: #fff !important;
|
||||
opacity: 0.95 !important;
|
||||
}
|
||||
|
||||
.cm-download-excel {
|
||||
background: linear-gradient(100deg, #10b981 0%, #059669 100%) !important;
|
||||
color: #fff !important;
|
||||
border: none !important;
|
||||
font-weight: 600 !important;
|
||||
font-size: 12.5px !important;
|
||||
padding: 8px 16px !important;
|
||||
border-radius: 8px !important;
|
||||
box-shadow: 0 4px 14px rgba(16,185,129,0.4) !important;
|
||||
transition: all 0.2s ease !important;
|
||||
text-decoration: none !important;
|
||||
display: inline-flex !important;
|
||||
align-items: center !important;
|
||||
gap: 6px !important;
|
||||
}
|
||||
.cm-download-excel:hover {
|
||||
transform: translateY(-1px) !important;
|
||||
box-shadow: 0 6px 20px rgba(16,185,129,0.5) !important;
|
||||
color: #fff !important;
|
||||
opacity: 0.95 !important;
|
||||
}
|
||||
|
||||
.cm-back-btn {
|
||||
background: linear-gradient(100deg, #6b7280 0%, #4b5563 100%) !important;
|
||||
color: #fff !important;
|
||||
border: none !important;
|
||||
font-weight: 600 !important;
|
||||
font-size: 12.5px !important;
|
||||
padding: 8px 16px !important;
|
||||
border-radius: 8px !important;
|
||||
box-shadow: 0 4px 14px rgba(107,114,128,0.4) !important;
|
||||
transition: all 0.2s ease !important;
|
||||
text-decoration: none !important;
|
||||
display: inline-flex !important;
|
||||
align-items: center !important;
|
||||
gap: 6px !important;
|
||||
}
|
||||
.cm-back-btn:hover {
|
||||
transform: translateY(-1px) !important;
|
||||
box-shadow: 0 6px 20px rgba(107,114,128,0.5) !important;
|
||||
color: #fff !important;
|
||||
opacity: 0.95 !important;
|
||||
}
|
||||
|
||||
.cm-main-card {
|
||||
border-radius: 14px;
|
||||
border: none;
|
||||
@@ -65,7 +132,7 @@
|
||||
|
||||
.cm-info-cards-row {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr)); /* 3 cards one row */
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 14px;
|
||||
padding: 14px 18px 8px 18px;
|
||||
}
|
||||
@@ -132,7 +199,6 @@
|
||||
color: #fff7ed;
|
||||
}
|
||||
|
||||
/* TOTAL BOXES */
|
||||
.cm-total-cards-row {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
@@ -421,6 +487,11 @@
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
.cm-table-scroll-outer {
|
||||
margin: 10px 14px 30px 14px; /* फक्त हे बदल करा */
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="container-fluid cm-wrapper">
|
||||
@@ -433,27 +504,30 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex gap-2">
|
||||
<a href="{{ route('containers.index') }}" class="btn btn-light btn-sm">Back to list</a>
|
||||
<a href="{{ route('containers.index') }}" class="cm-back-btn">
|
||||
<i class="bi bi-arrow-left"></i>
|
||||
Back to list
|
||||
</a>
|
||||
|
||||
<a href="{{ route('containers.download.pdf', $container->id) }}"
|
||||
class="btn btn-sm btn-outline-primary">
|
||||
<a href="{{ route('containers.download.pdf', $container->id) }}" class="cm-download-pdf">
|
||||
<i class="bi bi-file-earmark-pdf"></i>
|
||||
Download PDF
|
||||
</a>
|
||||
|
||||
<a href="{{ route('containers.download.excel', $container->id) }}"
|
||||
class="btn btn-sm btn-outline-success">
|
||||
<a href="{{ route('containers.download.excel', $container->id) }}" class="cm-download-excel">
|
||||
<i class="bi bi-file-earmark-excel"></i>
|
||||
Download Excel
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- बाकीचा सगळा code same आहे - काही बदल नाही -->
|
||||
<div class="card cm-main-card">
|
||||
<div class="card-header">
|
||||
<h5>Container Information</h5>
|
||||
</div>
|
||||
|
||||
{{-- 3 INFO CARDS IN SINGLE ROW --}}
|
||||
<div class="cm-info-cards-row">
|
||||
<div class="cm-info-card cm-card-container">
|
||||
<div class="cm-info-card-icon">
|
||||
@@ -608,7 +682,7 @@
|
||||
|
||||
<div class="cm-filter-bar">
|
||||
<span class="cm-row-count">
|
||||
Total rows: {{ $container->rows->count() }} Edit cells then click "Save Changes".
|
||||
Total rows: {{ $container->rows->count() }} Edit cells then click "Save Changes".
|
||||
</span>
|
||||
<input type="text" id="cmRowSearch" class="cm-filter-input"
|
||||
placeholder="Quick search..." onkeyup="cmFilterRows()">
|
||||
@@ -666,21 +740,16 @@
|
||||
$isPrice = (str_contains($norm, 'PRICE') || str_contains($norm, 'RATE'));
|
||||
|
||||
$isAmount = (
|
||||
str_contains($norm, 'AMOUNT') ||
|
||||
str_contains($norm, 'AMOUNT') ||
|
||||
str_contains($norm, 'TTLAMOUNT') ||
|
||||
str_contains($norm, 'TOTALAMOUNT')
|
||||
);
|
||||
|
||||
$isTotalColumn = $isTotalQty || $isTotalCbm || $isTotalKg || $isAmount;
|
||||
// row index = headerRowIndex + 1 + offset — ContainerRow मध्ये row_index save आहे
|
||||
$isLockedByInvoice = in_array($row->row_index, $lockedRowIndexes ?? []);
|
||||
$isReadOnly = $isTotalColumn || $container->status !== 'pending' || $isLockedByInvoice;
|
||||
@endphp
|
||||
$isLockedByInvoice = in_array($row->row_index, $lockedRowIndexes ?? []);
|
||||
$isReadOnly = $isTotalColumn || $container->status !== 'pending' || $isLockedByInvoice;
|
||||
@endphp
|
||||
|
||||
@if($loop->first && $isLockedByInvoice)
|
||||
{{-- पहिल्या cell मध्ये lock icon --}}
|
||||
@endif
|
||||
|
||||
<td>
|
||||
<input
|
||||
type="text"
|
||||
@@ -702,7 +771,6 @@
|
||||
>
|
||||
</td>
|
||||
@endforeach
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@@ -724,6 +792,8 @@
|
||||
</button>
|
||||
@endif
|
||||
|
||||
<!-- Toast notification missing होती, add केली -->
|
||||
<div id="cmToast" class="cm-toast"></div>
|
||||
|
||||
<script>
|
||||
function cmFilterRows() {
|
||||
@@ -854,7 +924,6 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
const target = e.target;
|
||||
if (!target.classList.contains('cm-cell-input')) return;
|
||||
|
||||
// readonly / non-pending cells साठी block
|
||||
if (target.classList.contains('cm-cell-readonly') || target.hasAttribute('readonly')) {
|
||||
target.blur();
|
||||
return;
|
||||
@@ -869,7 +938,6 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
if (form && btn) {
|
||||
btn.addEventListener('click', function () {
|
||||
// जर बटण आधीच disabled असेल (non-pending status किंवा processing)
|
||||
if (btn.classList.contains('cm-disabled') || btn.hasAttribute('disabled')) {
|
||||
return;
|
||||
}
|
||||
@@ -885,22 +953,22 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
},
|
||||
body: formData
|
||||
})
|
||||
.then(async res => {
|
||||
if (!res.ok) {
|
||||
const text = await res.text();
|
||||
throw new Error(text || 'Failed to save');
|
||||
}
|
||||
return res.json().catch(() => ({}));
|
||||
})
|
||||
.then(() => {
|
||||
showToast('Changes saved successfully.');
|
||||
})
|
||||
.catch(() => {
|
||||
showToast('Error while saving changes.', true);
|
||||
})
|
||||
.finally(() => {
|
||||
btn.classList.remove('cm-disabled');
|
||||
});
|
||||
.then(async res => {
|
||||
if (!res.ok) {
|
||||
const text = await res.text();
|
||||
throw new Error(text || 'Failed to save');
|
||||
}
|
||||
return res.json().catch(() => ({}));
|
||||
})
|
||||
.then(() => {
|
||||
showToast('Changes saved successfully.');
|
||||
})
|
||||
.catch(() => {
|
||||
showToast('Error while saving changes.', true);
|
||||
})
|
||||
.finally(() => {
|
||||
btn.classList.remove('cm-disabled');
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user