feat(prelogin): public marketing site at /#1167
Conversation
New `commcare_connect.prelogin` Django app — visitors to `/` land on a
self-contained marketing page (mockup sourced manually from
dimagi-internal/connect-prelogin) instead of the previous
`pages/home.html` template. The header Login CTA's URL is
configurable via the `PRELOGIN_APP_LOGIN_URL` setting (default
`/accounts/login/`).
Notes
- App is intentionally self-contained (no commcare-connect-specific
imports beyond the setting) so the same files can also live in
parallel deployments (labs).
- The mockup template is a single self-contained HTML document with
inline `<style>`; it does not extend `base.html`. Two prep edits
applied at re-import time and documented at the top of the file:
strip the `.mockup-bar` mockup banner element + CSS, and template
the login link's `href`.
- The previous global `name="home"` URL is now namespaced as
`prelogin:home`; the one inbound `reverse("home")` call in
`users/views.py` is updated.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
WalkthroughThis pull request introduces a new Django app Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
Product Description
Visitors to
/now land on a public marketing page (currently a placeholder mockup from Gillian, sourced manually fromdimagi-internal/connect-prelogin) instead of the existingpages/home.htmltemplate. A header Login CTA takes signed-in users to/accounts/login/(which then bounces them onward viaLOGIN_REDIRECT_URL = users:redirect); anonymous visitors see the marketing page. Sign Up CTA links out toconnect.dimagi.com/accounts/signup/.This is the public-facing companion to a parallel landing site running on
labs.connect.dimagi.com/(connect-labs#169 — already merged). The newpreloginapp is intentionally self-contained (no labs-specific or connect-specific imports beyond the one configurable setting) so the two deployments can stay in sync.Technical Summary
commcare_connect/prelogin/with oneTemplateViewfor/.commcare_connect/templates/prelogin/home.htmlas a self-contained document (own DOCTYPE + inline<style>, nobase.htmlextension — the mockup ships its own typography and palette).PRELOGIN_APP_LOGIN_URLsetting; default/accounts/login/.TemplateView(template_name="pages/home.html")at/.home.html: strip the.mockup-barelement + its CSS rule (the top "MOCKUP" banner used in Gillian's preview), and template the login link'shref.name="home"is now namespaced asprelogin:home; the one inboundreverse("home")call incommcare_connect/users/views.pyis updated.Layout follows the project's house-style conventions (per
CLAUDE.md):commcare_connect/prelogin/tests/test_views.py(directory layout,pytest.mark-style fixture-based tests).commcare_connect/templates/prelogin/(not app-local).static/; future static assets go in top-levelcommcare_connect/static/prelogin/.Safety Assurance
Safety story
Static page, no models, no migrations, no data access, no auth changes. The only behavioral change is that
/no longer renderspages/home.html— anonymous and authenticated visitors both see the marketing page; logged-in users navigate into the app via the header Login CTA (which falls through to allauth, which then forwards them viaLOGIN_REDIRECT_URL). Blast radius: anyone with/bookmarked who expected the oldpages/home.htmlcontent gets the new marketing page instead.Automated test coverage
Three tests in
commcare_connect/prelogin/tests/test_views.py:test_renders_with_brand—GET /returns 200 with expected branding text.test_login_url_defaults_to_accounts_login— verifies the default for the login CTA.test_login_url_respects_setting_override— locks the contract that thePRELOGIN_APP_LOGIN_URLoverride flows through.QA Plan
/on the deployed environment and confirm the marketing page renders without the "MOCKUP · Connect by Dimagi · v11 reshape …" top banner./accounts/login/(and from there forwards correctly for already-signed-in users).connect.dimagi.com/accounts/signup/.🤖 Generated with Claude Code