Study guide button downloads the file directly with no name/email form; v2.36.1
Publish Container / build (push) Successful in 15m3s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nmemmertandClaude Sonnet 5.5 committed 2026-10-13 09:56:20 -04:00
1 parent fed2b6bacc
commit 753b5c77cf
4 files changed
+11 -7

No files matched your search

+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "siteforge", "name": "siteforge",
"version": "2.36.0", "version": "2.36.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "siteforge", "name": "siteforge",
"version": "2.36.0", "version": "2.36.1",
"dependencies": { "dependencies": {
"@aws-sdk/client-s3": "^3.1135.0", "@aws-sdk/client-s3": "^3.1135.0",
"@dnd-kit/core": "^6.3.1", "@dnd-kit/core": "^6.3.1",
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "siteforge", "name": "siteforge",
"private": true, "private": true,
"version": "2.36.0", "version": "2.36.1",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
+5 -3
View File
@@ -710,6 +710,8 @@ export interface StudyGuideLink {
// Page id under /downloads/ (primary-guide, second-guide, book-guide--<id>) // Page id under /downloads/ (primary-guide, second-guide, book-guide--<id>)
pageId: string pageId: string
title: string title: string
// Direct file link, when the guide has one; otherwise the button opens the guide's page (store links)
downloadUrl?: string
} }
// The companion guide a study offers, either chosen explicitly in admin or found through the // The companion guide a study offers, either chosen explicitly in admin or found through the
@@ -723,13 +725,13 @@ export function getStudyGuideLink(
const primary = (): StudyGuideLink | null => const primary = (): StudyGuideLink | null =>
content.studyGuideTitle && (content.studyGuideUrl || content.studyGuideDownloadUrl || content.studyGuideAppleBooksUrl) content.studyGuideTitle && (content.studyGuideUrl || content.studyGuideDownloadUrl || content.studyGuideAppleBooksUrl)
? { pageId: 'primary-guide', title: content.studyGuideTitle } ? { pageId: 'primary-guide', title: content.studyGuideTitle, downloadUrl: content.studyGuideDownloadUrl || undefined }
: null : null
const second = (): StudyGuideLink | null => const second = (): StudyGuideLink | null =>
content.secondSeries?.guide?.title ? { pageId: 'second-guide', title: content.secondSeries.guide.title } : null content.secondSeries?.guide?.title ? { pageId: 'second-guide', title: content.secondSeries.guide.title, downloadUrl: content.secondSeries.guide.downloadUrl || undefined } : null
const book = (id: string): StudyGuideLink | null => { const book = (id: string): StudyGuideLink | null => {
const found = (content.finishedBooks ?? []).find(b => b.id === id) const found = (content.finishedBooks ?? []).find(b => b.id === id)
return found?.guide?.title ? { pageId: `book-guide--${found.id}`, title: found.guide.title } : null return found?.guide?.title ? { pageId: `book-guide--${found.id}`, title: found.guide.title, downloadUrl: found.guide.downloadUrl || undefined } : null
} }
if (source === 'primary') return primary() if (source === 'primary') return primary()
+3 -1
View File
@@ -1743,7 +1743,9 @@ export function ColossiansStudyIndexPage({ content }: Props) {
{enrolling ? 'Enrolling...' : 'Enroll in This Study'} {enrolling ? 'Enrolling...' : 'Enroll in This Study'}
</button> </button>
)} )}
{studyGuide && <Link to={`/downloads/${studyGuide.pageId}`} className="btn-secondary">📄 Download Study Guide</Link>} {studyGuide && (studyGuide.downloadUrl
? <a href={studyGuide.downloadUrl} target="_blank" rel="noopener noreferrer" download className="btn-secondary">📄 Download Study Guide</a>
: <Link to={`/downloads/${studyGuide.pageId}`} className="btn-secondary">📄 Get the Study Guide</Link>)}
{allLessonsDone && <Link to="/study/account" className="btn-secondary">🏅 My Certificate</Link>} {allLessonsDone && <Link to="/study/account" className="btn-secondary">🏅 My Certificate</Link>}
{enrolled && <Link to={`/study/${study.slug}/notes`} className="btn-secondary">My Notes</Link>} {enrolled && <Link to={`/study/${study.slug}/notes`} className="btn-secondary">My Notes</Link>}
{enrolled && studyStatus !== 'planned' && <Link to={`/study/${study.slug}/community`} className="btn-secondary">Community</Link>} {enrolled && studyStatus !== 'planned' && <Link to={`/study/${study.slug}/community`} className="btn-secondary">Community</Link>}