Add whitepaper section with gated downloads - #183
Conversation
WalkthroughAdds German and English whitepaper metadata, navigation, translations, responsive listing pages, and detail pages. Available whitepapers provide CAPTCHA-protected request forms with success and error states. Coming-soon whitepapers omit the form. Detail pages render covers, related whitepapers, and environment-specific assets. The webinar template now uses the shared inbox hint translation key. Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@content/whitepaper/zero-knowledge-cloud-encryption.de.html`:
- Around line 7-9: Gate both localized zero-knowledge whitepaper pages on a
valid EspoCRM record ID: in
content/whitepaper/zero-knowledge-cloud-encryption.de.html lines 7-9 and
content/whitepaper/zero-knowledge-cloud-encryption.en.html lines 7-9, populate
espoId before retaining comingsoon: false, or set comingsoon: true until the
corresponding records exist.
In `@layouts/whitepaper/single.html`:
- Line 19: Update the form submit handler using x-ref="form" so CAPTCHA reset
occurs only when the form passes native validation. Gate the existing
apiForm.request() and $refs.captcha.reset() flow with the form’s validity,
preserving the current request behavior while avoiding reset on invalid
submissions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 6b684048-b8dd-4349-9c34-2a2a2fdc6ad2
📒 Files selected for processing (14)
content/whitepaper/_index.de.htmlcontent/whitepaper/_index.en.htmlcontent/whitepaper/gdpr-compliant-cloud-collaboration.de.htmlcontent/whitepaper/gdpr-compliant-cloud-collaboration.en.htmlcontent/whitepaper/zero-knowledge-cloud-encryption.de.htmlcontent/whitepaper/zero-knowledge-cloud-encryption.en.htmldata/nav.yamli18n/de.yamli18n/en.yamllayouts/partials/whitepaper-cover.htmllayouts/partials/whitepaper-grid.htmllayouts/webinar/single.htmllayouts/whitepaper/list.htmllayouts/whitepaper/single.html
| comingsoon: false | ||
| weight: 10 | ||
| espoId: "" # ID of the CWhitepaper record in EspoCRM |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Gate both localized download pages on the EspoCRM record ID.
Both files set comingsoon to false while espoId is empty. layouts/whitepaper/single.html copies that value into submitData.whitepaperId, so both forms submit without a CWhitepaper identifier. Populate the record ID before enabling the pages, or set comingsoon: true until the records exist.
content/whitepaper/zero-knowledge-cloud-encryption.de.html#L7-L9: populateespoIdbefore keepingcomingsoon: false.content/whitepaper/zero-knowledge-cloud-encryption.en.html#L7-L9: apply the same release gate and record ID.
📍 Affects 2 files
content/whitepaper/zero-knowledge-cloud-encryption.de.html#L7-L9(this comment)content/whitepaper/zero-knowledge-cloud-encryption.en.html#L7-L9
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@content/whitepaper/zero-knowledge-cloud-encryption.de.html` around lines 7 -
9, Gate both localized zero-knowledge whitepaper pages on a valid EspoCRM record
ID: in content/whitepaper/zero-knowledge-cloud-encryption.de.html lines 7-9 and
content/whitepaper/zero-knowledge-cloud-encryption.en.html lines 7-9, populate
espoId before retaining comingsoon: false, or set comingsoon: true until the
corresponding records exist.
| <p class="lead mb-10">{{ .Params.abstract }}</p> | ||
|
|
||
| {{ if not .Params.comingsoon }} | ||
| <form x-ref="form" @submit.prevent="apiForm.request(); $refs.captcha.reset()"> |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Avoid resetting the CAPTCHA on a plain validation failure.
$refs.captcha.reset() runs on every submit attempt, even when apiForm.request() only fails native form validation and never sends a request. The user then must solve the CAPTCHA again just to fix a missing field.
Gate the reset on native form validity, so the CAPTCHA is only reset when an actual submission attempt is made.
💡 Proposed fix
-<form x-ref="form" `@submit.prevent`="apiForm.request(); $refs.captcha.reset()">
+<form x-ref="form" `@submit.prevent`="if ($refs.form.checkValidity()) { $refs.captcha.reset() }; apiForm.request()">📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <form x-ref="form" @submit.prevent="apiForm.request(); $refs.captcha.reset()"> | |
| <form x-ref="form" `@submit.prevent`="if ($refs.form.checkValidity()) { $refs.captcha.reset() }; apiForm.request()"> |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@layouts/whitepaper/single.html` at line 19, Update the form submit handler
using x-ref="form" so CAPTCHA reset occurs only when the form passes native
validation. Gate the existing apiForm.request() and $refs.captcha.reset() flow
with the form’s validity, preserving the current request behavior while avoiding
reset on invalid submissions.
Adds a bilingual whitepaper section with an overview page, detail pages with a gated download form, and a nav entry under Resources. The download link will be sent by email; the required backend endpoint and EspoCRM records do not exist yet.