fix(bigmind): fix static image path, JS string concat in achievements; add networker badge PNGs

This commit is contained in:
pplate
2026-04-04 19:01:56 +02:00
parent 50488109aa
commit e61c9c98f5
5 changed files with 7 additions and 7 deletions
+5 -5
View File
@@ -571,7 +571,7 @@ def compute_achievements(user_id: str) -> list[dict]:
f"Added your {thresh:,}+ person to the directory",
unlocked, unlocked_at,
f"Reach {thresh:,} people (now: {people_count:,})",
image=f"static/achievements/networker_{tiers[i]}.png"
image=f"/static/achievements/networker_{tiers[i]}.png"
)
# Token Sniper (max single token save)
@@ -601,7 +601,7 @@ def compute_achievements(user_id: str) -> list[dict]:
f"Single shot saved {thresh:,}+ tokens",
unlocked, unlocked_at,
f"Max single save {thresh:,}+ (current max: {max_token:,})",
image=f"static/achievements/tokensniper_{tiers[i]}.png"
image=f"/static/achievements/tokensniper_{tiers[i]}.png"
)
# Hypothesis Master (confirmed hypotheses)
@@ -628,7 +628,7 @@ def compute_achievements(user_id: str) -> list[dict]:
f"Confirmed {thresh:,}+ predictions right",
unlocked, unlocked_at,
f"Confirm {thresh:,}+ hypotheses (now: {confirmed_hyp_count:,})",
image=f"static/achievements/hypothesismaster_{tiers[i]}.png"
image=f"/static/achievements/hypothesismaster_{tiers[i]}.png"
)
# Memory Architect (facts stored — fact_count already computed above)
@@ -648,7 +648,7 @@ def compute_achievements(user_id: str) -> list[dict]:
f"Stored {thresh:,}+ facts in your brain",
unlocked, unlocked_at,
f"Store {thresh:,}+ facts (now: {fact_count:,})",
image=f"static/achievements/memoryarchitect_{tiers[i]}.png"
image=f"/static/achievements/memoryarchitect_{tiers[i]}.png"
)
# Session Veteran (session_count already computed above)
@@ -668,7 +668,7 @@ def compute_achievements(user_id: str) -> list[dict]:
f"Completed {thresh:,}+ sessions",
unlocked, unlocked_at,
f"Complete {thresh:,}+ sessions (now: {session_count:,})",
image=f"static/achievements/sessionveteran_{tiers[i]}.png"
image=f"/static/achievements/sessionveteran_{tiers[i]}.png"
)
return A
Binary file not shown.

After

Width:  |  Height:  |  Size: 251 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 KiB

+1 -1
View File
@@ -163,7 +163,7 @@ def _create_app():
def achievements_image(filename: str):
from pathlib import Path
safe_name = Path(filename).name
img_path = Path('static') / 'achievements' / safe_name
img_path = Path(__file__).parent / 'static' / 'achievements' / safe_name
if img_path.exists() and img_path.suffix.lower() in ['.png', '.jpg', '.jpeg', '.webp', '.gif']:
mimetype = {
'.png': 'image/png',
+1 -1
View File
@@ -628,7 +628,7 @@ def _render_html(data: dict) -> str:
var d = card.dataset;
var tier = d.id.split('_').pop();
if (d.image) {{
document.getElementById('ap-icon').innerHTML = "<img class=\"ap-image tier-\" + tier + \" src=\" + d.image + \" alt=\" + d.name + \">";
document.getElementById('ap-icon').innerHTML = '<img class="ap-image tier-' + tier + '" src="' + d.image + '" alt="' + d.name + '">';
}} else {{
document.getElementById('ap-icon').textContent = d.icon;
}}