v1.8.4: единая стилистика — замена confirm/alert/prompt на кастомные модалки, SERVICE_STYLE_GUIDE.md, обновлен AGENTS.md
This commit is contained in:
@@ -161,7 +161,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-formula-coeff-form-{{ c.id }}"><input type="hidden" name="id" value="{{ c.id }}"><button type="button" class="btn btn-danger btn-sm" onclick="openConfirmDeleteFormulaCoeff({{ c.id }},'{{ c.key|e }}')" title="Удалить">✕</button></form>
|
||||
</td>
|
||||
</tr>{% endfor %}</tbody></table>
|
||||
</div>
|
||||
@@ -199,7 +199,35 @@
|
||||
<div id="formula-info-content" style="margin-top:12px"></div>
|
||||
</div></div>
|
||||
|
||||
<div class="modal-overlay" id="confirm-delete-formula-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-formula-coeff-name"></strong> будет удалён навсегда. Это действие нельзя отменить.
|
||||
</p>
|
||||
<div class="modal-actions" style="justify-content:flex-end;">
|
||||
<button type="button" class="btn btn-danger" onclick="confirmDeleteFormulaCoeff()">Удалить</button>
|
||||
<button type="button" class="btn" onclick="closeConfirmDeleteFormulaCoeff()">Отмена</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var deleteFormulaCoeffId = null;
|
||||
function openConfirmDeleteFormulaCoeff(id, name){
|
||||
deleteFormulaCoeffId = id;
|
||||
document.getElementById('delete-formula-coeff-name').textContent = name || '#' + id;
|
||||
document.getElementById('confirm-delete-formula-coeff').classList.add('open');
|
||||
}
|
||||
function closeConfirmDeleteFormulaCoeff(){
|
||||
document.getElementById('confirm-delete-formula-coeff').classList.remove('open');
|
||||
deleteFormulaCoeffId = null;
|
||||
}
|
||||
function confirmDeleteFormulaCoeff(){
|
||||
if(!deleteFormulaCoeffId) return;
|
||||
document.getElementById('delete-formula-coeff-form-' + deleteFormulaCoeffId).submit();
|
||||
closeConfirmDeleteFormulaCoeff();
|
||||
}
|
||||
function switchTab(name){
|
||||
document.querySelectorAll('.tab-content').forEach(function(t){ t.classList.remove('active'); });
|
||||
document.querySelectorAll('.tab').forEach(function(t){ t.classList.remove('active'); });
|
||||
|
||||
Reference in New Issue
Block a user