Spaces:
Running
Running
Admin under the Navigation Bar, Add variables for adding a new interpreters - Follow Up Deployment
Browse files- index.html +113 -0
index.html
CHANGED
|
@@ -639,6 +639,56 @@
|
|
| 639 |
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">
|
| 640 |
<div class="bg-white p-6 rounded-xl shadow-sm">
|
| 641 |
<h3 class="text-lg font-semibold mb-4 primary-text">Interpreter Management</h3>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 642 |
<button id="add-interpreter-btn" class="w-full primary-bg text-white py-2 px-4 rounded-lg hover:bg-[#022b3d] transition font-medium mb-4">
|
| 643 |
<i class="fas fa-user-plus mr-2"></i> Add New Interpreter
|
| 644 |
</button>
|
|
@@ -1290,6 +1340,69 @@
|
|
| 1290 |
}
|
| 1291 |
}
|
| 1292 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1293 |
// Initialize
|
| 1294 |
document.addEventListener('DOMContentLoaded', () => {
|
| 1295 |
// Initialize any default values
|
|
|
|
| 639 |
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">
|
| 640 |
<div class="bg-white p-6 rounded-xl shadow-sm">
|
| 641 |
<h3 class="text-lg font-semibold mb-4 primary-text">Interpreter Management</h3>
|
| 642 |
+
<div id="interpreter-form" class="hidden mb-6 bg-gray-50 p-4 rounded-lg">
|
| 643 |
+
<h4 class="font-medium mb-3">Add New Interpreter</h4>
|
| 644 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
|
| 645 |
+
<div>
|
| 646 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">First Name</label>
|
| 647 |
+
<input type="text" id="interpreter-firstname" class="w-full px-3 py-2 border border-gray-300 rounded-md">
|
| 648 |
+
</div>
|
| 649 |
+
<div>
|
| 650 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Last Name</label>
|
| 651 |
+
<input type="text" id="interpreter-lastname" class="w-full px-3 py-2 border border-gray-300 rounded-md">
|
| 652 |
+
</div>
|
| 653 |
+
<div>
|
| 654 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Email</label>
|
| 655 |
+
<input type="email" id="interpreter-email" class="w-full px-3 py-2 border border-gray-300 rounded-md">
|
| 656 |
+
</div>
|
| 657 |
+
<div>
|
| 658 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Phone</label>
|
| 659 |
+
<input type="tel" id="interpreter-phone" class="w-full px-3 py-2 border border-gray-300 rounded-md">
|
| 660 |
+
</div>
|
| 661 |
+
</div>
|
| 662 |
+
<div class="mb-4">
|
| 663 |
+
<label class="block text-sm font-medium text-gray-700 mb-2">Languages</label>
|
| 664 |
+
<div class="flex flex-wrap gap-2">
|
| 665 |
+
<label class="inline-flex items-center">
|
| 666 |
+
<input type="checkbox" class="h-4 w-4 text-[#023047] focus:ring-[#023047] border-gray-300 rounded" value="ZSL">
|
| 667 |
+
<span class="ml-2 text-sm">ZSL</span>
|
| 668 |
+
</label>
|
| 669 |
+
<label class="inline-flex items-center">
|
| 670 |
+
<input type="checkbox" class="h-4 w-4 text-[#023047] focus:ring-[#023047] border-gray-300 rounded" value="English">
|
| 671 |
+
<span class="ml-2 text-sm">English</span>
|
| 672 |
+
</label>
|
| 673 |
+
<label class="inline-flex items-center">
|
| 674 |
+
<input type="checkbox" class="h-4 w-4 text-[#023047] focus:ring-[#023047] border-gray-300 rounded" value="Bemba">
|
| 675 |
+
<span class="ml-2 text-sm">Bemba</span>
|
| 676 |
+
</label>
|
| 677 |
+
<label class="inline-flex items-center">
|
| 678 |
+
<input type="checkbox" class="h-4 w-4 text-[#023047] focus:ring-[#023047] border-gray-300 rounded" value="Nyanja">
|
| 679 |
+
<span class="ml-2 text-sm">Nyanja</span>
|
| 680 |
+
</label>
|
| 681 |
+
<label class="inline-flex items-center">
|
| 682 |
+
<input type="checkbox" class="h-4 w-4 text-[#023047] focus:ring-[#023047] border-gray-300 rounded" value="Lozi">
|
| 683 |
+
<span class="ml-2 text-sm">Lozi</span>
|
| 684 |
+
</label>
|
| 685 |
+
</div>
|
| 686 |
+
</div>
|
| 687 |
+
<div class="flex justify-end space-x-3">
|
| 688 |
+
<button id="cancel-interpreter-btn" class="px-4 py-2 border border-gray-300 rounded-md text-sm font-medium">Cancel</button>
|
| 689 |
+
<button id="save-interpreter-btn" class="px-4 py-2 bg-[#023047] text-white rounded-md text-sm font-medium">Save Interpreter</button>
|
| 690 |
+
</div>
|
| 691 |
+
</div>
|
| 692 |
<button id="add-interpreter-btn" class="w-full primary-bg text-white py-2 px-4 rounded-lg hover:bg-[#022b3d] transition font-medium mb-4">
|
| 693 |
<i class="fas fa-user-plus mr-2"></i> Add New Interpreter
|
| 694 |
</button>
|
|
|
|
| 1340 |
}
|
| 1341 |
}
|
| 1342 |
|
| 1343 |
+
// Admin Interpreter Form Elements
|
| 1344 |
+
const addInterpreterBtn = document.getElementById('add-interpreter-btn');
|
| 1345 |
+
const interpreterForm = document.getElementById('interpreter-form');
|
| 1346 |
+
const cancelInterpreterBtn = document.getElementById('cancel-interpreter-btn');
|
| 1347 |
+
const saveInterpreterBtn = document.getElementById('save-interpreter-btn');
|
| 1348 |
+
const interpreterFirstname = document.getElementById('interpreter-firstname');
|
| 1349 |
+
const interpreterLastname = document.getElementById('interpreter-lastname');
|
| 1350 |
+
const interpreterEmail = document.getElementById('interpreter-email');
|
| 1351 |
+
const interpreterPhone = document.getElementById('interpreter-phone');
|
| 1352 |
+
const languageCheckboxes = document.querySelectorAll('#interpreter-form input[type="checkbox"]');
|
| 1353 |
+
|
| 1354 |
+
// Event Listeners for Admin
|
| 1355 |
+
addInterpreterBtn.addEventListener('click', () => {
|
| 1356 |
+
interpreterForm.classList.toggle('hidden');
|
| 1357 |
+
});
|
| 1358 |
+
|
| 1359 |
+
cancelInterpreterBtn.addEventListener('click', () => {
|
| 1360 |
+
interpreterForm.classList.add('hidden');
|
| 1361 |
+
clearInterpreterForm();
|
| 1362 |
+
});
|
| 1363 |
+
|
| 1364 |
+
saveInterpreterBtn.addEventListener('click', saveInterpreter);
|
| 1365 |
+
|
| 1366 |
+
// Functions for Admin
|
| 1367 |
+
function clearInterpreterForm() {
|
| 1368 |
+
interpreterFirstname.value = '';
|
| 1369 |
+
interpreterLastname.value = '';
|
| 1370 |
+
interpreterEmail.value = '';
|
| 1371 |
+
interpreterPhone.value = '';
|
| 1372 |
+
languageCheckboxes.forEach(checkbox => {
|
| 1373 |
+
checkbox.checked = false;
|
| 1374 |
+
});
|
| 1375 |
+
}
|
| 1376 |
+
|
| 1377 |
+
function saveInterpreter() {
|
| 1378 |
+
const firstName = interpreterFirstname.value.trim();
|
| 1379 |
+
const lastName = interpreterLastname.value.trim();
|
| 1380 |
+
const email = interpreterEmail.value.trim();
|
| 1381 |
+
const phone = interpreterPhone.value.trim();
|
| 1382 |
+
const languages = Array.from(languageCheckboxes)
|
| 1383 |
+
.filter(checkbox => checkbox.checked)
|
| 1384 |
+
.map(checkbox => checkbox.value);
|
| 1385 |
+
|
| 1386 |
+
if (!firstName || !lastName || !email || languages.length === 0) {
|
| 1387 |
+
alert('Please fill in all required fields (Name, Email, and at least one language)');
|
| 1388 |
+
return;
|
| 1389 |
+
}
|
| 1390 |
+
|
| 1391 |
+
// In a real app, this would send to your backend API
|
| 1392 |
+
console.log('Saving interpreter:', {
|
| 1393 |
+
firstName,
|
| 1394 |
+
lastName,
|
| 1395 |
+
email,
|
| 1396 |
+
phone,
|
| 1397 |
+
languages
|
| 1398 |
+
});
|
| 1399 |
+
|
| 1400 |
+
// For demo purposes, just show success and clear form
|
| 1401 |
+
alert('Interpreter saved successfully!');
|
| 1402 |
+
clearInterpreterForm();
|
| 1403 |
+
interpreterForm.classList.add('hidden');
|
| 1404 |
+
}
|
| 1405 |
+
|
| 1406 |
// Initialize
|
| 1407 |
document.addEventListener('DOMContentLoaded', () => {
|
| 1408 |
// Initialize any default values
|