From c8dd4ac165c58f0c151237f40af011e22d7f72f4 Mon Sep 17 00:00:00 2001 From: Kobe Date: Wed, 28 May 2025 21:50:18 +0200 Subject: [PATCH] cache busting on CSS files --- app.py | 5 +++++ templates/auth/login.html | 4 ++-- templates/auth/register.html | 4 ++-- templates/common/base.html | 10 +++++----- templates/conversations/conversation.html | 2 +- templates/conversations/create_conversation.html | 2 +- templates/dashboard/dashboard.html | 2 +- templates/home.html | 2 +- templates/rooms/room.html | 2 +- templates/rooms/room_members.html | 2 +- templates/rooms/rooms.html | 2 +- templates/settings/settings.html | 2 +- templates/starred/starred.html | 2 +- templates/trash/trash.html | 2 +- 14 files changed, 24 insertions(+), 19 deletions(-) diff --git a/app.py b/app.py index c9e7db3..8d89b5f 100644 --- a/app.py +++ b/app.py @@ -24,6 +24,7 @@ def create_app(): app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False app.config['SECRET_KEY'] = os.getenv('SECRET_KEY', 'your-secure-secret-key-here') app.config['UPLOAD_FOLDER'] = os.path.join(app.root_path, 'static', 'uploads') + app.config['CSS_VERSION'] = os.getenv('CSS_VERSION', '1.0.0') # Add CSS version for cache busting # Initialize extensions db.init_app(app) @@ -36,6 +37,10 @@ def create_app(): def inject_csrf_token(): return dict(csrf_token=generate_csrf()) + @app.context_processor + def inject_config(): + return dict(config=app.config) + # User loader for Flask-Login @login_manager.user_loader def load_user(user_id): diff --git a/templates/auth/login.html b/templates/auth/login.html index bab79eb..b763b3f 100644 --- a/templates/auth/login.html +++ b/templates/auth/login.html @@ -6,8 +6,8 @@ Login - DocuPulse - - + + diff --git a/templates/auth/register.html b/templates/auth/register.html index d9143db..e75dab9 100644 --- a/templates/auth/register.html +++ b/templates/auth/register.html @@ -6,8 +6,8 @@ Register - DocuPulse - - + + diff --git a/templates/common/base.html b/templates/common/base.html index 131f4c0..193fb51 100644 --- a/templates/common/base.html +++ b/templates/common/base.html @@ -9,12 +9,12 @@ - - - + + + {% block extra_css %}{% endblock %} - + @@ -42,7 +42,7 @@ {% endif %}