Update index.html
Browse files- index.html +41 -10
index.html
CHANGED
|
@@ -269,6 +269,9 @@
|
|
| 269 |
const activeTimeSlotObj = getCurrentActiveSlot(selectedClass, currentHour, currentMin);
|
| 270 |
const activeTimeSlotId = activeTimeSlotObj ? activeTimeSlotObj.id : null;
|
| 271 |
|
|
|
|
|
|
|
|
|
|
| 272 |
const missedPeriods = currentTimeSlots.filter(slot => {
|
| 273 |
if (slot.id === 'R') return false;
|
| 274 |
const hasEnded = currentHour > slot.endHour || (currentHour === slot.endHour && currentMin >= slot.endMin);
|
|
@@ -856,19 +859,47 @@
|
|
| 856 |
)}
|
| 857 |
</div>
|
| 858 |
|
| 859 |
-
<div className=
|
| 860 |
-
<div className=
|
| 861 |
<Clock className="w-3.5 h-3.5"/> Log Belum Diisi
|
| 862 |
-
|
| 863 |
-
|
| 864 |
-
{missedPeriods.length > 0 ? missedPeriods.map(p => (
|
| 865 |
-
<span key={p.id} className="px-2 py-0.5 bg-white border border-rose-200 rounded text-rose-600 text-[10px] font-bold">
|
| 866 |
-
Waktu {p.label}
|
| 867 |
-
</span>
|
| 868 |
-
)) : (
|
| 869 |
-
<span className="text-[10px] text-emerald-600 font-bold bg-emerald-100 px-2 py-0.5 rounded">Semua log lengkap</span>
|
| 870 |
)}
|
| 871 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 872 |
</div>
|
| 873 |
</div>
|
| 874 |
</div>
|
|
|
|
| 269 |
const activeTimeSlotObj = getCurrentActiveSlot(selectedClass, currentHour, currentMin);
|
| 270 |
const activeTimeSlotId = activeTimeSlotObj ? activeTimeSlotObj.id : null;
|
| 271 |
|
| 272 |
+
const lastSlot = currentTimeSlots[currentTimeSlots.length - 1];
|
| 273 |
+
const isAfterSchool = currentHour > lastSlot.endHour || (currentHour === lastSlot.endHour && currentMin >= lastSlot.endMin);
|
| 274 |
+
|
| 275 |
const missedPeriods = currentTimeSlots.filter(slot => {
|
| 276 |
if (slot.id === 'R') return false;
|
| 277 |
const hasEnded = currentHour > slot.endHour || (currentHour === slot.endHour && currentMin >= slot.endMin);
|
|
|
|
| 859 |
)}
|
| 860 |
</div>
|
| 861 |
|
| 862 |
+
<div className={`p-4 rounded-xl border shadow-sm sm:col-span-2 md:col-span-1 ${missedPeriods.length > 0 ? 'bg-rose-50 border-rose-200' : 'bg-emerald-50 border-emerald-200'}`}>
|
| 863 |
+
<div className={`text-xs font-bold mb-2 flex items-center gap-1 ${missedPeriods.length > 0 ? 'text-rose-700' : 'text-emerald-700'}`}>
|
| 864 |
<Clock className="w-3.5 h-3.5"/> Log Belum Diisi
|
| 865 |
+
{missedPeriods.length > 0 && (
|
| 866 |
+
<span className="ml-auto bg-rose-600 text-white text-[10px] px-1.5 py-0.5 rounded-full font-black">{missedPeriods.length}</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 867 |
)}
|
| 868 |
</div>
|
| 869 |
+
{missedPeriods.length === 0 ? (
|
| 870 |
+
<span className="text-[10px] text-emerald-600 font-bold bg-emerald-100 px-2 py-0.5 rounded">Semua log lengkap ✓</span>
|
| 871 |
+
) : isAfterSchool && missedPeriods.length > 6 ? (
|
| 872 |
+
<div className="space-y-2">
|
| 873 |
+
<p className="text-[11px] text-rose-600 font-medium">
|
| 874 |
+
{missedPeriods.length} waktu belum dilog hari ini
|
| 875 |
+
</p>
|
| 876 |
+
<div className="flex flex-wrap gap-1">
|
| 877 |
+
{missedPeriods.map(p => (
|
| 878 |
+
<button
|
| 879 |
+
key={p.id}
|
| 880 |
+
onClick={() => openTeacherModal(p)}
|
| 881 |
+
className="px-2 py-0.5 bg-white border border-rose-200 rounded text-rose-600 text-[10px] font-bold hover:bg-rose-100 hover:border-rose-400 transition-colors cursor-pointer"
|
| 882 |
+
title="Klik untuk set guru"
|
| 883 |
+
>
|
| 884 |
+
{p.label}
|
| 885 |
+
</button>
|
| 886 |
+
))}
|
| 887 |
+
</div>
|
| 888 |
+
</div>
|
| 889 |
+
) : (
|
| 890 |
+
<div className="flex flex-wrap gap-1.5">
|
| 891 |
+
{missedPeriods.map(p => (
|
| 892 |
+
<button
|
| 893 |
+
key={p.id}
|
| 894 |
+
onClick={() => openTeacherModal(p)}
|
| 895 |
+
className="px-2 py-0.5 bg-white border border-rose-200 rounded text-rose-600 text-[10px] font-bold hover:bg-rose-100 hover:border-rose-400 transition-colors cursor-pointer"
|
| 896 |
+
title="Klik untuk set guru"
|
| 897 |
+
>
|
| 898 |
+
Waktu {p.label}
|
| 899 |
+
</button>
|
| 900 |
+
))}
|
| 901 |
+
</div>
|
| 902 |
+
)}
|
| 903 |
</div>
|
| 904 |
</div>
|
| 905 |
</div>
|