fix: f-string brace crash from inline source JS

This commit is contained in:
claude
2026-08-24 13:36:34 -04:00
parent f3c483a58e
commit 27fcdd3d2b
2 changed files with 5 additions and 3 deletions
+5 -3
View File
@@ -480,6 +480,10 @@ FAQ = [
("Who can join?", "Every kid. Pack 73 and Troop 73 are open to all children and teens, whatever their background or beliefs. No exceptions, no fine print. If your kid wants to camp, build, and belong, they are one of us."),
]
SOURCE_JS = """<script>
(function(){var s=document.getElementById('source');if(!s)return;s.addEventListener('change',function(){var v=s.value;document.getElementById('source-place').style.display=v==='Other school or daycare'?'block':'none';document.getElementById('source-other').style.display=v==='Other'?'block':'none';});})();
</script>"""
def join_body(sent=False):
success = '<div class="success">Thanks! Your note is on its way. A leader will be in touch soon.</div>' if sent else ''
faq_html = "".join(f'<div class="faq"><div class="q">{q}</div><div class="a">{a}</div></div>' for q, a in FAQ)
@@ -519,9 +523,7 @@ def join_body(sent=False):
<button class="cta" type="submit" style="justify-self:start;font-size:16px;padding:14px 30px">Send interest form</button>
<div style="font-size:13px;color:#8B93A3">We only use this to reply about Scouting. No newsletters, no sharing.</div>
</form>
<script>
(function(){var s=document.getElementById('source');if(!s)return;s.addEventListener('change',function(){var v=s.value;document.getElementById('source-place').style.display=v==='Other school or daycare'?'block':'none';document.getElementById('source-other').style.display=v==='Other'?'block':'none';});})();
</script></div>
{SOURCE_JS}</div>
</div></section>
<section style="padding:64px 0 84px"><div class="wrap">
<div class="eyebrow dark">New-family FAQ</div><h2 class="sec" style="margin-bottom:30px">The questions every new family asks.</h2>