feat(legal): easier customization#19846
Conversation
nijel
commented
Jun 1, 2026
- customization of the legal menu
- clarified when LEGAL_URL / PRIVACY_URL are applied
- support for customizing legal CSS
- the legal app can now utilize external documents
- clarified the customization documentation
There was a problem hiding this comment.
Pull request overview
This PR enhances the weblate.legal integration to make legal-page navigation, styling, and external-document usage more configurable, and updates templates/docs accordingly.
Changes:
- Introduces configurable legal document wrapper CSS class and support for hiding selected legal pages (404 + removed from menu).
- Adds shared helpers (
get_document_context,get_legal_menu) and wires them into views, context processors, and templates. - Updates documentation and expands test coverage for the new customization behavior.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| weblate/trans/context_processors.py | Injects legal document URLs/flags into global template context when weblate.legal is enabled. |
| weblate/templates/footer.html | Switches Terms/Privacy links to use computed terms_url / privacy_url (supports external fallbacks / hiding). |
| weblate/templates/accounts/snippets/login-info.html | Shows legal acceptance links conditionally based on available URLs. |
| weblate/settings_docker.py | Adds Docker env support for LEGAL_DOCUMENT_CSS_CLASS and LEGAL_HIDDEN_DOCUMENTS. |
| weblate/legal/views.py | Uses new utilities for menu + URL context; adds 404 behavior for hidden pages; passes CSS class into templates. |
| weblate/legal/utils.py | New utilities for menu filtering, hidden-document logic, and document URL context. |
| weblate/legal/tests.py | Adds tests for wrapper CSS class behavior, hidden pages, and external-document linking. |
| weblate/legal/templates/legal/terms.html | Makes wrapper CSS class configurable. |
| weblate/legal/templates/legal/privacy.html | Makes wrapper CSS class configurable. |
| weblate/legal/templates/legal/contracts.html | Makes wrapper CSS class configurable. |
| weblate/legal/templates/legal/index.html | Uses terms_url / privacy_url and omits links when unavailable. |
| weblate/legal/templates/legal/cookies.html | Uses terms_url / privacy_url and omits links when unavailable. |
| weblate/legal/templates/legal/confirm.html | Supports external/legal-hidden flow and configurable wrapper CSS class. |
| weblate/legal/models.py | Adds new appconf defaults for the new settings. |
| docs/changes.rst | Notes the new legal customization capabilities. |
| docs/admin/optionals.rst | Documents behavior and configuration semantics for legal URLs, hiding, and CSS class behavior. |
| docs/admin/install/docker.rst | Documents new Docker env vars for legal customization. |
| docs/admin/config.rst | Adds config reference entries for LEGAL_DOCUMENT_CSS_CLASS and LEGAL_HIDDEN_DOCUMENTS, and clarifies LEGAL_URL/PRIVACY_URL. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 14669fe486
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 544d42e021
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
d3f1317 to
1033256
Compare
- customization of the legal menu - clarified when LEGAL_URL / PRIVACY_URL are applied - support for customizing legal CSS - the legal app can now utilize external documents - clarified the customization documentation