добавил защиту для отчистки событий матча, тест 1
This commit is contained in:
@@ -4035,4 +4035,19 @@ function buildChannelValue(matchId) {
|
||||
if (hasMatch) return "match";
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
function openClearMatchModal() {
|
||||
const modal = document.getElementById("clearMatchModal");
|
||||
if (modal) modal.classList.add("show");
|
||||
}
|
||||
|
||||
function closeClearMatchModal() {
|
||||
const modal = document.getElementById("clearMatchModal");
|
||||
if (modal) modal.classList.remove("show");
|
||||
}
|
||||
|
||||
function confirmClearMatch() {
|
||||
closeClearMatchModal();
|
||||
clearMatchEvents();
|
||||
}
|
||||
@@ -2440,4 +2440,28 @@ body:not(.edit-mode-on) .referee-search {
|
||||
|
||||
#clockEditorModal .btn-primary {
|
||||
box-shadow: 0 10px 24px rgba(79, 140, 255, 0.25);
|
||||
}
|
||||
|
||||
.clear-match-modal-content {
|
||||
width: min(420px, 92vw);
|
||||
}
|
||||
|
||||
.clear-match-warning {
|
||||
padding: 18px;
|
||||
border-radius: 14px;
|
||||
background: rgba(220, 53, 69, 0.12);
|
||||
border: 1px solid rgba(220, 53, 69, 0.28);
|
||||
color: #ffb8bf;
|
||||
font-size: 15px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
background: #dc3545;
|
||||
color: white;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.btn-danger:hover {
|
||||
background: #e14b5b;
|
||||
}
|
||||
@@ -788,7 +788,7 @@ data-role="{{ p.position or '' }}"
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary"
|
||||
onclick="clearMatchEvents()"
|
||||
onclick="openClearMatchModal()"
|
||||
>
|
||||
Очистить
|
||||
</button>
|
||||
@@ -1616,5 +1616,57 @@ data-role="{{ p.position or '' }}"
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<div class="formation-modal" id="clearMatchModal">
|
||||
<div
|
||||
class="formation-modal-backdrop"
|
||||
onclick="closeClearMatchModal()"
|
||||
></div>
|
||||
|
||||
<div class="formation-modal-content clear-match-modal-content">
|
||||
<div class="formation-modal-header">
|
||||
<div>
|
||||
<div class="formation-modal-title">
|
||||
Очистить матч
|
||||
</div>
|
||||
|
||||
<div class="formation-modal-subtitle">
|
||||
Это действие удалит все события, счет и время матча
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="modal-close-btn"
|
||||
onclick="closeClearMatchModal()"
|
||||
>
|
||||
×
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="formation-modal-body">
|
||||
<div class="clear-match-warning">
|
||||
Вы точно уверены, что хотите очистить данные матча?
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="formation-modal-footer">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary"
|
||||
onclick="closeClearMatchModal()"
|
||||
>
|
||||
Отмена
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-danger"
|
||||
onclick="confirmClearMatch()"
|
||||
>
|
||||
Очистить
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user