feat: improve visits filter UX and update currency label

This commit is contained in:
SajjadMahmoody
2026-04-18 22:47:23 +03:30
parent 4abd856bf9
commit 1e8ec1f76f
13 changed files with 296 additions and 68 deletions
+35 -20
View File
@@ -64,6 +64,16 @@
.toolbar-divider { flex: 1; }
.print-info-tooltip { position:relative;display:inline-flex;align-items:center; }
.print-info-tooltip .tip-icon { display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;background:#374151;border-radius:8px;cursor:pointer;color:#9ca3af;border:none;transition:background 0.15s,color 0.15s; }
.print-info-tooltip .tip-icon:hover { background:#4b5563;color:#fff; }
.print-info-tooltip .tip-box { display:none;position:absolute;top:calc(100% + 10px);left:50%;transform:translateX(-50%);background:#111827;border:1px solid #374151;border-radius:10px;padding:14px 18px;min-width:250px;box-shadow:0 4px 24px rgba(0,0,0,0.5);z-index:200;direction:rtl; }
.print-info-tooltip .tip-box.open { display:block; }
.print-info-tooltip .tip-box::after { content:'';position:absolute;bottom:100%;left:50%;transform:translateX(-50%);border:6px solid transparent;border-bottom-color:#374151; }
.print-info-tooltip .tip-box h4 { margin:0 0 10px;font-size:12px;color:#9ca3af;border-bottom:1px solid #374151;padding-bottom:8px;font-weight:normal; }
.print-info-tooltip .tip-box ul { list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px; }
.print-info-tooltip .tip-box ul li { font-size:12px;color:#e5e7eb; }
.edit-modal-overlay {
display: none;
position: fixed;
@@ -338,15 +348,26 @@
<div class="toolbar-divider"></div>
@if ($type === 'both')
<button class="toolbar-btn btn-print" onclick="printSection('prescription')">🖨 پرینت نسخه</button>
<button class="toolbar-btn btn-lab" onclick="printSection('lab')">🖨 پرینت آزمایش</button>
<button class="toolbar-btn btn-edit" onclick="openEditModal()"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="width:14px;height:14px;flex-shrink:0;"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg> ویرایش نسخه</button>
@else
@if ($type !== 'both')
<button class="toolbar-btn btn-print" onclick="window.print()">🖨 پرینت</button>
<button class="toolbar-btn btn-edit" onclick="openEditModal()"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="width:14px;height:14px;flex-shrink:0;"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg> ویرایش نسخه</button>
@endif
<div class="print-info-tooltip">
<button class="tip-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="width:16px;height:16px;"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>
</button>
<div class="tip-box">
<h4>تنظیمات پرینت</h4>
<ul>
<li>✅ Paper size: A5</li>
<li>✅ Orientation: Landscape (افقی)</li>
<li>✅ Margins: None (بدون حاشیه)</li>
<li>✅ Scale: 100%</li>
<li>✅ Background graphics: ON (فعال)</li>
</ul>
</div>
</div>
<a class="toolbar-btn btn-back"
href="{{ route('filament.admin.resources.prescriptions.index') }}">
← بازگشت به لیست
@@ -539,21 +560,6 @@ function printSection(section) {
window.print();
document.body.classList.remove('printing-prescription', 'printing-lab');
}
@else
window.onload = function () {
const userConfirmed = confirm(
'لطفاً تنظیمات پرینت را به این صورت انجام دهید:\n\n' +
'✅ Paper size: A5\n' +
'✅ Orientation: Landscape (افقی)\n' +
'✅ Margins: None (بدون حاشیه)\n' +
'✅ Scale: 100%\n' +
'✅ Background graphics: ON (فعال)\n\n' +
'آیا آماده پرینت هستید؟'
);
if (userConfirmed) {
window.print();
}
};
@endif
const overlay = document.getElementById('editModalOverlay');
@@ -586,6 +592,15 @@ function closeEditModal() {
});
document.addEventListener('keydown', e => { if (e.key === 'Escape') closeEditModal(); });
document.querySelector('.print-info-tooltip .tip-icon').addEventListener('click', function(e) {
e.stopPropagation();
document.querySelector('.print-info-tooltip .tip-box').classList.toggle('open');
});
document.addEventListener('click', function() {
document.querySelector('.print-info-tooltip .tip-box').classList.remove('open');
});
</script>
</body>
</html>