v1.8.4: единая стилистика — замена confirm/alert/prompt на кастомные модалки, SERVICE_STYLE_GUIDE.md, обновлен AGENTS.md
Tests / test (push) Has been cancelled
Tests / test-max-bot (push) Has been cancelled

This commit is contained in:
2026-06-02 20:40:24 +03:00
parent df34048e2a
commit e184e5fe79
23 changed files with 777 additions and 70 deletions
+28 -1
View File
@@ -10,7 +10,7 @@
<td><span class="badge badge-{{ 'active' if c.is_active else 'inactive' }}">{{ 'Да' if c.is_active else 'Нет' }}</span></td>
<td class="actions">
<button class="btn btn-secondary btn-sm" onclick="editCase({{ c.id }},'{{ c.title|e }}','{{ c.text|e }}','{{ c.effect|e }}',{{ c.sort_order }},{{ 'true' if c.is_active else 'false' }})"></button>
<form method="post" action="/service/cases/delete" style="display:inline" onsubmit="return confirm('Удалить?')"><input type="hidden" name="id" value="{{ c.id }}"><button class="btn btn-danger btn-sm"></button></form>
<form method="post" action="/service/cases/delete" style="display:inline" id="delete-case-form-{{ c.id }}"><input type="hidden" name="id" value="{{ c.id }}"><button type="button" class="btn btn-danger btn-sm" onclick="openConfirmDeleteCase({{ c.id }},'{{ c.title|e }}')" title="Удалить"></button></form>
</td>
</tr>{% endfor %}</tbody></table>
</div>
@@ -31,7 +31,34 @@
<button type="button" class="btn btn-secondary" onclick="this.closest('.modal-overlay').classList.remove('open')">Отмена</button></div>
</form>
</div></div>
<div class="modal-overlay" id="confirm-delete-case">
<div class="modal" style="max-width:420px;">
<h2 style="font-size:16px;margin-bottom:8px;">Удалить?</h2>
<p style="color:var(--text-secondary);font-size:14px;margin-bottom:20px;">
<strong id="delete-case-name"></strong> будет удалён навсегда. Это действие нельзя отменить.
</p>
<div class="modal-actions" style="justify-content:flex-end;">
<button type="button" class="btn btn-danger" onclick="confirmDeleteCase()">Удалить</button>
<button type="button" class="btn" onclick="closeConfirmDeleteCase()">Отмена</button>
</div>
</div>
</div>
<script>
var deleteCaseId = null;
function openConfirmDeleteCase(id, name){
deleteCaseId = id;
document.getElementById('delete-case-name').textContent = name || '#' + id;
document.getElementById('confirm-delete-case').classList.add('open');
}
function closeConfirmDeleteCase(){
document.getElementById('confirm-delete-case').classList.remove('open');
deleteCaseId = null;
}
function confirmDeleteCase(){
if(!deleteCaseId) return;
document.getElementById('delete-case-form-' + deleteCaseId).submit();
closeConfirmDeleteCase();
}
function editCase(id,title,text,effect,order,active){
document.getElementById('modal-case').classList.add('open');
document.getElementById('modal-case-title').textContent = 'Редактировать';