Upload folder using huggingface_hub
Browse files- index.html +22 -1
index.html
CHANGED
|
@@ -571,6 +571,7 @@
|
|
| 571 |
let doctorReviews = JSON.parse(localStorage.getItem('tb_reviews') || '{}');
|
| 572 |
|
| 573 |
document.addEventListener('DOMContentLoaded', async () => {
|
|
|
|
| 574 |
updateDoctorHeader();
|
| 575 |
await loadData();
|
| 576 |
switchView('validation');
|
|
@@ -622,15 +623,35 @@
|
|
| 622 |
function openDocModal() { document.getElementById('docModal').classList.remove('hidden'); }
|
| 623 |
function closeDocModal() { document.getElementById('docModal').classList.add('hidden'); }
|
| 624 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 625 |
function saveDoctorProfile() {
|
|
|
|
| 626 |
currentDoctor.name = document.getElementById('modalDocName').value.trim() || 'Dr. S. K. Sharma, MD';
|
| 627 |
currentDoctor.institution = document.getElementById('modalDocInst').value.trim();
|
| 628 |
currentDoctor.reg_no = document.getElementById('modalDocReg').value.trim();
|
| 629 |
localStorage.setItem('tb_doc_name', currentDoctor.name);
|
| 630 |
localStorage.setItem('tb_doc_inst', currentDoctor.institution);
|
| 631 |
localStorage.setItem('tb_doc_reg', currentDoctor.reg_no);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 632 |
updateDoctorHeader();
|
| 633 |
closeDocModal();
|
|
|
|
|
|
|
| 634 |
updateStats();
|
| 635 |
}
|
| 636 |
|
|
@@ -788,7 +809,7 @@
|
|
| 788 |
reviewed_at: new Date().toISOString()
|
| 789 |
};
|
| 790 |
doctorReviews[c.case_number] = newRev;
|
| 791 |
-
localStorage.setItem(
|
| 792 |
updateStats();
|
| 793 |
renderList();
|
| 794 |
|
|
|
|
| 571 |
let doctorReviews = JSON.parse(localStorage.getItem('tb_reviews') || '{}');
|
| 572 |
|
| 573 |
document.addEventListener('DOMContentLoaded', async () => {
|
| 574 |
+
loadDoctorReviews();
|
| 575 |
updateDoctorHeader();
|
| 576 |
await loadData();
|
| 577 |
switchView('validation');
|
|
|
|
| 623 |
function openDocModal() { document.getElementById('docModal').classList.remove('hidden'); }
|
| 624 |
function closeDocModal() { document.getElementById('docModal').classList.add('hidden'); }
|
| 625 |
|
| 626 |
+
function getDoctorReviewsKey() {
|
| 627 |
+
const slug = (currentDoctor.name || 'default').toLowerCase().replace(/[^a-z0-9]/g, '_');
|
| 628 |
+
return `tb_reviews_${slug}`;
|
| 629 |
+
}
|
| 630 |
+
|
| 631 |
+
let doctorReviews = {};
|
| 632 |
+
|
| 633 |
+
function loadDoctorReviews() {
|
| 634 |
+
const key = getDoctorReviewsKey();
|
| 635 |
+
doctorReviews = JSON.parse(localStorage.getItem(key) || '{}');
|
| 636 |
+
}
|
| 637 |
+
|
| 638 |
function saveDoctorProfile() {
|
| 639 |
+
const oldName = currentDoctor.name;
|
| 640 |
currentDoctor.name = document.getElementById('modalDocName').value.trim() || 'Dr. S. K. Sharma, MD';
|
| 641 |
currentDoctor.institution = document.getElementById('modalDocInst').value.trim();
|
| 642 |
currentDoctor.reg_no = document.getElementById('modalDocReg').value.trim();
|
| 643 |
localStorage.setItem('tb_doc_name', currentDoctor.name);
|
| 644 |
localStorage.setItem('tb_doc_inst', currentDoctor.institution);
|
| 645 |
localStorage.setItem('tb_doc_reg', currentDoctor.reg_no);
|
| 646 |
+
|
| 647 |
+
// Load reviews specific to this newly selected doctor
|
| 648 |
+
loadDoctorReviews();
|
| 649 |
+
currentIdx = 0;
|
| 650 |
+
|
| 651 |
updateDoctorHeader();
|
| 652 |
closeDocModal();
|
| 653 |
+
renderList();
|
| 654 |
+
if (filteredCases.length > 0) selectCase(0);
|
| 655 |
updateStats();
|
| 656 |
}
|
| 657 |
|
|
|
|
| 809 |
reviewed_at: new Date().toISOString()
|
| 810 |
};
|
| 811 |
doctorReviews[c.case_number] = newRev;
|
| 812 |
+
localStorage.setItem(getDoctorReviewsKey(), JSON.stringify(doctorReviews));
|
| 813 |
updateStats();
|
| 814 |
renderList();
|
| 815 |
|