-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- these can be automatically generated from wllegal - added download to the pages
- Loading branch information
Showing
11 changed files
with
210 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# | ||
# Copyright © Michal Čihař <[email protected]> | ||
# | ||
# This file is part of Weblate <https://weblate.org/> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
# | ||
|
||
from pathlib import Path | ||
|
||
from django.core.management.base import BaseCommand | ||
from django.template.loader import render_to_string | ||
|
||
from weblate_web.pdf import render_pdf | ||
|
||
HOSTED_ACCOUNT = "Hosted Weblate account" | ||
|
||
OUT_DIR = Path(__file__).parent.parent.parent / "static" | ||
|
||
|
||
class Command(BaseCommand): | ||
help = "generates legal PDFs" | ||
client = None | ||
|
||
def handle(self, *args, **options): | ||
render_pdf( | ||
html=render_to_string( | ||
"pdf/terms.html", {"title": "General Terms and Conditions"} | ||
), | ||
output=OUT_DIR / "Weblate_General_Terms_and_Conditions.pdf", | ||
) | ||
|
||
render_pdf( | ||
html=render_to_string("pdf/privacy.html", {"title": "Privacy Policy"}), | ||
output=OUT_DIR / "Weblate_Privacy_Policy.pdf", | ||
) |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<link href="legal:pdf/legal.css" media="print" rel="stylesheet"> | ||
<title>Weblate {{ title }}</title> | ||
<meta name="dcterms.created" content="{% now "c" %}"> | ||
<meta name="author" content="Weblate s.r.o."> | ||
</head> | ||
|
||
<body> | ||
<header> | ||
<img class="logo" src="invoices:invoice-logo.svg" alt="Weblate"> | ||
</header> | ||
|
||
<h1>{{ title }}</h1> | ||
|
||
{% block content %} | ||
{% endblock content %} | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
@page { | ||
margin: 3.5cm 1cm 3cm 1cm; | ||
@bottom-right { | ||
content: "Page " counter(page) " of " counter(pages); | ||
} | ||
} | ||
|
||
html, | ||
a { | ||
color: #14213d; | ||
font-family: Source Sans Pro; | ||
font-size: 11pt; | ||
line-height: 1.6; | ||
} | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
header { | ||
display: block; | ||
padding-bottom: 1.3cm; | ||
position: fixed; | ||
left: 0; | ||
right: 0; | ||
top: -2.5cm; | ||
height: 2.5cm; | ||
} | ||
|
||
h1 { | ||
font-size: 18pt; | ||
padding-top: 3mm; | ||
} | ||
img { | ||
position: absolute; | ||
max-width: 30%; | ||
margin: 0; | ||
padding: 0; | ||
right: 0; | ||
} | ||
.tos { | ||
counter-reset: tos_chapter; | ||
} | ||
|
||
.tos h2::before { | ||
counter-increment: tos_chapter; | ||
content: counter(tos_chapter) ". "; | ||
} | ||
|
||
.tos h2 { | ||
counter-reset: tos_item; | ||
} | ||
|
||
.tos p.item, | ||
.tos p.subitem, | ||
.tos p.subsubitem { | ||
position: relative; | ||
} | ||
.tos p, | ||
.tos dl { | ||
padding: 0 3.5em; | ||
} | ||
.tos p.item { | ||
counter-reset: tos_subitem; | ||
} | ||
.tos p.subitem { | ||
counter-reset: tos_subsubitem; | ||
} | ||
.tos p.subsubitem { | ||
padding: 0 4.2em; | ||
} | ||
|
||
.tos p.item::before { | ||
counter-increment: tos_item; | ||
content: counter(tos_chapter) "." counter(tos_item) ". "; | ||
position: absolute; | ||
left: 0; | ||
} | ||
|
||
.tos p.subitem::before { | ||
counter-increment: tos_subitem; | ||
content: counter(tos_chapter) "." counter(tos_item) "." counter(tos_subitem) | ||
". "; | ||
position: absolute; | ||
left: 0; | ||
} | ||
|
||
.tos p.subsubitem::before { | ||
counter-increment: tos_subsubitem; | ||
content: counter(tos_chapter) "." counter(tos_item) "." counter(tos_subitem) | ||
"." counter(tos_subsubitem) ". "; | ||
position: absolute; | ||
left: 0; | ||
} | ||
|
||
.tos ol { | ||
counter-reset: tos_list; | ||
padding: 0 5em; | ||
} | ||
.tos ol > li { | ||
list-style: none; | ||
position: relative; | ||
} | ||
.tos ol > li:before { | ||
counter-increment: tos_list; | ||
content: counter(tos_list, lower-alpha) ") "; | ||
position: absolute; | ||
left: -1.4em; | ||
} | ||
|
||
.tos a { | ||
color: #2eccaa; | ||
text-decoration: underline; | ||
} | ||
|
||
.tos a:hover { | ||
text-decoration: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{% extends "pdf/base.html" %} | ||
|
||
{% block content %} | ||
<div class="tos">{% include "legal/documents/privacy.html" with hide_english=True %}</div> | ||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{% extends "pdf/base.html" %} | ||
|
||
{% block content %} | ||
<div class="tos"> | ||
{% include "legal/documents/tos.html" with hide_english=True privacy_url="https://weblate.org/privacy/" %} | ||
</div> | ||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters