diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fc79afb6..cada9068 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,8 +18,7 @@ py37-django22: python3-django-extensions python3-django-filters python3-django-polymorphic python3-djangorestframework python3-django-cas-server python3-psycopg2 python3-pil python3-babel python3-lockfile python3-pip python3-phonenumbers - python3-bs4 python3-setuptools tox - texlive-latex-base texlive-latex-recommended texlive-lang-french lmodern texlive-fonts-recommended + python3-bs4 python3-setuptools tox texlive-xetex script: tox -e py37-django22 # Ubuntu 20.04 @@ -36,8 +35,7 @@ py38-django22: python3-django-extensions python3-django-filters python3-django-polymorphic python3-djangorestframework python3-django-cas-server python3-psycopg2 python3-pil python3-babel python3-lockfile python3-pip python3-phonenumbers - python3-bs4 python3-setuptools tox - texlive-latex-base texlive-latex-recommended texlive-lang-french lmodern texlive-fonts-recommended + python3-bs4 python3-setuptools tox texlive-xetex script: tox -e py38-django22 linters: diff --git a/Dockerfile b/Dockerfile index 846cc420..0dd1ce8b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,8 +12,7 @@ RUN apt-get update && \ python3-babel python3-lockfile python3-pip python3-phonenumbers ipython3 \ python3-bs4 python3-setuptools \ uwsgi uwsgi-plugin-python3 \ - texlive-latex-base texlive-latex-recommended texlive-lang-french lmodern texlive-fonts-recommended \ - gettext libjs-bootstrap4 fonts-font-awesome && \ + texlive-xetex gettext libjs-bootstrap4 fonts-font-awesome && \ rm -rf /var/lib/apt/lists/* # Instal PyPI requirements diff --git a/README.md b/README.md index 4408eaae..f2ada2a8 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,7 @@ Bien que cela permette de créer une instance sur toutes les distributions, $ sudo apt update $ sudo apt install --no-install-recommends -y \ ipython3 python3-setuptools python3-venv python3-dev \ - texlive-latex-base texlive-lang-french lmodern texlive-fonts-recommended \ - gettext libjs-bootstrap4 fonts-font-awesome git + texlive-xetex gettext libjs-bootstrap4 fonts-font-awesome git ``` 2. **Clonage du dépot** là où vous voulez : @@ -98,8 +97,7 @@ Sinon vous pouvez suivre les étapes décrites ci-dessous. python3-babel python3-lockfile python3-pip python3-phonenumbers ipython3 \ python3-bs4 python3-setuptools \ uwsgi uwsgi-plugin-python3 \ - texlive-latex-base texlive-lang-french lmodern texlive-fonts-recommended \ - gettext libjs-bootstrap4 fonts-font-awesome \ + texlive-xetex gettext libjs-bootstrap4 fonts-font-awesome \ nginx python3-venv git acl ``` diff --git a/ansible/roles/1-apt-basic/tasks/main.yml b/ansible/roles/1-apt-basic/tasks/main.yml index 3148327f..1ca1b3d6 100644 --- a/ansible/roles/1-apt-basic/tasks/main.yml +++ b/ansible/roles/1-apt-basic/tasks/main.yml @@ -38,10 +38,7 @@ - python3-venv # LaTeX (PDF generation) - - texlive-fonts-recommended - - texlive-lang-french - - texlive-latex-base - - texlive-latex-recommended + - texlive-xetex # WSGI server - uwsgi diff --git a/apps/treasury/static/img/Finalist_bg.jpg b/apps/treasury/static/img/Finalist_bg.jpg new file mode 100644 index 00000000..8f1fe6c7 Binary files /dev/null and b/apps/treasury/static/img/Finalist_bg.jpg differ diff --git a/apps/treasury/static/img/Kataclist_bg.jpg b/apps/treasury/static/img/Kataclist_bg.jpg new file mode 100644 index 00000000..fa3888fa Binary files /dev/null and b/apps/treasury/static/img/Kataclist_bg.jpg differ diff --git a/apps/treasury/static/img/Listorique_bg.jpg b/apps/treasury/static/img/Listorique_bg.jpg new file mode 100644 index 00000000..6400da23 Binary files /dev/null and b/apps/treasury/static/img/Listorique_bg.jpg differ diff --git a/apps/treasury/static/img/Monopolist_bg.jpg b/apps/treasury/static/img/Monopolist_bg.jpg new file mode 100644 index 00000000..09380801 Binary files /dev/null and b/apps/treasury/static/img/Monopolist_bg.jpg differ diff --git a/apps/treasury/static/img/Saperlistpopette_bg.jpg b/apps/treasury/static/img/Saperlistpopette_bg.jpg new file mode 100644 index 00000000..b88884ac Binary files /dev/null and b/apps/treasury/static/img/Saperlistpopette_bg.jpg differ diff --git a/apps/treasury/static/img/Satellist_bg.jpg b/apps/treasury/static/img/Satellist_bg.jpg new file mode 100644 index 00000000..825114f7 Binary files /dev/null and b/apps/treasury/static/img/Satellist_bg.jpg differ diff --git a/apps/treasury/templates/treasury/invoice_sample.tex b/apps/treasury/templates/treasury/invoice_sample.tex index c9bb92b8..cd630f1c 100644 --- a/apps/treasury/templates/treasury/invoice_sample.tex +++ b/apps/treasury/templates/treasury/invoice_sample.tex @@ -1,22 +1,14 @@ {% load escape_tex %} +\documentclass[a4paper,11pt]{article} -\nonstopmode -\documentclass[11pt]{article} - -\usepackage[french]{babel} -\usepackage[T1]{fontenc} -\usepackage[utf8]{inputenc} -\usepackage[a4paper]{geometry} -%\usepackage{bera} +\usepackage{fontspec} +\usepackage{geometry} \usepackage{graphicx} \usepackage{fancyhdr} \usepackage{fp} -\usepackage{transparent} \usepackage{eso-pic} \usepackage{ifthen} -\DeclareUnicodeCharacter{00B0}{$^\circ$} - \def\TVA{0} % Taux de la TVA \def\TotalHT{0} @@ -60,7 +52,8 @@ \parbox[b][\paperheight]{\paperwidth}{% \vfill \centering - {\transparent{0.1}\includegraphics[width=\textwidth]{../../apps/treasury/static/img/{{ obj.bde }}}}% + %FIXME remove ".png" on obj.bde + %\includegraphics[width=\textwidth]{../../apps/treasury/static/img/{{ obj.bde }}_bg.jpg}; \vfill } } diff --git a/apps/treasury/tests/test_treasury.py b/apps/treasury/tests/test_treasury.py index 580cfb2d..0d6e5d62 100644 --- a/apps/treasury/tests/test_treasury.py +++ b/apps/treasury/tests/test_treasury.py @@ -1,6 +1,5 @@ # Copyright (C) 2018-2020 by BDE ENS Paris-Saclay # SPDX-License-Identifier: GPL-3.0-or-later -from unittest import skip from django.contrib.auth.models import User from django.core.exceptions import ValidationError @@ -143,7 +142,6 @@ class TestInvoices(TestCase): self.assertRedirects(response, reverse("treasury:invoice_list"), 302, 200) self.assertFalse(Invoice.objects.filter(pk=self.invoice.id).exists()) - @skip("LaTeX is buggy in the CI") def test_invoice_render_pdf(self): """ Generate the PDF file of an invoice. diff --git a/apps/treasury/views.py b/apps/treasury/views.py index c35b0711..7e9ecc51 100644 --- a/apps/treasury/views.py +++ b/apps/treasury/views.py @@ -209,7 +209,7 @@ class InvoiceRenderView(LoginRequiredMixin, View): # The file has to be rendered twice for ignored in range(2): error = subprocess.Popen( - ["pdflatex", "-interaction=nonstopmode", "invoice-{}.tex".format(pk)], + ["xelatex", "-interaction=nonstopmode", "invoice-{}.tex".format(pk)], cwd=tmp_dir, stdin=open(os.devnull, "r"), stderr=open(os.devnull, "wb"), diff --git a/apps/wei/templates/wei/weilist_sample.tex b/apps/wei/templates/wei/weilist_sample.tex index 1ab3b76d..f1b7fbd4 100644 --- a/apps/wei/templates/wei/weilist_sample.tex +++ b/apps/wei/templates/wei/weilist_sample.tex @@ -1,15 +1,11 @@ -\documentclass[landscape,10pt]{article} - -\usepackage[utf8]{inputenc} -\usepackage[T1]{fontenc} -\usepackage[french]{babel} +\documentclass[a4paper,landscape,10pt]{article} +\usepackage{fontspec} \usepackage[margin=1.5cm]{geometry} -\usepackage{lmodern} \begin{document} \begin{center} -\huge{Liste des inscrits \og {{ wei.name }} \fg{}} +\huge{Liste des inscrits « {{ wei.name }} »} {% if bus %} \LARGE{Bus {{ bus.name|safe }}} diff --git a/apps/wei/tests/test_wei_registration.py b/apps/wei/tests/test_wei_registration.py index 1e9036f0..e1724419 100644 --- a/apps/wei/tests/test_wei_registration.py +++ b/apps/wei/tests/test_wei_registration.py @@ -690,7 +690,7 @@ class TestWEIRegistration(TestCase): """ with open("/dev/null", "wb") as devnull: return subprocess.call( - ["which", "pdflatex"], + ["which", "xelatex"], stdout=devnull, stderr=devnull, ) == 0 diff --git a/apps/wei/views.py b/apps/wei/views.py index f52d1335..ced85473 100644 --- a/apps/wei/views.py +++ b/apps/wei/views.py @@ -1103,7 +1103,7 @@ class MemberListRenderView(LoginRequiredMixin, View): with open(os.devnull, "wb") as devnull: error = subprocess.Popen( - ["pdflatex", "-interaction=nonstopmode", "{}/wei-list.tex".format(tmp_dir)], + ["xelatex", "-interaction=nonstopmode", "{}/wei-list.tex".format(tmp_dir)], cwd=tmp_dir, stderr=devnull, stdout=devnull,