Improve image loading by handling different storage paths

Add a custom Jinja filter `image_url` to `app.py` to correctly resolve image paths from object storage or local static files, and update all relevant templates (members, sponsors, competitions, contributors) to use this new filter instead of the `url_for('static', filename=...)` function, ensuring images are displayed correctly regardless of their storage location.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: cd9a7d26-a4e5-4215-975c-c59f4ed1f06d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: a02b1418-2e19-496d-9921-3a4afe97ac0d
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/d0a1d46d-d203-4308-bc6a-312ac7c0243b/cd9a7d26-a4e5-4215-975c-c59f4ed1f06d/05bPjFc
This commit is contained in:
abhiramtx
2025-12-13 21:43:34 +00:00
parent 7f9612493c
commit d7532b7134
6 changed files with 16 additions and 7 deletions

View File

@@ -146,7 +146,7 @@
{% for sponsor in sponsors %}
<div class="sponsor-card-admin">
{% if sponsor.logo_path %}
<img src="{{ url_for('static', filename=sponsor.logo_path) }}" class="sponsor-logo-admin" alt="{{ sponsor.name }}">
<img src="{{ sponsor.logo_path|image_url }}" class="sponsor-logo-admin" alt="{{ sponsor.name }}">
{% endif %}
<h3 class="sponsor-name-admin">{{ sponsor.name }}</h3>
{% if sponsor.website_url %}