Correction for multiple page editions

This commit is contained in:
2026-06-06 01:03:25 +02:00
committed by kitoy
parent ca077ebc19
commit e2df81a282
5 changed files with 43 additions and 18 deletions

View File

@@ -1,10 +1,15 @@
<div>
<form class="sortblocs" action="/{{ page }}/sortblocs" method="POST" id="myblocs">
<input id="csrf_token" name="csrf_token" type="hidden" value="{{ csrf_token() }}">
{% include 'admin/_blocs-list.html' %}
</form>
<hr/>
<form action="{{ url_for('sortblocs', page=page) }}" method="POST" id="myblocs">
<input id="csrf_token" name="csrf_token" type="hidden" value="{{ csrf_token() }}">
{% include 'admin/_blocs-list.html' %}
<button class="btn btn-success" type="submit" form="myblocs"> Enregister </button>
</form>
<hr/>
<button class="btn btn-outline-success" onclick="printForm()">+</button>
@@ -40,14 +45,13 @@
<br/>
<button type="submit" class="btn btn-success"
onclick="valid_nameBloc()"
hx-post="/{{ page }}/addBloc"
hx-post="{{ url_for('add_bloc', page=page) }}"
hx-swap="outerHTML"
hx-target="#myblocs"> Créer le bloc </button>
</form>
</div>
<hr/>
<button class="btn btn-success" type="submit" form="myblocs"> Enregister </button>
</div>

View File

@@ -1,6 +1,10 @@
<section class="p-0 {{ bloc.property }}" id="{{ bloc.name }}">
<div class="container-fluid p-0">
<div class="text-center">
<h2> Galerie: {{ bloc.name }} </h2>
<p> Cliquez sur modifier à droite et glisser vos images ou cliquez directement sur le cadre déposez vos images ici ! </p>
</div>
<div class="row no-gutters popup-gallery">
{% for image in bloc.values() %}
{% if image.file %}
@@ -23,6 +27,7 @@
</div>
{% endif %}
{% endfor %}
</div>
</div>
</section>

View File

@@ -1,6 +1,6 @@
<div class="container-fluid p-0" id="editImageInfo">
<form method='POST' action='/edit/images/{{ bloc.name }}/{{ image.file }}' hx-swap="outerHTML" hx-target="#editImg">
<form method='POST' action="{{ url_for('edit_img', page=page, bloc=bloc.name, image=image.file) }}" hx-swap="outerHTML" hx-target="#editImg">
{{ form.csrf_token }}
<div class="row">
<div class="col-lg-2 mx-auto my-4 text-center">
@@ -22,7 +22,7 @@
{{ form.description(value=image.description, class="form-control text-center") }}
<br/>
<button class="btn btn-success" type="submit" data-dismiss="modal"
hx-post="/edit/images/{{ bloc.name }}/{{ image.file }}"
hx-post="{{ url_for('edit_img', page=page, bloc=bloc.name, image=image.file) }}"
hx-swap="outerHTML"
hx-target="#editImageInfo"
hx-swap="delete"> Valider </button>

View File

@@ -19,7 +19,7 @@
</div>
</a>
<button type="button" class="btn btn-success m-4"
hx-get="/edit/images/{{ bloc.name }}/{{ image.file }}"
hx-get="{{ url_for('edit_img', page=page, bloc=bloc.name, image=image.file)}}"
hx-target="#editImage"
hw-swap="none">
<i class="fa fa-pencil-square-o"></i>