correction for admin tools

This commit is contained in:
2026-07-23 04:33:33 +02:00
committed by kitoy
parent 2da8aad1a9
commit 545d15b7f6
5 changed files with 78 additions and 23 deletions

View File

@@ -3,7 +3,7 @@
<form action="{{ url_for('sortblocs', page=page) }}" method="POST" id="myblocs"> <form action="{{ url_for('sortblocs', page=page) }}" method="POST" id="myblocs">
<input id="csrf_token" name="csrf_token" type="hidden" value="{{ csrf_token() }}"> <input id="csrf_token" name="csrf_token" type="hidden" value="{{ csrf_token() }}">
{% include 'admin/_blocs-list.html' %} {% include 'admin/_blocs-list.html' %}
<br/>
<button class="btn btn-success" type="submit" form="myblocs"> Enregister </button> <button class="btn btn-success" type="submit" form="myblocs"> Enregister </button>
@@ -14,7 +14,7 @@
<button class="btn btn-outline-success" onclick="printForm()">+</button> <button class="btn btn-outline-success" onclick="printForm()">+</button>
<div class="formAddBloc" id="addBloc"> <div class="formAddBloc" id="addBloc">
<form action="/{{page}}/addBloc" id="addBloc" method="POST" class="" > <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() }}"> <input id="csrf_token" name="csrf_token" type="hidden" value="{{ csrf_token() }}">
<h3>Créé un nouveau bloc</H3> <h3>Créé un nouveau bloc</H3>
<br> <br>
@@ -34,20 +34,14 @@
<label for="link"><b>Type de bloc</b></label> <label for="link"><b>Type de bloc</b></label>
<br/> <br/>
<select id="blocType" name="blocType" size="8" required> <select id="blocType" name="blocType" size="8" required>
<option value="presentation"> Ecran d'Accueil </option> {% for bloc_type in type_blocs %}
<option value="presentation"> Image En-tête d'article </option> <option value="{{bloc_type}}"> {{ bloc_type }} </option>
<option value="text">Texte libre</option> {% endfor %}
<option value="simple_article">Article Simple</option>
<option value="gallery">Galerie</option>
<option value="external_link">Lien externe</option>
<option value="contact">Contact</option>
</select> </select>
<br/> <br/>
<button type="submit" class="btn btn-success" <button type="submit" class="btn btn-success"
onclick="valid_nameBloc()" onclick="valid_nameBloc()"
hx-post="{{ url_for('add_bloc', page=page) }}" > Créer le bloc </button>
hx-swap="outerHTML"
hx-target="#myblocs"> Créer le bloc </button>
</form> </form>
</div> </div>
<hr/> <hr/>

View File

@@ -64,7 +64,7 @@
{% include 'admin/_bloc-edit.html' %} {% include 'admin/_bloc-edit.html' %}
</div> </div>
<div class="modal-footer mx-auto"> <div class="modal-footer mx-auto">
<a class="btn btn-danger" href="/" > Annuler </a> <a class="btn btn-danger" href="{{url_for('edit', page=page)}}" > Fermer </a>
</div> </div>
</div> </div>
</div> </div>
@@ -82,7 +82,7 @@
{% include 'admin/_menu-edit.html' %} {% include 'admin/_menu-edit.html' %}
</div> </div>
<div class="modal-footer mx-auto"> <div class="modal-footer mx-auto">
<a class="btn btn-danger" href="/" > Annuler </a> <a class="btn btn-danger" href="{{url_for('edit', page=page)}}" > Fermer </a>
</div> </div>
</div> </div>
</div> </div>
@@ -100,7 +100,7 @@
{% include 'admin/_pages-edit.html' %} {% include 'admin/_pages-edit.html' %}
</div> </div>
<div class="modal-footer mx-auto"> <div class="modal-footer mx-auto">
<a class="btn btn-danger" href="/" > Annuler </a> <a class="btn btn-danger" href="{{url_for('edit', page=page)}}" > Fermer </a>
</div> </div>
</div> </div>
</div> </div>
@@ -125,7 +125,7 @@
<!-- Modal footer --> <!-- Modal footer -->
<div class="modal-footer mx-auto"> <div class="modal-footer mx-auto">
<a class="btn btn-danger" href="/" > Annuler </a> <a class="btn btn-danger" href="{{url_for('edit', page=page)}}" > Fermer </a>
</div> </div>
</div> </div>
</div> </div>
@@ -144,7 +144,7 @@
{% include 'admin/_publish.html' %} {% include 'admin/_publish.html' %}
</div> </div>
<div class="modal-footer mx-auto"> <div class="modal-footer mx-auto">
<a class="btn btn-danger" href="/" > Annuler </a> <a class="btn btn-danger" href="{{url_for('edit', page=page)}}" > Fermer </a>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -15,7 +15,7 @@
<div class="formAddPage" id="addPage"> <div class="formAddPage" id="addPage">
<form action="/addPage" id="addPage" method="POST" class="" > <form action="/addPage" id="addPage" method="POST" class="" >
<input id="csrf_token" name="csrf_token" type="hidden" value="{{ csrf_token() }}"> <input id="csrf_token" name="csrf_token" type="hidden" value="{{ csrf_token() }}">
<h3>Créé un nouveau bloc</H3> <h3>Créér une nouvelle page </h"3>
<br /> <br />
<label for="blocName">Nom du bloc (caractères sans accents uniquement) </label> <label for="blocName">Nom du bloc (caractères sans accents uniquement) </label>
<div class="input-group"> <div class="input-group">
@@ -33,10 +33,11 @@
<br /> <br />
<label for="link"><b>Type de bloc</b></label> <label for="link"><b>Type de bloc</b></label>
<br/> <br/>
<select id="pageType" name="pageType" size="8" required> <select id="pageType" name="pageType" size="8" style="width:70%;" required>
<option value="article_image"> Article avec une image d'en tête </option> {% for page_type in type_pages %}
<option value="simple_article"> Page blanche Texte libre </option> <option value="{{page_type}}"> {{page_type}} </option>
</select> {% endfor %}
</select>
<br/> <br/>
<button type="submit" class="btn btn-success" <button type="submit" class="btn btn-success"
onclick="valid_nameBloc()"> Créer la page </button> onclick="valid_nameBloc()"> Créer la page </button>

View File

@@ -0,0 +1,60 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/static/css/monsiteperso.css">
<title>Login</title>
</head>
<body>
<div class="login-box">
<form action="/create-website" method="POST" class="form_main">
{{ form.csrf_token }}
<h3 class="heading"> Création du site </h3>
<div class="inputContainer">
{{ form.login.label }} :
{{ form.login(col=10, class="inputField" ) }}
{% if form.passwd_confirm.errors %}
{% for error in form.login.errors %}
<small class="errors">{{ error }}</small>
{% endfor %}
{% endif %}
</div>
<div class="inputContainer">
{{ form.passwd.label }}:
{{ form.passwd(class="inputField" ) }}
{% if form.passwd.errors %}
<small class="errors">{{ form.passwd.errors[0] }}</small>
{% endif %}
</div>
<div class="inputContainer">
{{ form.passwd_confirm.label }}:
{{ form.passwd_confirm(class="inputField" ) }}
{% if form.passwd.errors %}
<small class="errors">{{ form.passwd.errors[0] }}</small>
{% endif %}
</div>
<div class="inputContainer">
{{ form.site_title.label }}:
{{ form.site_title(col=10, class="inputField" ) }}
</div>
<div class="inputContainer">
{{ form.theme.label }}:
{{ form.theme(col=10, class="inputField" ) }}
</div>
{{ form.submit(class="button") }}
</form>
</div>
</body>
</html>

View File

@@ -29,7 +29,7 @@
</div> </div>
{{ form.submit() }} {{ form.submit() }}
<a class="forgotLink" href="#"> J'ai oublié mon mot de passe </a> <a class="forgotLink" href="/new-website"> Créer un nouveau site oueb </a>
</form> </form>
</div> </div>
</body> </body>