v1.8.4: единая стилистика — замена confirm/alert/prompt на кастомные модалки, SERVICE_STYLE_GUIDE.md, обновлен AGENTS.md
This commit is contained in:
@@ -17,9 +17,9 @@
|
||||
<button class="btn btn-secondary btn-sm" title="Переключить статус">↻</button>
|
||||
</form>
|
||||
<button class="btn btn-secondary btn-sm" onclick="editIdea({{ idea.id }},{{ idea.title|tojson }},{{ idea.description|tojson }})">✎</button>
|
||||
<form method="post" action="/service/ideas/delete" style="display:inline" onsubmit="return confirm('Удалить идею?')">
|
||||
<form method="post" action="/service/ideas/delete" style="display:inline" id="delete-idea-form-{{ idea.id }}">
|
||||
<input type="hidden" name="id" value="{{ idea.id }}">
|
||||
<button class="btn btn-danger btn-sm">✕</button>
|
||||
<button type="button" class="btn btn-danger btn-sm" onclick="openConfirmDeleteIdea({{ idea.id }},{{ idea.title|tojson }})" title="Удалить">✕</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>{% endfor %}</tbody></table>
|
||||
@@ -38,7 +38,35 @@
|
||||
</form>
|
||||
</div></div>
|
||||
|
||||
<div class="modal-overlay" id="confirm-delete-idea">
|
||||
<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-idea-name"></strong> будет удалён навсегда. Это действие нельзя отменить.
|
||||
</p>
|
||||
<div class="modal-actions" style="justify-content:flex-end;">
|
||||
<button type="button" class="btn btn-danger" onclick="confirmDeleteIdea()">Удалить</button>
|
||||
<button type="button" class="btn" onclick="closeConfirmDeleteIdea()">Отмена</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var deleteIdeaId = null;
|
||||
function openConfirmDeleteIdea(id, name){
|
||||
deleteIdeaId = id;
|
||||
document.getElementById('delete-idea-name').textContent = name || '#' + id;
|
||||
document.getElementById('confirm-delete-idea').classList.add('open');
|
||||
}
|
||||
function closeConfirmDeleteIdea(){
|
||||
document.getElementById('confirm-delete-idea').classList.remove('open');
|
||||
deleteIdeaId = null;
|
||||
}
|
||||
function confirmDeleteIdea(){
|
||||
if(!deleteIdeaId) return;
|
||||
document.getElementById('delete-idea-form-' + deleteIdeaId).submit();
|
||||
closeConfirmDeleteIdea();
|
||||
}
|
||||
function editIdea(id,title,description){
|
||||
document.getElementById('modal-idea').classList.add('open');
|
||||
document.getElementById('modal-idea-title').textContent = 'Редактировать идею';
|
||||
|
||||
Reference in New Issue
Block a user