Update index.html
1 file changed+28−0
index.html+28−0View file
| @@ -2060,6 +2060,24 @@ | ||
| if (adminNotice) { | ||
| if (currentUser.role === 'admin') { | ||
| adminNotice.classList.remove('hidden'); | ||
| + const pSelect = document.getElementById('preview-freelancer-select'); | ||
| + if (pSelect) { | ||
| + const allEmails = new Set(); | ||
| + const list = []; | ||
| + FREELANCER_PERSONAS.forEach(p => { | ||
| + if (!allEmails.has(p.email.toLowerCase())) { | ||
| + allEmails.add(p.email.toLowerCase()); | ||
| + list.push(p); | ||
| + } | ||
| + }); | ||
| + state.assignments.forEach(a => { | ||
| + if (!allEmails.has(a.freelanceEmail.toLowerCase())) { | ||
| + allEmails.add(a.freelanceEmail.toLowerCase()); | ||
| + list.push({ name: a.freelanceName, email: a.freelanceEmail }); | ||
| + } | ||
| + }); | ||
| + pSelect.innerHTML = list.map(f => `<option value="${f.email}" ${f.email.toLowerCase() === (currentFreelancer.email || '').toLowerCase() ? 'selected' : ''}>${f.name} (${f.email})</option>`).join(''); | ||
| + } | ||
| } else { | ||
| adminNotice.classList.add('hidden'); | ||
| } | ||
| @@ -2078,6 +2096,16 @@ | ||
| renderAll(); | ||
| } | ||
| + function changePreviewFreelancer(email) { | ||
| + if (!email) return; | ||
| + const p = FREELANCER_PERSONAS.find(x => x.email.toLowerCase() === email.toLowerCase()) || | ||
| + state.assignments.find(x => x.freelanceEmail.toLowerCase() === email.toLowerCase()); | ||
| + if (p) { | ||
| + currentFreelancer = { name: p.name || p.freelanceName, email: p.email || p.freelanceEmail }; | ||
| + renderAll(); | ||
| + } | ||
| + } | ||
| + | ||
| // ------------------------------------------------------------- | ||
| // Navigation Tabs | ||
| // ------------------------------------------------------------- | ||