Studies: add a Download Study Guide button to the study page, automatic from the linked series/book or chosen per study in admin; v2.35.0
Publish Container / build (push) Successful in 18m26s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nmemmertandClaude Sonnet 5.5 committed 2026-10-13 08:16:44 -04:00
1 parent b48a81a00c
commit 82ce312898
6 files changed
+60 -3

No files matched your search

+13
View File
@@ -6013,6 +6013,19 @@ const [dashboardNow, setDashboardNow] = useState(() => new Date())
<label htmlFor={`study-chapters-${activeStudy.id}`}>Number of Chapters</label>
<input id={`study-chapters-${activeStudy.id}`} type="number" min="1" max="999" value={activeStudy.numberOfChapters} placeholder="4" onChange={e => updateStudyProgram(activeStudy.id, 'numberOfChapters', Number(e.target.value) || 1)} />
</div>
<div className="admin-field">
<label htmlFor={`study-guide-source-${activeStudy.id}`}>Study Guide Download</label>
<select id={`study-guide-source-${activeStudy.id}`} value={activeStudy.guideSource ?? ''} onChange={e => updateStudyProgram(activeStudy.id, 'guideSource', e.target.value)}>
<option value="">Automatic (guide of the series or book linked to this study)</option>
<option value="none">None — don&rsquo;t show a guide button</option>
{form.studyGuideTitle && <option value="primary">Current series guide: {form.studyGuideTitle}</option>}
{form.secondSeries?.guide?.title && <option value="second">Second series guide: {form.secondSeries.guide.title}</option>}
{(form.finishedBooks ?? []).filter(b => b.guide?.title).map(b => (
<option key={b.id} value={`book:${b.id}`}>{b.title}: {b.guide?.title}</option>
))}
</select>
<p className="admin-field-help">Adds a &ldquo;Download Study Guide&rdquo; button to this study&rsquo;s page. Visitors enter their name and email to get the file.</p>
</div>
<div className="admin-field" style={{ display: 'flex', alignItems: 'center', gap: '0.6rem' }}>
<input id={`study-home-feature-${activeStudy.id}`} type="checkbox" checked={activeStudy.showOnHomepage === true} onChange={e => updateStudyProgram(activeStudy.id, 'showOnHomepage', e.target.checked)} />
<label htmlFor={`study-home-feature-${activeStudy.id}`}>Feature this study card on homepage</label>