Rewrite edit blocs and themes

This commit is contained in:
2026-03-28 12:20:30 +01:00
parent 48c5c31818
commit cdf1d439f5
32 changed files with 627 additions and 373 deletions

View File

@@ -0,0 +1,11 @@
<section class="bg-primary" id="about">
<div class="container">
<div class="row">
<div class="col-lg-8 mx-auto text-center">
<h2 class="section-heading text-white">{{ mesinfos.text.title }}</h2>
<hr class="light my-4">
<p class="text-faded mb-4"> {{ mesinfos.text.text }} </p>
</div>
</div>
</div>
</section>

View File

@@ -0,0 +1,30 @@
<section id="contact" >
<div class="container" id="{{ bloc.name }}">
<div class="row">
<div class="col-lg-8 mx-auto text-center">
<h2 class="section-heading"> {{ bloc.title }} </h2>
<hr class="my-4">
<p class="mb-5"> {{ bloc.text }} </p>
</div>
</div>
<div class="row">
<div class="col-lg-4 ml-auto text-center">
<i class="fa fa-phone fa-3x mb-3 sr-contact"></i>
<p> {{ bloc.phone }} </p>
</div>
<div class="col-lg-4 mr-auto text-center">
<i class="fa fa-envelope-o fa-3x mb-3 sr-contact"></i>
<p>
<a href="{{ bloc.email }}" class="obfuscate" > {{ bloc.email }} </a>
</p>
</div>
<div class="col-lg-8 mx-auto text-center">
<br/> <br/>
<p class="mb-2"> {{ bloc.address }} </p>
<p>
<bold> {{ bloc.postal_code }} - {{ bloc.city }} </bold>
</p>
</div>
</div>
</div>
</section>

View File

@@ -0,0 +1,10 @@
<section class="bg-dark text-white" id="{{ bloc.name }}" hx-swap-oob="true" >
<div class="container text-center">
<h2 class="mb-4">{{ bloc.title }}</h2>
<p> {{ bloc.text }} </p>
<a class="btn btn-light btn-xl sr-button" href="{{ bloc.link }}">
{{ bloc.text_button }}
</a>
</div>
</section>

View File

@@ -0,0 +1,27 @@
<section class="p-0" id="{{ bloc.name }}">
<div class="container-fluid p-0">
<div class="row no-gutters popup-gallery">
{% for image in bloc.values() %}
{% if image.file %}
<div class="col-lg-4 col-sm-6 text-center">
<a class="portfolio-box" href="/static/img/portfolio/fullsize/{{ image.file }}" alt="{{ image.description }}">
<img class="img-fluid" src="/static/img/portfolio/thumbnails/{{ image.file }}" alt="{{ image.description }}">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category text-faded">
{{ image.subtitle }}
</div>
<div class="project-name">
{{ image.title }}
</div>
</div>
</div>
</a>
</div>
{% endif %}
{% endfor %}
</div>
</div>
</section>

View File

@@ -0,0 +1,20 @@
<header class="masthead text-center text-white d-flex" style="background-image: url('/static/img/{{ bloc.bg_img }}');" id="{{ bloc.name }}" >
<div class="container my-auto">
<div class="row">
<div class="col-lg-10 mx-auto">
<h1 class="text-uppercase">
<strong> {{ bloc.title }} </strong>
</h1>
<hr>
</div>
<div class="col-lg-8 mx-auto">
<p class="text-faded mb-5"> {{ bloc.text }} </p>
<a class="btn btn-primary btn-xl js-scroll-trigger" href="#">{{ bloc.text_button }}
</a>
</div>
</div>
</div>
</header>

View File

@@ -0,0 +1,12 @@
<section class="bg-primary" id="{{ bloc.name }}">
<div class="container">
<div class="row">
<div class="col-lg-8 mx-auto text-center">
<h2 class="section-heading text-white">{{ bloc.title }}</h2>
<hr class="light my-4">
<p class="text-faded mb-4"> {{ bloc.text }} </p>
</div>
</div>
</div>
</section>

View File

@@ -0,0 +1,18 @@
<section class="bg-primary" id="about">
<div class="container">
<form method='POST' action='/edit/description'>
{{ form.csrf_token }}
<div class="row">
<div class="col-lg-8 mx-auto text-center">
{{ form.titre_description(col=5,value=bloc.titre_description,
class="form-control form-control-lg text-center") }}
<hr class="light my-4">
{{ form.description(value=bloc.description, class="form-control text-center") }}
<br/>
{{ form.submit() }}
</div>
</div>
</form>
</div>
</section>

View File

@@ -0,0 +1,52 @@
<section id="contact" id="{{ bloc.name }}">
<div class="container" id="{{ bloc.name }}" hx_swap="beforeend">
<form method='POST' action="/edit/{{ bloc.name }}" hx-post='/edit//{{ bloc.name }}' hx-swap="outerHTML" hx-target="#{{ bloc.name }}" >
{{ form.csrf_token }}
{% include 'edit-tools/_form-base.html' %}
<div class="row">
<div class="col-lg-8 mx-auto text-center">
{{ form.title(col=5, value=bloc.title,
class="form-control form-control-lg text-center") }}
<hr class="my-4">
<textarea class="form-control text-center" id="text" name="text"> {{ bloc.text }} </textarea>
</div>
</div>
<div class="row">
<div class="col-lg-4 ml-auto text-center">
<i class="fa fa-phone fa-3x mb-3 sr-contact"></i>
{{form.phone(col=3,value=bloc.phone,
class="form-control form-control-lg text-center")}}
</div>
<div class="col-lg-4 mr-auto text-center">
<i class="fa fa-envelope-o fa-3x mb-3 sr-contact"></i>
{{form.email(col=5,value=bloc.email,
class="form-control obfuscate form-control-lg text-center")}}
</div>
<div class="col-lg-8 mx-auto text-center">
<br/> <br/>
<label> {{ form.address.label }} </label>
<p class="mb-2"> {{ form.address(col=5, value=bloc.address,
class="form-control form-control-lg text-center") }} </p>
<div class="row">
<div class="col-lg-4 ml-auto text-center">
<label> {{ form.postal_code.label }} </label>
{{ form.postal_code( value=bloc.postal_code,
class="form-control form-control-lg-3 text-center") }}
</div>
<div class="col-lg-4 mr-auto text-center">
<label> {{ form.city.label }} </label>
{{ form.city( value=bloc.city,
class="form-control form-control-lg-3 text-center") }}
</div>
</div>
<br/>
{% include 'edit-tools/_btn-save-cancel.html' %}
</div>
</div>
</form>
</div>
</section>

View File

@@ -0,0 +1,26 @@
<div class="container text-center">
<form method='POST' action='/edit/{{ bloc.name }}' hx-post='/edit//{{ bloc.name }}' hx-swap="outerHTML" hx-target="#{{ bloc.name }}">
{{ form.csrf_token }}
{% include 'edit-tools/_form-base.html' %}
<h2 class="mb-4"> Titre du lien </h2>
{{ form.title(value=bloc.title,
class="form-control form-control-lg text-center") }}
<h3> Description du lien </h3>
{{ form.text(value=bloc.text,
class="form-control text-center") }}
<h3> Votre lien (https://exemple.com) </h3>
{{ form.link(value=bloc.link, class="form-control text-center") }}
<br />
<div class="col-lg-4 form-group mx-auto">
{{ form.text_button(value=bloc.text_button,
class="form-control text-center") }}
{% for error in form.text_button.errors %}
<span style="color: red;">
{{ error }}</span>
{% endfor %}
</div>
{% include 'edit-tools/_btn-save-cancel.html' %}
</form>
</div>

View File

@@ -0,0 +1,6 @@
<form id="uploader" methods="POST" class="dropzone dz-clickable"></form>
{% include theme+'/blocs/edit/images_list.html' %}
{% include '_js_dropzone.html' %}

View File

@@ -0,0 +1,34 @@
<div class="container-fluid p-0">
<form method='POST' action='/edit/images/{{ bloc.name }}/{{ 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">
<img class="img-fluid" src="/static/img/portfolio/thumbnails/{{ image.file }}" alt="{{ image.description }}">
</div>
<div class="col-lg-4 mx-auto my-4 text-center">
<h3> Titre </h3>
{{ form.title(value=image.title,
class="form-control form-control-lg text-center") }}
<hr class="light my-4">
<h3>Sous-titre</h3>
{{ form.subtitle(value=image.subtitle, class="form-control text-center") }}
<br/>
<h3> Catégorie </h3>
{{ form.category(value=image.category, class="form-control text-center") }}
<hr class="light my-4">
<h3> Description de votre image </h3>
<p> Une description de l'image est utile pour les personnes mal-voyantes et au référecement de votre site </p>
{{ 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-swap="outerHTML"
hx-target="#editImg"> Valider </button>
<a class="btn btn-danger mx-auto" href="/edit/images/del/{{ image.nom_fichier }}">Supprimer l'image</a>
</div>
</div>
</form>
</div>

View File

@@ -0,0 +1,42 @@
<div class="container my-auto">
<form method='POST' action='/edit/{{ bloc.name }}' hx-swap="outerHTML" hx-target="#{{ bloc.name }}" enctype="multipart/form-data">
{{ form.csrf_token }}
<div class="row">
<div class="col-lg-10 form-group mx-auto">
{% include 'edit-tools/_form-base.html' %}
{{ form.title(value=bloc.title,
class="form-control form-control-lg text-center text-uppercase")
}}
{% for error in form.title.errors %}
<span style="color: red;">{{ error }}</span>
{% endfor %}
<hr>
</div>
<div class="col-lg-8 form-group mx-auto">
{% set f = form.text.process_data(bloc.text) %}
<textarea class="form-control text-center" id="text" name="text"> {{ bloc.text }} </textarea>
{% for error in form.text.errors %}
<span style="color: red;">{{ error }}</span>
{% endfor %}
<br/>
<div class="col-lg-4 form-group mx-auto">
{{ form.text_button(value=bloc.text_button,
class="form-control text-center") }}
{% for error in form.text_button.errors %}
<span style="color: red;">
{{ error }}</span>
{% endfor %}
<h4> cible du bouton </h4>
{{ form.link(value=bloc.link, class="form-control text-center") }}
<br />
</div>
<div class="col-lg-3 form-group mx-auto">
{{ form.image(class="form-control" ) }}
</div>
{% include 'edit-tools/_btn-save-cancel.html' %}
</div>
</div>
</form>
</div>

View File

@@ -0,0 +1,20 @@
<div class="container">
<form method='POST' action='/edit/{{ bloc.name }}' >
{{ form.csrf_token }}
<div class="row">
<div class="col-lg-8 mx-auto text-center">
{% include 'edit-tools/_form-base.html' %}
{{ form.title(col=5,value=bloc.title,
class="form-control form-control-lg text-center") }}
<hr class="light my-4">
<textarea class="form-control text-center" id="text" name="text"> {{ bloc.text }} </textarea>
<br/>
{% include 'edit-tools/_btn-save-cancel.html' %}
</div>
</div>
</form>
</div>
</section>

View File

@@ -0,0 +1,35 @@
<section class="p-0">
<div class="container-fluid p-0" id="editImg">
<div class="row no-gutters ">
{% for image in bloc.values() %}
{% if image.file %}
<div class="col-lg-4 col-sm-6 text-center">
<a class="portfolio-box">
<img class="img-fluid" src="/static/img/portfolio/thumbnails/{{ image.file }}" alt="{{ image.description }}">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category text-faded">
{{ image.subtitle }}
</div>
<div class="project-name">
{{ image.title }}
<br/><br/>
</div>
</div>
</div>
</a>
<button type="button" class="btn btn-success m-4"
hx-get="/edit/images/{{ bloc.name }}/{{ image.file }}"
hx-target="#editImg"
hw-swap="none">
<i class="fa fa-pencil-square-o"></i>
</button>
</div>
{% endif %}
{% endfor %}
</div>
</div>
</section>