some fixes in templates
This commit is contained in:
@@ -5,10 +5,43 @@
|
||||
{{ block.super }}
|
||||
{% if original %}
|
||||
<div class="container-fluid">
|
||||
<a class="btn btn-danger d-block w-100 text-center my-2"
|
||||
<a class="btn btn-warning d-block w-100 text-center my-2"
|
||||
href="{% url 'admin:botconfig-restart' original.pk %}">
|
||||
🔁 Перезапустить бота
|
||||
Перезапустить бота
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block extrahead %}
|
||||
{{ block.super }}
|
||||
<style>
|
||||
.container-fluid {
|
||||
margin-top: 20px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Настройки бота: {{ original.name }}</h1>
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
{{ adminform.form.as_p }}
|
||||
<button type="submit" class="btn btn-primary">Сохранить</button>
|
||||
</form>
|
||||
{% 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