fix(bigmind): fix static image path, JS string concat in achievements; add networker badge PNGs
This commit is contained in:
@@ -571,7 +571,7 @@ def compute_achievements(user_id: str) -> list[dict]:
|
|||||||
f"Added your {thresh:,}+ person to the directory",
|
f"Added your {thresh:,}+ person to the directory",
|
||||||
unlocked, unlocked_at,
|
unlocked, unlocked_at,
|
||||||
f"Reach {thresh:,} people (now: {people_count:,})",
|
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)
|
# Token Sniper (max single token save)
|
||||||
@@ -601,7 +601,7 @@ def compute_achievements(user_id: str) -> list[dict]:
|
|||||||
f"Single shot saved {thresh:,}+ tokens",
|
f"Single shot saved {thresh:,}+ tokens",
|
||||||
unlocked, unlocked_at,
|
unlocked, unlocked_at,
|
||||||
f"Max single save {thresh:,}+ (current max: {max_token:,})",
|
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)
|
# Hypothesis Master (confirmed hypotheses)
|
||||||
@@ -628,7 +628,7 @@ def compute_achievements(user_id: str) -> list[dict]:
|
|||||||
f"Confirmed {thresh:,}+ predictions right",
|
f"Confirmed {thresh:,}+ predictions right",
|
||||||
unlocked, unlocked_at,
|
unlocked, unlocked_at,
|
||||||
f"Confirm {thresh:,}+ hypotheses (now: {confirmed_hyp_count:,})",
|
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)
|
# 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",
|
f"Stored {thresh:,}+ facts in your brain",
|
||||||
unlocked, unlocked_at,
|
unlocked, unlocked_at,
|
||||||
f"Store {thresh:,}+ facts (now: {fact_count:,})",
|
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)
|
# Session Veteran (session_count already computed above)
|
||||||
@@ -668,7 +668,7 @@ def compute_achievements(user_id: str) -> list[dict]:
|
|||||||
f"Completed {thresh:,}+ sessions",
|
f"Completed {thresh:,}+ sessions",
|
||||||
unlocked, unlocked_at,
|
unlocked, unlocked_at,
|
||||||
f"Complete {thresh:,}+ sessions (now: {session_count:,})",
|
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
|
return A
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 251 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 294 KiB |
@@ -163,7 +163,7 @@ def _create_app():
|
|||||||
def achievements_image(filename: str):
|
def achievements_image(filename: str):
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
safe_name = Path(filename).name
|
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']:
|
if img_path.exists() and img_path.suffix.lower() in ['.png', '.jpg', '.jpeg', '.webp', '.gif']:
|
||||||
mimetype = {
|
mimetype = {
|
||||||
'.png': 'image/png',
|
'.png': 'image/png',
|
||||||
|
|||||||
@@ -628,7 +628,7 @@ def _render_html(data: dict) -> str:
|
|||||||
var d = card.dataset;
|
var d = card.dataset;
|
||||||
var tier = d.id.split('_').pop();
|
var tier = d.id.split('_').pop();
|
||||||
if (d.image) {{
|
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 {{
|
}} else {{
|
||||||
document.getElementById('ap-icon').textContent = d.icon;
|
document.getElementById('ap-icon').textContent = d.icon;
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user