Skip to content

Commit

Permalink
chore: add interlinks to the PDFs
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Nov 14, 2024
1 parent 802cbee commit 57617f4
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions weblate_web/legal/management/commands/generate_terms.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
HOSTED_ACCOUNT = "Hosted Weblate account"

OUT_DIR = Path(__file__).parent.parent.parent / "static"
GTC_NAME = "Weblate_General_Terms_and_Conditions.pdf"
PRIVACY_NAME = "Weblate_Privacy_Policy.pdf"


class Command(BaseCommand):
Expand All @@ -36,12 +38,22 @@ class Command(BaseCommand):
def handle(self, *args, **options):
render_pdf(
html=render_to_string(
"pdf/terms.html", {"title": "General Terms and Conditions"}
"pdf/terms.html",
{
"title": "General Terms and Conditions",
"privacy_url": f"https://weblate.org/static/{PRIVACY_NAME}",
},
),
output=OUT_DIR / "Weblate_General_Terms_and_Conditions.pdf",
output=OUT_DIR / GTC_NAME,
)

render_pdf(
html=render_to_string("pdf/privacy.html", {"title": "Privacy Policy"}),
output=OUT_DIR / "Weblate_Privacy_Policy.pdf",
html=render_to_string(
"pdf/privacy.html",
{
"title": "Privacy Policy",
"terms_url": f"https://weblate.org/static/{GTC_NAME}",
},
),
output=OUT_DIR / PRIVACY_NAME,
)

0 comments on commit 57617f4

Please sign in to comment.