From b7918179bb0c9c0eb3ef87a36417b1438f2a6f80 Mon Sep 17 00:00:00 2001 From: Alexander Winther Nielsen Date: Thu, 27 Nov 2025 00:08:15 +0100 Subject: [PATCH] feat: add version tag to nav bar --- .env.example | 2 ++ app.py | 8 ++++++++ static/css/style.css | 16 ++++++++++++++++ templates/components/header.html | 19 ++++++++++++------- 4 files changed, 38 insertions(+), 7 deletions(-) diff --git a/.env.example b/.env.example index 19aca00d..2ffa778c 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,5 @@ +APP_VERSION=dev + OPENAI_API_KEY="YOUR_OPENAI_API_KEY_GOES_HERE" # Database Environment Variables diff --git a/app.py b/app.py index c66eb24c..7c9d74bb 100644 --- a/app.py +++ b/app.py @@ -68,11 +68,19 @@ logger = logging.getLogger(__name__) +APP_VERSION = os.getenv("APP_VERSION", "dev") + sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) app = Flask(__name__) app.config["MAX_CONTENT_LENGTH"] = 50 * 1024 * 1024 # 50MB +@app.context_processor +def inject_app_version(): + """Inject APP_VERSION into all templates.""" + return {"APP_VERSION": APP_VERSION} + + # Initialize Clerk only if not in test mode if os.getenv("TEST_MODE") == "true": clerk_sdk = None diff --git a/static/css/style.css b/static/css/style.css index 692cf450..68e5208b 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -494,6 +494,22 @@ body { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); } + +.nav-version-badge { + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + padding: 4px 12px; + font-size: 0.8rem; + font-weight: 500; + border-radius: 999px; + background: rgba(0, 0, 0, 0.01); + border: 1px solid rgba(0, 0, 0, 0.05); + color: #b5b5b5; + letter-spacing: 0.05em; +} + .logo-title { display: flex; align-items: center; diff --git a/templates/components/header.html b/templates/components/header.html index 65f83574..a5fc48d0 100644 --- a/templates/components/header.html +++ b/templates/components/header.html @@ -11,11 +11,16 @@

Capstone 2025

+ + -
- {% if auth and showCreateProjectButton %} - - {% endif %} -
-
- + +
+ {% if auth and showCreateProjectButton %} + + {% endif %} +
+
+ +