Refactoring of list blocs

This commit is contained in:
2026-08-03 01:13:16 +02:00
committed by kitoy
parent ce3bc609ed
commit b7e27d65a6
6 changed files with 37 additions and 28 deletions

View File

@@ -16,7 +16,7 @@
<div class="formAddBloc" id="addBloc">
<form action="{{ url_for('add_bloc', page=page) }}" id="addBloc" method="POST" class="" >
<input id="csrf_token" name="csrf_token" type="hidden" value="{{ csrf_token() }}">
<h3>Créé un nouveau bloc</H3>
<h3>Créer nouveau bloc</H3>
<br>
<label for="blocName">Nom du bloc (caractères sans accents uniquement) </label>
<div class="input-group">

View File

@@ -80,7 +80,7 @@
<br/>
<div hx-get="{{ url_for('publish_progress') }}" hx-trigger="load, every 1s">
<div hx-get="{{ url_for('publish_progress') }}" hx-trigger="load, every 3s">
</div>
<br/>

View File

@@ -6,16 +6,9 @@
hx-target="#{{ bloc.name }}" > Enregistrer </button>
<button class="btn btn-danger"
onclick="enableModBtn()"
hx-get="{% if page %}/{{ page }}{% endif %}/view/{{ bloc.name }}"
hx-swap="outerHTML"
hx-target="#{{ bloc.name }}" > Fermer </button>
</div>
<script>
function enableModBtn(){
document.getElementById("modify-{{ bloc.name }}").disabled = false;
}
function saveText(){

View File

@@ -1,4 +1,16 @@
<script>
function enableModBtn(){
document.getElementById("modify-{{ bloc.name }}").disabled = false;
document.getElementById("modify-{{ bloc.name }}").style.visibility = "visible";
document.getElementById("close-edit-{{ bloc.name }}").style.visibility = "hidden";
}
document.getElementById("modify-{{ bloc.name }}").disabled = true;
document.getElementById("modify-{{ bloc.name }}").style.visibility = "hidden";
document.getElementById("close-edit-{{ bloc.name }}").style.visibility = "visible";
</script>