Clean HTML for admin site

This commit is contained in:
2026-05-22 01:21:39 +02:00
committed by kitoy
parent 852d680b15
commit 7ee91198ef
5 changed files with 52 additions and 55 deletions

View File

@@ -189,9 +189,11 @@ class DataSite:
pageIndex.write_text(htmlExport) pageIndex.write_text(htmlExport)
def copy_static_files(self): def copy_static_files(self):
themesStaticFolder = Path(PurePosixPath('app').joinpath('static','themes', self.datas['config']['theme'],'static')) themesStaticFolder = Path(PurePosixPath('app').joinpath('static','themes', self.datas['config']['theme']))
publicStaticFolder = Path(PurePosixPath(self.user_folder).joinpath('public', 'static')) publicStaticFolder = Path(PurePosixPath(self.user_folder).joinpath('public', 'static', 'themes', self.datas['config']['theme']))
rmtree (publicStaticFolder, ignore_errors=True) rmtree (publicStaticFolder, ignore_errors=True)
copytree(themesStaticFolder, publicStaticFolder) copytree(themesStaticFolder, publicStaticFolder)
@@ -199,14 +201,11 @@ class DataSite:
remote_directory = "/remote/dir" remote_directory = "/remote/dir"
userDir = Path(PurePosixPath(self.user_folder)) userDir = Path(PurePosixPath(self.user_folder))
command = "lftp -u \"{}\",\"{}\" -p {} {} -e ' mirror -R public {}; chmod -R o+rx ./; bye;'".format(user, command = "lftp -u \"{}\",\"{}\" -p {} {} -e ' mirror -R public {}; chmod -R o+rx ./; bye;'".format(user,
password, password,
serverPort, serverPort,
serverAddress, serverAddress,
folder) folder)
print(command)
try: try:
subprocess.call(command, shell=True, cwd=str(userDir)) subprocess.call(command, shell=True, cwd=str(userDir))
except ChildProcessError: except ChildProcessError:

View File

@@ -1,8 +1,6 @@
<form class="sortblocs" action="/sortblocs" method="POST" id="myblocs">
<div id="myblocs" class="myblocs"> <div id="myblocs" class="myblocs">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
{% for item in myblocs.keys() %} {% for item in myblocs.keys() %}
<div class="bloc" id="bloc-{{ item }}" style="margin-top: 10px;"> <div class="bloc" id="bloc-{{ item }}" style="margin-top: 10px;">
@@ -15,6 +13,8 @@
</div> </div>
</form> </form>
<script src="/static/vendors/Sortable/Sortable.min.js"></script> <script src="/static/vendors/Sortable/Sortable.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">

View File

@@ -1,15 +1,12 @@
<div id="mypages"> <div id="mypages">
<ul style="list-style:none;" id="mypages" class="mypages"> <ul style="list-style:none;" id="mypages" class="mypages">
<li><a href="/"> <button class="btn"> Page d'accueil </button> </a> </li> <li><a href="/"> <button class="btn"> Page d'accueil </button> </a> </li>
{% for item in pagesList %} {% for item in pagesList %}
<li style="padding-top: 10px;"> <li style="padding-top: 10px;">
<a href="/{{ item }}/"> <a href="/{{ item }}/">
<button class="btn"> {{ item }} </button> <button class="btn"> {{ item }} </button>
</a> </a>
<a href="/rmPage/{{ item }}"><button class="btn btn-danger"> X </button></a> <a href="/rmPage/{{ item }}"><button class="btn btn-danger"> X </button></a>
</li> </li>
{% endfor %} {% endfor %}
@@ -19,7 +16,7 @@
<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éé un nouveau bloc</H3>
<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">
<input type="text" <input type="text"
@@ -32,7 +29,8 @@
Entrez le nom de la page sans espaces ni caractères spéciaux Entrez le nom de la page sans espaces ni caractères spéciaux
</div> </div>
</div> </div>
<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" required>

View File

@@ -12,7 +12,7 @@
id="serverAddress" id="serverAddress"
placeholder="sftp://mon_serveur.com, ou ftp://mon_serveur.com" placeholder="sftp://mon_serveur.com, ou ftp://mon_serveur.com"
required> required>
<dd<div class="invalid-feedback"> <div class="invalid-feedback">
L'upload a rencontrer n'a pas pu se faire. L'upload a rencontrer n'a pas pu se faire.
</div> </div>
</div> </div>

View File

@@ -13,7 +13,7 @@
{{ form.csrf_token }} {{ form.csrf_token }}
<h3 class="heading"> Connexion Mon site perso </h3> <h3 class="heading"> Connexion Mon site perso </h3>
<div class="inputContainer"> <div class="inputContainer">
<svg class="inputIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#2e2e2e" viewBox="0 0 16 16"> <svg class="inputIcon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="#2e2e2e" viewBox="0 0 16 16">
<path d="M13.106 7.222c0-2.967-2.249-5.032-5.482-5.032-3.35 0-5.646 2.318-5.646 5.702 0 3.493 2.235 5.708 5.762 5.708.862 0 1.689-.123 2.304-.335v-.862c-.43.199-1.354.328-2.29.328-2.926 0-4.813-1.88-4.813-4.798 0-2.844 1.921-4.881 4.594-4.881 2.735 0 4.608 1.688 4.608 4.156 0 1.682-.554 2.769-1.416 2.769-.492 0-.772-.28-.772-.76V5.206H8.923v.834h-.11c-.266-.595-.881-.964-1.6-.964-1.4 0-2.378 1.162-2.378 2.823 0 1.737.957 2.906 2.379 2.906.8 0 1.415-.39 1.709-1.087h.11c.081.67.703 1.148 1.503 1.148 1.572 0 2.57-1.415 2.57-3.643zm-7.177.704c0-1.197.54-1.907 1.456-1.907.93 0 1.524.738 1.524 1.907S8.308 9.84 7.371 9.84c-.895 0-1.442-.725-1.442-1.914z"></path> <path d="M13.106 7.222c0-2.967-2.249-5.032-5.482-5.032-3.35 0-5.646 2.318-5.646 5.702 0 3.493 2.235 5.708 5.762 5.708.862 0 1.689-.123 2.304-.335v-.862c-.43.199-1.354.328-2.29.328-2.926 0-4.813-1.88-4.813-4.798 0-2.844 1.921-4.881 4.594-4.881 2.735 0 4.608 1.688 4.608 4.156 0 1.682-.554 2.769-1.416 2.769-.492 0-.772-.28-.772-.76V5.206H8.923v.834h-.11c-.266-.595-.881-.964-1.6-.964-1.4 0-2.378 1.162-2.378 2.823 0 1.737.957 2.906 2.379 2.906.8 0 1.415-.39 1.709-1.087h.11c.081.67.703 1.148 1.503 1.148 1.572 0 2.57-1.415 2.57-3.643zm-7.177.704c0-1.197.54-1.907 1.456-1.907.93 0 1.524.738 1.524 1.907S8.308 9.84 7.371 9.84c-.895 0-1.442-.725-1.442-1.914z"></path>
</svg> </svg>
@@ -21,7 +21,7 @@
</div> </div>
<div class="inputContainer"> <div class="inputContainer">
<svg class="inputIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#2e2e2e" viewBox="0 0 16 16"> <svg class="inputIcon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="#2e2e2e" viewBox="0 0 16 16">
<path d="M8 1a2 2 0 0 1 2 2v4H6V3a2 2 0 0 1 2-2zm3 6V3a3 3 0 0 0-6 0v4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2z"></path> <path d="M8 1a2 2 0 0 1 2 2v4H6V3a2 2 0 0 1 2-2zm3 6V3a3 3 0 0 0-6 0v4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2z"></path>
</svg> </svg>