From e38e30408784c6e92f226f2fe94a6195645d40c0 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Thu, 10 Oct 2019 18:06:38 +0200 Subject: [PATCH 1/2] Display legal notice --- re2o/templates/re2o/about.html | 23 +++++++++++++++++++++-- re2o/views.py | 10 +++++++--- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/re2o/templates/re2o/about.html b/re2o/templates/re2o/about.html index 2503246a..514fd4d3 100644 --- a/re2o/templates/re2o/about.html +++ b/re2o/templates/re2o/about.html @@ -29,8 +29,27 @@ with this program; if not, write to the Free Software Foundation, Inc., {% block title %}{% trans "About Re2o" %}{% endblock %} {% block content %} -

{% blocktrans %}About {{AssoName}}{% endblocktrans %}

- {{ description | safe }} +

{% trans "Legal notes" %}

+ +

{% trans "Legal entity" %}

+

{{ option.name }}

+ +

{% trans "Registered office" %}

+

{{ option.adresse1 }}

+

{{ option.adresse2 }}

+ +

SIRET : {{ option.siret }}

+ +

{% trans "Publication manager" %}

+

{{ president }} - {% trans "President of " %} {{ option.pseudo }}

+ +

{% trans "General conditions of use" %}

+

{{ gtu }}

+ + {% if option.description %} +

Extra informations

+

{{ option.description }}

+ {% endif %}

{% trans "About Re2o" %}

{% blocktrans trimmed %} diff --git a/re2o/views.py b/re2o/views.py index d443a84c..05aa5798 100644 --- a/re2o/views.py +++ b/re2o/views.py @@ -39,7 +39,9 @@ from preferences.models import ( Service, MailContact, AssoOption, - HomeOption + HomeOption, + GeneralOption, + Mandate ) from .contributors import CONTRIBUTORS @@ -77,6 +79,7 @@ def about_page(request): Fetch some info about the configuration of the project. If it can't get the info from the Git repository, fallback to default string """ option = AssoOption.objects.get() + general = GeneralOption.objects.get() git_info_contributors = CONTRIBUTORS try: git_repo = git.Repo(settings.BASE_DIR) @@ -98,8 +101,9 @@ def about_page(request): request, "re2o/about.html", { - 'description': option.description, - 'AssoName': option.name, + 'option': option, + 'gtu': general.GTU, + 'president': Mandate.get_mandate().president.get_full_name(), 'git_info_contributors': git_info_contributors, 'git_info_remote': git_info_remote, 'git_info_branch': git_info_branch, From aabacec83a518701b02fe3173f3464f65cb8ba00 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Thu, 10 Oct 2019 21:57:06 +0200 Subject: [PATCH 2/2] Filter safe for info asso --- re2o/templates/re2o/about.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/re2o/templates/re2o/about.html b/re2o/templates/re2o/about.html index 514fd4d3..c2a226e1 100644 --- a/re2o/templates/re2o/about.html +++ b/re2o/templates/re2o/about.html @@ -32,13 +32,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,

{% trans "Legal notes" %}

{% trans "Legal entity" %}

-

{{ option.name }}

+

{{ option.name | safe}}

{% trans "Registered office" %}

-

{{ option.adresse1 }}

-

{{ option.adresse2 }}

+

{{ option.adresse1 | safe }}

+

{{ option.adresse2 | safe }}

-

SIRET : {{ option.siret }}

+

SIRET : {{ option.siret | safe }}

{% trans "Publication manager" %}

{{ president }} - {% trans "President of " %} {{ option.pseudo }}

@@ -48,7 +48,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% if option.description %}

Extra informations

-

{{ option.description }}

+

{{ option.description | safe }}

{% endif %}

{% trans "About Re2o" %}