Compare commits
5 Commits
master
...
8c00c92577
| Author | SHA1 | Date | |
|---|---|---|---|
| 8c00c92577 | |||
| 4c595b1797 | |||
| a7137678b7 | |||
| b5f3b8ce22 | |||
| e08e54e4ad |
@@ -4,11 +4,35 @@
|
||||
{% block object-tools %}
|
||||
{{ block.super }}
|
||||
{% if original %}
|
||||
<li>
|
||||
<a class="button"
|
||||
<div class="container-fluid">
|
||||
<a class="btn btn-warning d-block w-100 text-center my-2"
|
||||
href="{% url 'admin:botconfig-restart' original.pk %}">
|
||||
🔁 Перезапустить бота
|
||||
Перезапустить бота
|
||||
</a>
|
||||
</li>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block extrahead %}
|
||||
{{ block.super }}
|
||||
<style>
|
||||
.container-fluid {
|
||||
margin-top: 20px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}
|
||||
{{ block.super }}
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const restartButton = document.querySelector('.btn-warning');
|
||||
if (restartButton) {
|
||||
restartButton.addEventListener('click', function(event) {
|
||||
if (!confirm('Вы уверены, что хотите перезапустить бота?')) {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user