()
| 712 | // Public entry point from adminPanel.js |
| 713 | // ───────────────────────────────────────── |
| 714 | export async function openClientPortalsModal() { |
| 715 | const isDark = document.body.classList.contains('dark-mode'); |
| 716 | const overlayBg = isDark ? 'rgba(0,0,0,0.7)' : 'rgba(0,0,0,0.3)'; |
| 717 | const contentBg = isDark ? '#2c2c2c' : '#fff'; |
| 718 | const contentFg = isDark ? '#e0e0e0' : '#000'; |
| 719 | const borderCol = isDark ? '#555' : '#ccc'; |
| 720 | |
| 721 | let modal = document.getElementById('clientPortalsModal'); |
| 722 | if (!modal) { |
| 723 | modal = document.createElement('div'); |
| 724 | modal.id = 'clientPortalsModal'; |
| 725 | modal.style.cssText = ` |
| 726 | position:fixed; inset:0; background:${overlayBg}; |
| 727 | display:flex; align-items:center; justify-content:center; z-index:3650; |
| 728 | `; |
| 729 | modal.innerHTML = ` |
| 730 | <div class="modal-content" |
| 731 | style="background:${contentBg}; color:${contentFg}; |
| 732 | padding:16px; max-width:980px; width:95%; |
| 733 | position:relative; |
| 734 | border:1px solid ${borderCol}; max-height:90vh; overflow:auto;"> |
| 735 | <span id="closeClientPortalsModal" |
| 736 | class="editor-close-btn" |
| 737 | style="right:8px; top:8px;">×</span> |
| 738 | |
| 739 | <h3>Client Portals</h3> |
| 740 | <p class="muted" style="margin-top:-6px;"> |
| 741 | Create client portals for specific folders and configure access, users, branding, and intake details per portal. |
| 742 | </p> |
| 743 | |
| 744 | <div class="d-flex justify-content-between align-items-center" style="margin:8px 0 10px;"> |
| 745 | <div> |
| 746 | <button type="button" id="addPortalBtn" class="btn btn-sm btn-success"> |
| 747 | <i class="material-icons" style="font-size:16px;">cloud_upload</i> |
| 748 | <span style="margin-left:4px;">Add portal</span> |
| 749 | </button> |
| 750 | |
| 751 | <button type="button" |
| 752 | id="clientPortalsQuickAddUser" |
| 753 | class="btn btn-sm btn-primary ms-1"> |
| 754 | <i class="material-icons" style="font-size:16px; vertical-align:middle;">people</i> |
| 755 | <span style="margin-left:4px;">Manage users…</span> |
| 756 | </button> |
| 757 | |
| 758 | <button |
| 759 | type="button" |
| 760 | id="clientPortalsOpenUserPerms" |
| 761 | class="btn btn-sm btn-secondary ms-1"> |
| 762 | <i class="material-icons" style="font-size:16px; vertical-align:middle;">folder_shared</i> |
| 763 | <span style="margin-left:4px;">Folder access…</span> |
| 764 | </button> |
| 765 | |
| 766 | <button |
| 767 | type="button" |
| 768 | id="clientPortalsOpenUserGroups" |
| 769 | class="btn btn-sm btn-secondary ms-1"> |
| 770 | <i class="material-icons" style="font-size:16px; vertical-align:middle;">groups</i> |
| 771 | <span style="margin-left:4px;">User groups…</span> |
no test coverage detected