From 7ee91198efe9d4e40519b15078fa79842d027535 Mon Sep 17 00:00:00 2001 From: kitoy Date: Fri, 22 May 2026 01:21:39 +0200 Subject: [PATCH] Clean HTML for admin site --- app/models/sites.py | 11 ++-- app/templates/admin/_blocs-list.html | 4 +- app/templates/admin/_pages-edit.html | 78 ++++++++++++++-------------- app/templates/admin/_publish.html | 10 ++-- app/templates/admin/login.html | 4 +- 5 files changed, 52 insertions(+), 55 deletions(-) diff --git a/app/models/sites.py b/app/models/sites.py index a676e40..24f0444 100644 --- a/app/models/sites.py +++ b/app/models/sites.py @@ -189,24 +189,23 @@ class DataSite: pageIndex.write_text(htmlExport) def copy_static_files(self): - themesStaticFolder = Path(PurePosixPath('app').joinpath('static','themes', self.datas['config']['theme'],'static')) - publicStaticFolder = Path(PurePosixPath(self.user_folder).joinpath('public', 'static')) + themesStaticFolder = Path(PurePosixPath('app').joinpath('static','themes', self.datas['config']['theme'])) + publicStaticFolder = Path(PurePosixPath(self.user_folder).joinpath('public', 'static', 'themes', self.datas['config']['theme'])) + rmtree (publicStaticFolder, ignore_errors=True) + copytree(themesStaticFolder, publicStaticFolder) def publish(self, user:str, password:str, serverAddress:str, serverPort:int, folder:str): remote_directory = "/remote/dir" userDir = Path(PurePosixPath(self.user_folder)) - command = "lftp -u \"{}\",\"{}\" -p {} {} -e ' mirror -R public {}; chmod -R o+rx ./; bye;'".format(user, - password, serverPort, serverAddress, - folder) - print(command) + folder) try: subprocess.call(command, shell=True, cwd=str(userDir)) except ChildProcessError: diff --git a/app/templates/admin/_blocs-list.html b/app/templates/admin/_blocs-list.html index 6ddc6b0..06a00f0 100644 --- a/app/templates/admin/_blocs-list.html +++ b/app/templates/admin/_blocs-list.html @@ -1,8 +1,6 @@ -
- {% for item in myblocs.keys() %}
@@ -15,6 +13,8 @@
+ +