mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-26 14:42:25 +00:00
Added checkbox for GTU.
This commit is contained in:
parent
d0fdf841cf
commit
2db88d628a
2 changed files with 8 additions and 2 deletions
|
@ -48,6 +48,8 @@ from re2o.utils import remove_user_room, get_input_formats_help_text
|
||||||
from re2o.mixins import FormRevMixin
|
from re2o.mixins import FormRevMixin
|
||||||
from re2o.field_permissions import FieldPermissionFormMixin
|
from re2o.field_permissions import FieldPermissionFormMixin
|
||||||
|
|
||||||
|
from preferences.models import GeneralOption
|
||||||
|
|
||||||
from .widgets import DateTimePicker
|
from .widgets import DateTimePicker
|
||||||
|
|
||||||
from .models import (
|
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 = forms.BooleanField(required=True, help_text=former_user_check_info)
|
||||||
former_user_check.label = _("I have not had an account before")
|
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):
|
def __init__(self, *args, **kwargs):
|
||||||
super(AdherentCreationForm, self).__init__(*args, **kwargs)
|
super(AdherentCreationForm, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
class AdherentEditForm(AdherentForm):
|
class AdherentEditForm(AdherentForm):
|
||||||
"""Formulaire d'édition d'un user.
|
"""Formulaire d'édition d'un user.
|
||||||
AdherentForm incluant la modification des champs gpg et shell"""
|
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)
|
super(AdherentEditForm, self).__init__(*args, **kwargs)
|
||||||
self.fields['gpg_fingerprint'].widget.attrs['placeholder'] = _("Leave empty if you don't have any GPG key.")
|
self.fields['gpg_fingerprint'].widget.attrs['placeholder'] = _("Leave empty if you don't have any GPG key.")
|
||||||
if 'shell' in self.fields:
|
if 'shell' in self.fields:
|
||||||
|
|
|
@ -42,7 +42,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<br>
|
<br>
|
||||||
{% if showCGU %}
|
{% 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>
|
<h3>{% trans "Summary of the General Terms of Use" %}</h3>
|
||||||
<p>{{ GTU_sum_up }}</p>
|
<p>{{ GTU_sum_up }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue