diff --git a/store/app.py b/store/app.py index 50c2f5a4..5c527f16 100644 --- a/store/app.py +++ b/store/app.py @@ -61,9 +61,7 @@ for key in mandatory_config_keys: print(f"Missing key in config.toml: {key}") sys.exit(1) -if config.get("DEBUG"): - app.debug = True - app.config["DEBUG"] = True +if app.config.get("DEBUG"): app.config["TEMPLATES_AUTO_RELOAD"] = True # This is the secret key used for session signing @@ -86,11 +84,16 @@ def localize(d): @app.context_processor def utils(): - return { + d = { "user": session.get("user", {}), "locale": get_locale(), } + if app.config.get("DEBUG"): + d["tailwind_local"] = open("assets/tailwind-local.css").read() + + return d + ############################################################################### diff --git a/store/assets/fetch_assets b/store/assets/fetch_assets index 99c250da..fdfe432c 100644 --- a/store/assets/fetch_assets +++ b/store/assets/fetch_assets @@ -1,13 +1,19 @@ -# Download standalone tailwind to compile what we need + +# Production -> download standalone tailwind to compile only what we need wget https://github.com/tailwindlabs/tailwindcss/releases/download/v3.3.3/tailwindcss-linux-x64 chmod +x tailwindcss-linux-x64 ./tailwindcss-linux-x64 --input tailwind-local.css --output tailwind.css --minify +# Development -> we use the JS magic thingy +curl -L https://cdn.tailwindcss.com?plugins=forms > tailwind-css.js + +# Forkawesome curl https://cdn.jsdelivr.net/npm/fork-awesome@1.2.0/css/fork-awesome.min.css > fork-awesome.min.css sed -i 's@../fonts/@@g' ./fork-awesome.min.css curl https://cdn.jsdelivr.net/npm/fork-awesome@1.2.0/fonts/forkawesome-webfont.woff2?v=1.2.0 > forkawesome-webfont.woff2 curl https://cdn.jsdelivr.net/npm/fork-awesome@1.2.0/fonts/forkawesome-webfont.woff?v=1.2.0 > forkawesome-webfont.woff curl https://cdn.jsdelivr.net/npm/fork-awesome@1.2.0/fonts/forkawesome-webfont.ttf?v=1.2.0 > forkawesome-webfont.ttf +# Logos curl https://raw.githubusercontent.com/YunoHost/doc/master/images/logo_roundcorner.png > ynh_logo_roundcorner.png curl https://raw.githubusercontent.com/YunoHost/doc/master/images/ynh_logo_black.svg > ynh_logo_black.svg diff --git a/store/assets/tailwind-local.css b/store/assets/tailwind-local.css index 787ba1d2..5bc57a74 100644 --- a/store/assets/tailwind-local.css +++ b/store/assets/tailwind-local.css @@ -3,6 +3,9 @@ @tailwind utilities; @layer utilities { + body { + @apply text-gray-800; + } .btn { @apply text-sm font-medium rounded-md px-4 py-2 transition; } diff --git a/store/requirements.txt b/store/requirements.txt index 82089229..17b47a6f 100644 --- a/store/requirements.txt +++ b/store/requirements.txt @@ -1,10 +1,32 @@ -Flask==2.3.2 -python-slugify -PyGithub -toml -tomlkit -pycmarkgfm -gunicorn -emoji -Babel -Flask-Babel +Babel==2.14.0 +blinker==1.8.1 +certifi==2024.2.2 +cffi==1.16.0 +charset-normalizer==3.3.2 +click==8.1.7 +cryptography==42.0.5 +Deprecated==1.2.14 +emoji==2.11.1 +Flask==3.0.3 +flask-babel==4.0.0 +gunicorn==22.0.0 +idna==3.7 +itsdangerous==2.2.0 +Jinja2==3.1.3 +MarkupSafe==2.1.5 +packaging==24.0 +pycmarkgfm==1.2.1 +pycparser==2.22 +PyGithub==2.3.0 +PyJWT==2.8.0 +PyNaCl==1.5.0 +python-slugify==8.0.4 +pytz==2024.1 +requests==2.31.0 +text-unidecode==1.3 +toml==0.10.2 +tomlkit==0.12.4 +typing_extensions==4.11.0 +urllib3==2.2.1 +Werkzeug==3.0.2 +wrapt==1.16.0 diff --git a/store/templates/app.html b/store/templates/app.html index 85c039de..e07cfcf7 100644 --- a/store/templates/app.html +++ b/store/templates/app.html @@ -16,7 +16,7 @@ loading="lazy" class="h-12 w-12 rounded-lg object-cover shadow-sm mt-1" > -