Spaces:
Running
Running
kindly refresh the app its not function properly leave history report logout all tab are disable not working - Follow Up Deployment
Browse files- index.html +87 -28
index.html
CHANGED
|
@@ -533,19 +533,75 @@
|
|
| 533 |
|
| 534 |
// Navigation functionality
|
| 535 |
const navLinks = {
|
| 536 |
-
dashboardLink:
|
| 537 |
-
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 542 |
};
|
| 543 |
|
| 544 |
// Add click handler for pending requests link
|
| 545 |
document.querySelector('a[href="#pending"]').addEventListener('click', function(e) {
|
| 546 |
e.preventDefault();
|
| 547 |
-
|
| 548 |
-
document.querySelector('main').innerHTML = `
|
| 549 |
<div class="p-6">
|
| 550 |
<h2 class="text-lg font-semibold text-gray-800 mb-4">Pending Leave Requests</h2>
|
| 551 |
<div class="bg-white rounded-lg shadow overflow-hidden">
|
|
@@ -618,34 +674,37 @@
|
|
| 618 |
`;
|
| 619 |
});
|
| 620 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 621 |
Object.keys(navLinks).forEach(linkId => {
|
| 622 |
document.getElementById(linkId).addEventListener('click', function(e) {
|
| 623 |
e.preventDefault();
|
| 624 |
-
|
| 625 |
|
| 626 |
-
|
| 627 |
-
|
| 628 |
-
document.querySelector('
|
| 629 |
-
|
| 630 |
-
|
| 631 |
-
<h2 class="text-2xl font-semibold text-gray-700">${navLinks[linkId]}</h2>
|
| 632 |
-
<p class="text-gray-500 mt-2">${navLinks[linkId]} content would be displayed here</p>
|
| 633 |
-
</div>
|
| 634 |
-
`;
|
| 635 |
}
|
| 636 |
});
|
| 637 |
});
|
| 638 |
|
| 639 |
-
|
| 640 |
-
|
| 641 |
-
dashboardLink: 'fa-home',
|
| 642 |
-
requestLeaveLink: 'fa-calendar-plus',
|
| 643 |
-
leaveHistoryLink: 'fa-history',
|
| 644 |
-
reportsLink: 'fa-chart-pie',
|
| 645 |
-
settingsLink: 'fa-cog'
|
| 646 |
-
};
|
| 647 |
-
return icons[linkId] || 'fa-info-circle';
|
| 648 |
-
}
|
| 649 |
|
| 650 |
// Modal functionality
|
| 651 |
const modal = document.getElementById('leaveRequestModal');
|
|
|
|
| 533 |
|
| 534 |
// Navigation functionality
|
| 535 |
const navLinks = {
|
| 536 |
+
dashboardLink: {
|
| 537 |
+
title: 'Dashboard',
|
| 538 |
+
icon: 'fa-home',
|
| 539 |
+
content: `
|
| 540 |
+
<!-- Original dashboard content would go here -->
|
| 541 |
+
<div class="p-6">
|
| 542 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-6">
|
| 543 |
+
<!-- Leave balance cards -->
|
| 544 |
+
</div>
|
| 545 |
+
<!-- Other dashboard sections -->
|
| 546 |
+
</div>
|
| 547 |
+
`
|
| 548 |
+
},
|
| 549 |
+
requestLeaveLink: {
|
| 550 |
+
title: 'Request Leave',
|
| 551 |
+
icon: 'fa-calendar-plus'
|
| 552 |
+
},
|
| 553 |
+
leaveHistoryLink: {
|
| 554 |
+
title: 'Leave History',
|
| 555 |
+
icon: 'fa-history',
|
| 556 |
+
content: `
|
| 557 |
+
<div class="p-6">
|
| 558 |
+
<h2 class="text-lg font-semibold text-gray-800 mb-4">Leave History</h2>
|
| 559 |
+
<div class="bg-white rounded-lg shadow overflow-hidden">
|
| 560 |
+
<table class="min-w-full divide-y divide-gray-200">
|
| 561 |
+
<thead class="bg-gray-50">
|
| 562 |
+
<tr>
|
| 563 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Type</th>
|
| 564 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Dates</th>
|
| 565 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
|
| 566 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
|
| 567 |
+
</tr>
|
| 568 |
+
</thead>
|
| 569 |
+
<tbody class="bg-white divide-y divide-gray-200">
|
| 570 |
+
<!-- Sample leave history rows -->
|
| 571 |
+
</tbody>
|
| 572 |
+
</table>
|
| 573 |
+
</div>
|
| 574 |
+
</div>
|
| 575 |
+
`
|
| 576 |
+
},
|
| 577 |
+
reportsLink: {
|
| 578 |
+
title: 'Reports',
|
| 579 |
+
icon: 'fa-chart-pie',
|
| 580 |
+
content: `
|
| 581 |
+
<div class="p-6">
|
| 582 |
+
<h2 class="text-lg font-semibold text-gray-800 mb-4">Reports</h2>
|
| 583 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
| 584 |
+
<!-- Report cards would go here -->
|
| 585 |
+
</div>
|
| 586 |
+
</div>
|
| 587 |
+
`
|
| 588 |
+
},
|
| 589 |
+
settingsLink: {
|
| 590 |
+
title: 'Settings',
|
| 591 |
+
icon: 'fa-cog',
|
| 592 |
+
content: `
|
| 593 |
+
<div class="p-6">
|
| 594 |
+
<h2 class="text-lg font-semibold text-gray-800 mb-4">Settings</h2>
|
| 595 |
+
<!-- Settings form would go here -->
|
| 596 |
+
</div>
|
| 597 |
+
`
|
| 598 |
+
}
|
| 599 |
};
|
| 600 |
|
| 601 |
// Add click handler for pending requests link
|
| 602 |
document.querySelector('a[href="#pending"]').addEventListener('click', function(e) {
|
| 603 |
e.preventDefault();
|
| 604 |
+
showContent('Pending Requests', `
|
|
|
|
| 605 |
<div class="p-6">
|
| 606 |
<h2 class="text-lg font-semibold text-gray-800 mb-4">Pending Leave Requests</h2>
|
| 607 |
<div class="bg-white rounded-lg shadow overflow-hidden">
|
|
|
|
| 674 |
`;
|
| 675 |
});
|
| 676 |
|
| 677 |
+
// Handle logout
|
| 678 |
+
document.querySelector('a[href="#"]').addEventListener('click', function(e) {
|
| 679 |
+
e.preventDefault();
|
| 680 |
+
if (confirm('Are you sure you want to logout?')) {
|
| 681 |
+
alert('Logging out...'); // In real app, would redirect to logout
|
| 682 |
+
}
|
| 683 |
+
});
|
| 684 |
+
|
| 685 |
+
// Function to show content
|
| 686 |
+
function showContent(title, content) {
|
| 687 |
+
document.querySelector('h1').textContent = title;
|
| 688 |
+
document.querySelector('main').innerHTML = content;
|
| 689 |
+
}
|
| 690 |
+
|
| 691 |
+
// Set up navigation
|
| 692 |
Object.keys(navLinks).forEach(linkId => {
|
| 693 |
document.getElementById(linkId).addEventListener('click', function(e) {
|
| 694 |
e.preventDefault();
|
| 695 |
+
const link = navLinks[linkId];
|
| 696 |
|
| 697 |
+
if (linkId === 'requestLeaveLink') {
|
| 698 |
+
modal.classList.remove('hidden');
|
| 699 |
+
document.querySelector('h1').textContent = link.title;
|
| 700 |
+
} else {
|
| 701 |
+
showContent(link.title, link.content);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 702 |
}
|
| 703 |
});
|
| 704 |
});
|
| 705 |
|
| 706 |
+
// Initialize with dashboard content
|
| 707 |
+
showContent('Dashboard', navLinks.dashboardLink.content);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 708 |
|
| 709 |
// Modal functionality
|
| 710 |
const modal = document.getElementById('leaveRequestModal');
|