Skip to content

feat(legal): easier customization#19846

Merged
nijel merged 1 commit into
WeblateOrg:mainfrom
nijel:legal-docs
Jun 1, 2026
Merged

feat(legal): easier customization#19846
nijel merged 1 commit into
WeblateOrg:mainfrom
nijel:legal-docs

Conversation

@nijel
Copy link
Copy Markdown
Member

@nijel 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

@nijel nijel added this to the 2026.7 milestone Jun 1, 2026
@nijel nijel requested a review from Copilot June 1, 2026 08:20
@nijel nijel self-assigned this Jun 1, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread weblate/legal/utils.py
Comment thread weblate/legal/templates/legal/confirm.html Outdated
Comment thread weblate/legal/templates/legal/confirm.html Outdated
@argos-ci
Copy link
Copy Markdown

argos-ci Bot commented Jun 1, 2026

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ⚠️ Changes detected (Review) 10 changed Jun 1, 2026, 12:19 PM

@nijel nijel enabled auto-merge (squash) June 1, 2026 09:19
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread weblate/legal/views.py
@nijel nijel disabled auto-merge June 1, 2026 09:27
@nijel nijel enabled auto-merge (rebase) June 1, 2026 09:44
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread weblate/api/spectacular.py
@nijel nijel force-pushed the legal-docs branch 2 times, most recently from d3f1317 to 1033256 Compare June 1, 2026 10:58
- 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
@nijel nijel merged commit f1ab944 into WeblateOrg:main Jun 1, 2026
27 of 31 checks passed
@nijel nijel deleted the legal-docs branch June 1, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants