feat: add branches feature, security audit, and multi-branch support
This commit is contained in:
+47
-27
@@ -30,39 +30,51 @@
|
||||
</div>
|
||||
|
||||
<div class="modal-overlay" id="batchModal" onclick="if(event.target===this)closeBatchAdd()">
|
||||
<div class="edit-modal">
|
||||
<div class="edit-modal" style="max-width:480px">
|
||||
<h3>Пакетное добавление учеников</h3>
|
||||
<div>
|
||||
<label>Имена — каждое с новой строки</label>
|
||||
<textarea id="batchText" placeholder="Иванов Иван Петров Пётр Сидоров Сидор"></textarea>
|
||||
</div>
|
||||
<div>
|
||||
<label>Группа (необязательно)</label>
|
||||
<select id="batchGroup"><option value="">— без группы —</option></select>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button class="cancel" onclick="closeBatchAdd()">Отмена</button>
|
||||
<button class="save" onclick="batchAdd()">Добавить</button>
|
||||
</div>
|
||||
<form id="batchForm" class="settings-stack" style="gap:12px">
|
||||
<div class="settings-row">
|
||||
<div class="settings-field" style="flex:1">
|
||||
<label>Имена — каждое с новой строки <span style="color:#ef4444">*</span></label>
|
||||
<textarea id="batchText" class="settings-input" style="min-height:120px" required placeholder="Иванов Иван Петров Пётр Сидоров Сидор"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="settings-row">
|
||||
<div class="settings-field" style="flex:1">
|
||||
<label>Группа (необязательно)</label>
|
||||
<select id="batchGroup" class="settings-input"><option value="">— без группы —</option></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-foot" style="justify-content:flex-end;gap:8px">
|
||||
<button type="button" class="btn-primary ghost" onclick="closeBatchAdd()">Отмена</button>
|
||||
<button type="submit" class="btn-primary">Добавить</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-overlay" id="attachModal" onclick="if(event.target===this)closeBatchAttach()">
|
||||
<div class="edit-modal">
|
||||
<div class="edit-modal" style="max-width:480px">
|
||||
<h3>Прикрепить к группе</h3>
|
||||
<div>
|
||||
<label>Группа</label>
|
||||
<select id="attachGroup"><option value="">— выберите группу —</option></select>
|
||||
</div>
|
||||
<div>
|
||||
<label>Ученики</label>
|
||||
<input type="text" id="attachSearch" class="search-input" placeholder="Поиск по имени..." style="width:100%;margin-bottom:8px">
|
||||
<div class="attach-list" id="attachList"></div>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button class="cancel" onclick="closeBatchAttach()">Отмена</button>
|
||||
<button class="save" onclick="batchAttach()">Прикрепить</button>
|
||||
</div>
|
||||
<form id="attachForm" class="settings-stack" style="gap:12px">
|
||||
<div class="settings-row">
|
||||
<div class="settings-field" style="flex:1">
|
||||
<label>Группа <span style="color:#ef4444">*</span></label>
|
||||
<select id="attachGroup" class="settings-input" required><option value="">— выберите группу —</option></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="settings-row">
|
||||
<div class="settings-field" style="flex:1">
|
||||
<label>Ученики</label>
|
||||
<input type="text" id="attachSearch" class="settings-input" placeholder="Поиск по имени..." style="margin-bottom:8px">
|
||||
<div class="attach-list" id="attachList"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-foot" style="justify-content:flex-end;gap:8px">
|
||||
<button type="button" class="btn-primary ghost" onclick="closeBatchAttach()">Отмена</button>
|
||||
<button type="submit" class="btn-primary">Прикрепить</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -188,6 +200,10 @@ async function batchAdd() {
|
||||
}
|
||||
|
||||
document.getElementById('newStudent').addEventListener('keydown', e => { if (e.key === 'Enter') addStudent(); });
|
||||
document.getElementById('batchForm').addEventListener('submit', e => {
|
||||
e.preventDefault();
|
||||
batchAdd();
|
||||
});
|
||||
document.getElementById('studentSearch').addEventListener('input', () => {
|
||||
clearTimeout(sSearchTimer);
|
||||
sSearchTimer = setTimeout(() => { sPage = 1; renderStudents(); }, 300);
|
||||
@@ -278,6 +294,10 @@ async function batchAttach() {
|
||||
} else { const e = await res.json(); alert(e.error); }
|
||||
}
|
||||
|
||||
document.getElementById('attachForm').addEventListener('submit', e => {
|
||||
e.preventDefault();
|
||||
batchAttach();
|
||||
});
|
||||
document.getElementById('attachSearch').addEventListener('input', () => {
|
||||
clearTimeout(aSearchTimer);
|
||||
aSearchTimer = setTimeout(renderAttachList, 300);
|
||||
|
||||
Reference in New Issue
Block a user