8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-27 07:02:26 +00:00

Added checkbox for GTU.

This commit is contained in:
edpibu 2018-09-20 10:57:31 +02:00 committed by chirac
parent d0fdf841cf
commit 2db88d628a
2 changed files with 8 additions and 2 deletions

View file

@ -48,6 +48,8 @@ from re2o.utils import remove_user_room, get_input_formats_help_text
from re2o.mixins import FormRevMixin
from re2o.field_permissions import FieldPermissionFormMixin
from preferences.models import GeneralOption
from .widgets import DateTimePicker
from .models import (
@ -377,13 +379,18 @@ class AdherentCreationForm(AdherentForm):
former_user_check = forms.BooleanField(required=True, help_text=former_user_check_info)
former_user_check.label = _("I have not had an account before")
# Checkbox for GTU
gtu_check = forms.BooleanField(required=True)
gtu_check.label = mark_safe("{}<a href='/media/{}' download='CGU'>{}</a>{}".format(
_("I commit to accept the "), GeneralOption.get_cached_value('GTU'), _("General Terms of Use"), _(".")))
def __init__(self, *args, **kwargs):
super(AdherentCreationForm, self).__init__(*args, **kwargs)
class AdherentEditForm(AdherentForm):
"""Formulaire d'édition d'un user.
AdherentForm incluant la modification des champs gpg et shell"""
def __init__(self, *args, **kargs):
def __init__(self, *args, **kargs):
super(AdherentEditForm, self).__init__(*args, **kwargs)
self.fields['gpg_fingerprint'].widget.attrs['placeholder'] = _("Leave empty if you don't have any GPG key.")
if 'shell' in self.fields:

View file

@ -42,7 +42,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endif %}
<br>
{% if showCGU %}
<p>{% trans "By clicking 'Create or edit', the user commits to respect the " %}<a href="/media/{{ GTU }}" download="CGU" >{% trans "General Terms of Use" %}</a>.</p>
<h3>{% trans "Summary of the General Terms of Use" %}</h3>
<p>{{ GTU_sum_up }}</p>
{% endif %}