update disblay

This commit is contained in:
Flatlogic Bot 2026-03-23 09:51:49 +00:00
parent 9667cec7e6
commit 5eaa8cc290

View File

@ -25,11 +25,16 @@ try {
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap" rel="stylesheet">
<style> <style>
html, body {
height: 100%;
margin: 0;
overflow: hidden; /* Hide scrollbars for TV feel */
}
body { body {
background-color: #f0f2f5; background-color: #f0f2f5;
font-family: 'Tajawal', sans-serif; font-family: 'Tajawal', sans-serif;
overflow: hidden; /* Hide scrollbars for TV feel */ display: flex;
padding-bottom: 60px; /* Space for marquee */ flex-direction: column;
} }
.header { .header {
background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
@ -39,6 +44,8 @@ try {
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
box-shadow: 0 4px 6px rgba(0,0,0,0.1); box-shadow: 0 4px 6px rgba(0,0,0,0.1);
flex-shrink: 0;
height: 80px;
} }
.header h1 { .header h1 {
margin: 0; margin: 0;
@ -47,6 +54,29 @@ try {
align-items: center; align-items: center;
gap: 10px; gap: 10px;
} }
.main-content {
flex-grow: 1;
padding: 20px;
overflow: hidden; /* Container handles overflow */
display: flex;
flex-direction: column;
}
#departmentsContainer {
display: flex;
flex-wrap: wrap;
gap: 15px;
height: 100%;
justify-content: center;
align-content: center; /* Center content vertically if space permits */
overflow-y: auto;
}
.dept-wrapper {
flex: 1 1 300px; /* Grow, shrink, base width */
max-width: 450px;
min-width: 250px;
display: flex;
flex-direction: column;
}
.dept-card { .dept-card {
background: white; background: white;
border-radius: 15px; border-radius: 15px;
@ -60,7 +90,7 @@ try {
.dept-header { .dept-header {
background: #f8f9fa; background: #f8f9fa;
padding: 15px; padding: 15px;
font-size: 1.3rem; /* Slightly smaller to fit two lines */ font-size: 1.3rem;
font-weight: bold; font-weight: bold;
text-align: center; text-align: center;
border-bottom: 2px solid #e9ecef; border-bottom: 2px solid #e9ecef;
@ -68,27 +98,28 @@ try {
line-height: 1.3; line-height: 1.3;
} }
.serving-section { .serving-section {
padding: 15px; padding: 10px;
text-align: center; text-align: center;
flex-grow: 1; flex-grow: 1;
background: #e3f2fd; background: #e3f2fd;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; /* Center vertically */ justify-content: center;
} }
.serving-label { .serving-label {
font-size: 1.1rem; font-size: 1.0rem;
color: #1976d2; color: #1976d2;
margin-bottom: 10px; margin-bottom: 5px;
text-transform: uppercase; text-transform: uppercase;
font-weight: 600; font-weight: 600;
} }
.serving-list { .serving-list {
display: grid; display: flex;
grid-template-columns: 1fr 1fr; flex-direction: column;
gap: 10px; gap: 8px;
width: 100%; width: 100%;
align-items: center; /* Center items vertically in grid */ align-items: center;
justify-content: center;
} }
.serving-item { .serving-item {
background: rgba(255, 255, 255, 0.6); background: rgba(255, 255, 255, 0.6);
@ -98,25 +129,27 @@ try {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
min-height: 100px; width: 100%;
} }
.serving-number { .serving-number {
font-size: 3.5rem; /* Adjusted for grid */ font-size: 3rem;
font-weight: 800; font-weight: 800;
color: #0d47a1; color: #0d47a1;
line-height: 1; line-height: 1;
animation: pulse 2s infinite; animation: pulse 2s infinite;
} }
.waiting-section { .waiting-section {
padding: 15px; padding: 10px;
background: #fff; background: #fff;
border-top: 1px dashed #dee2e6; border-top: 1px dashed #dee2e6;
min-height: 60px;
} }
.waiting-label { .waiting-label {
font-size: 0.9rem; font-size: 0.9rem;
color: #6c757d; color: #6c757d;
margin-bottom: 5px; margin-bottom: 5px;
font-weight: bold; font-weight: bold;
text-align: center;
} }
.waiting-list { .waiting-list {
display: flex; display: flex;
@ -149,9 +182,6 @@ try {
} }
/* Marquee Footer Styles */ /* Marquee Footer Styles */
.footer-marquee { .footer-marquee {
position: fixed;
bottom: 0;
left: 0;
width: 100%; width: 100%;
background: #002D62; background: #002D62;
color: white; color: white;
@ -162,6 +192,8 @@ try {
z-index: 1000; z-index: 1000;
box-shadow: 0 -2px 5px rgba(0,0,0,0.2); box-shadow: 0 -2px 5px rgba(0,0,0,0.2);
border-top: 3px solid #fbbc04; /* Accent color */ border-top: 3px solid #fbbc04; /* Accent color */
flex-shrink: 0;
height: 60px;
} }
.marquee-content { .marquee-content {
display: inline-block; display: inline-block;
@ -186,8 +218,8 @@ try {
</div> </div>
</div> </div>
<div class="container-fluid p-4"> <div class="main-content">
<div class="row g-4" id="departmentsContainer"> <div id="departmentsContainer">
<!-- Javascript will inject cards here --> <!-- Javascript will inject cards here -->
</div> </div>
</div> </div>
@ -326,7 +358,6 @@ try {
// Augment item with doctor names from API if available // Augment item with doctor names from API if available
item.doctor_name_en = item.doctor_name_en || item.doctor_name; // Fallback item.doctor_name_en = item.doctor_name_en || item.doctor_name; // Fallback
item.doctor_name_ar = item.doctor_name_ar || item.doctor_name; // Fallback
if (item.status === 'serving') { if (item.status === 'serving') {
depts[item.department_id].serving.push(item); depts[item.department_id].serving.push(item);
@ -340,27 +371,34 @@ try {
Object.values(depts).forEach(dept => { Object.values(depts).forEach(dept => {
let servingHtml = '<div class="text-muted small text-center w-100" style="grid-column: span 2;">No active patient<br>لا يوجد مريض</div>'; let servingHtml = '<div class="text-muted small text-center w-100">No active patient<br>لا يوجد مريض</div>';
if (dept.serving.length > 0) { if (dept.serving.length > 0) {
servingHtml = dept.serving.map(s => { servingHtml = dept.serving.map(s => {
let docName = ''; let docName = '';
if (s.doctor_name_en && s.doctor_name_ar) { // Doctor Name: Prefix with Dr. and show only English name
docName = `${s.doctor_name_en}<br>${s.doctor_name_ar}`; if (s.doctor_name_en) {
} else { docName = `Dr. ${s.doctor_name_en}`;
docName = s.doctor_name || ''; } else if (s.doctor_name) {
docName = `Dr. ${s.doctor_name}`;
}
// Wrap doctor name in a colored badge (e.g., bg-info)
let docInfo = '';
if (docName) {
docInfo = `<div class="mb-1 fw-bold badge bg-info text-white" style="font-size:0.9rem;">${docName}</div>`;
} }
let roomInfo = ''; let roomInfo = '';
if (s.room_number) { if (s.room_number) {
roomInfo = `<div class="mt-1 fw-bold text-dark badge bg-warning text-dark" style="font-size:0.85rem;">Room/غرفة: ${s.room_number}</div>`; roomInfo = `<div class="fw-bold badge bg-warning text-dark" style="font-size:0.9rem;">Room/غرفة: ${s.room_number}</div>`;
} }
return ` return `
<div class="serving-item"> <div class="serving-item">
<div class="serving-number">${s.token_number}</div> <div class="serving-number">${s.token_number}</div>
<div class="small text-muted text-center mt-1" style="line-height:1.2; font-size:0.85rem;"> <div class="small text-center mt-2 d-flex flex-column align-items-center">
${docName} ${docInfo}
${roomInfo} ${roomInfo}
</div> </div>
</div>`; </div>`;
@ -373,7 +411,7 @@ try {
} }
const card = ` const card = `
<div class="col-md-4 col-lg-3"> <div class="dept-wrapper">
<div class="dept-card"> <div class="dept-card">
<div class="dept-header"> <div class="dept-header">
${dept.name_en} ${dept.name_en}