(groupName)
| 1773 | } |
| 1774 | |
| 1775 | async function openGroupAclEditor(groupName) { |
| 1776 | const isDark = document.body.classList.contains('dark-mode'); |
| 1777 | const overlayBg = isDark ? 'rgba(0,0,0,0.7)' : 'rgba(0,0,0,0.3)'; |
| 1778 | const contentBg = isDark ? '#2c2c2c' : '#fff'; |
| 1779 | const contentFg = isDark ? '#e0e0e0' : '#000'; |
| 1780 | const borderCol = isDark ? '#555' : '#ccc'; |
| 1781 | |
| 1782 | let modal = document.getElementById('groupAclModal'); |
| 1783 | if (!modal) { |
| 1784 | modal = document.createElement('div'); |
| 1785 | modal.id = 'groupAclModal'; |
| 1786 | modal.style.cssText = ` |
| 1787 | position:fixed; inset:0; background:${overlayBg}; |
| 1788 | display:flex; align-items:center; justify-content:center; z-index:3800; |
| 1789 | `; |
| 1790 | modal.innerHTML = ` |
| 1791 | <div class="modal-content" |
| 1792 | style="background:${contentBg}; color:${contentFg}; |
| 1793 | padding:16px; max-width:1300px; width:99%; |
| 1794 | position:relative; |
| 1795 | border:1px solid ${borderCol}; max-height:90vh; overflow:auto;"> |
| 1796 | <span id="closeGroupAclModal" |
| 1797 | class="editor-close-btn" |
| 1798 | style="right:8px; top:8px;">×</span> |
| 1799 | |
| 1800 | <h3 id="groupAclTitle">Group folder access</h3> |
| 1801 | <div class="muted" style="margin:-4px 0 10px;"> |
| 1802 | Group grants are merged with each member’s own folder access. They never reduce access. |
| 1803 | </div> |
| 1804 | |
| 1805 | <div class="modal-source-row" id="groupAclSourceRow" style="display:none;"> |
| 1806 | <label for="groupAclSourceSelect">${tf("storage_source", "Source")}</label> |
| 1807 | <select id="groupAclSourceSelect" class="form-control form-control-sm"></select> |
| 1808 | </div> |
| 1809 | |
| 1810 | <div id="groupAclBody" style="max-height:70vh; overflow-y:auto; margin-bottom:12px;"></div> |
| 1811 | |
| 1812 | <div style="display:flex; justify-content:flex-end; gap:8px;"> |
| 1813 | <button type="button" id="cancelGroupAcl" class="btn btn-secondary">${t('cancel')}</button> |
| 1814 | <button type="button" id="saveGroupAcl" class="btn btn-primary">${t('save_permissions')}</button> |
| 1815 | </div> |
| 1816 | </div> |
| 1817 | `; |
| 1818 | document.body.appendChild(modal); |
| 1819 | |
| 1820 | document.getElementById('closeGroupAclModal').onclick = () => (modal.style.display = 'none'); |
| 1821 | document.getElementById('cancelGroupAcl').onclick = () => (modal.style.display = 'none'); |
| 1822 | document.getElementById('saveGroupAcl').onclick = saveGroupAclFromUI; |
| 1823 | } else { |
| 1824 | modal.style.background = overlayBg; |
| 1825 | const content = modal.querySelector('.modal-content'); |
| 1826 | if (content) { |
| 1827 | content.style.background = contentBg; |
| 1828 | content.style.color = contentFg; |
| 1829 | content.style.border = `1px solid ${borderCol}`; |
| 1830 | } |
| 1831 | } |
| 1832 |
no test coverage detected