v1.8.4: единая стилистика — замена confirm/alert/prompt на кастомные модалки, SERVICE_STYLE_GUIDE.md, обновлен AGENTS.md
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
<td><small>{{ c.formula_ref }}</small></td>
|
||||
<td><form method="post" action="/service/coefficients/toggle"><input type="hidden" name="id" value="{{ c.id }}"><button class="btn btn-{{ 'success' if c.is_active else 'secondary' }} btn-sm">{{ '✓' if c.is_active else '✕' }}</button></form></td>
|
||||
<td class="actions"><button class="btn btn-secondary btn-sm" onclick="editCoeff({{ c.id }},'{{ c.key|e }}','{{ c.value }}','{{ c.description|e }}','{{ c.formula_ref|e }}')">✎</button>
|
||||
<form method="post" action="/service/coefficients/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/coefficients/delete" style="display:inline" id="delete-coeff-form-{{ c.id }}"><input type="hidden" name="id" value="{{ c.id }}"><button type="button" class="btn btn-danger btn-sm" onclick="openConfirmDeleteCoeff({{ c.id }},'{{ c.key|e }}')" title="Удалить">✕</button></form>
|
||||
</td>
|
||||
</tr>{% endfor %}</tbody></table>
|
||||
</div>
|
||||
@@ -65,7 +65,35 @@
|
||||
<div id="formula-info-content" style="margin-top:12px"></div>
|
||||
</div></div>
|
||||
|
||||
<div class="modal-overlay" id="confirm-delete-coeff">
|
||||
<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-coeff-name"></strong> будет удалён навсегда. Это действие нельзя отменить.
|
||||
</p>
|
||||
<div class="modal-actions" style="justify-content:flex-end;">
|
||||
<button type="button" class="btn btn-danger" onclick="confirmDeleteCoeff()">Удалить</button>
|
||||
<button type="button" class="btn" onclick="closeConfirmDeleteCoeff()">Отмена</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var deleteCoeffId = null;
|
||||
function openConfirmDeleteCoeff(id, name){
|
||||
deleteCoeffId = id;
|
||||
document.getElementById('delete-coeff-name').textContent = name || '#' + id;
|
||||
document.getElementById('confirm-delete-coeff').classList.add('open');
|
||||
}
|
||||
function closeConfirmDeleteCoeff(){
|
||||
document.getElementById('confirm-delete-coeff').classList.remove('open');
|
||||
deleteCoeffId = null;
|
||||
}
|
||||
function confirmDeleteCoeff(){
|
||||
if(!deleteCoeffId) return;
|
||||
document.getElementById('delete-coeff-form-' + deleteCoeffId).submit();
|
||||
closeConfirmDeleteCoeff();
|
||||
}
|
||||
function toggleAccordion(el) {
|
||||
var arrow = el.querySelector('.accordion-arrow');
|
||||
var body = el.nextElementSibling;
|
||||
|
||||
Reference in New Issue
Block a user