Big commit i'm sorry ...

This commit is contained in:
2026-05-09 01:53:54 +02:00
committed by kitoy
parent ced34339f9
commit 50829e9f60
184 changed files with 54564 additions and 588 deletions

View File

@@ -4,13 +4,15 @@ from werkzeug.utils import secure_filename
from app.forms import *
from PIL import Image
from os import remove, path
from pathlib import Path, PurePath, PurePosixPath
class MyBlocs:
def new(blocName, blocType):
def new(blocName, blocType, theme):
mybloc = None
if blocType in MyBlocs.listTypeBlocs():
if blocType in MyBlocs.listTypeBlocs(theme):
mybloc=dict()
mybloc['name'] = str(blocName)
mybloc['type'] = str(blocType)
@@ -26,4 +28,13 @@ class MyBlocs:
def newImgForm():
return ImageUpload()
def listTypeBlocs(theme):
typeBlocs = list()
folders = Path(PurePosixPath('./app').joinpath('templates', theme, 'blocs'))
for folder in folders.iterdir():
if not(folder.is_dir()):
typeBloc=folder.name.split('.')[0]
typeBlocs.append(typeBloc[1:])
return typeBlocs