From 5808d53d17f9c6c515205887762f3fbf8d1fb897 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 28 Aug 2018 23:26:38 +0200 Subject: [PATCH] Modification du champ mail --- users/forms.py | 3 --- users/templates/users/user.html | 33 +++++++++++++++------------------ 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/users/forms.py b/users/forms.py index 404101d8..604df09b 100644 --- a/users/forms.py +++ b/users/forms.py @@ -313,8 +313,6 @@ class AdherentForm(FormRevMixin, FieldPermissionFormMixin, ModelForm): self.fields['email'].label = _("Email address") self.fields['school'].label = _("School") self.fields['comment'].label = _("Comment") - self.fields['room'].label = _("Room") - self.fields['room'].empty_label = _("No room") self.fields['school'].empty_label = _("Select a school") self.fields['birthday'].label = _("Your birthday") @@ -337,7 +335,6 @@ class AdherentForm(FormRevMixin, FieldPermissionFormMixin, ModelForm): 'comment', 'birthday', 'disclaimer', - 'room', 'shell', 'telephone', 'gpg_fingerprint' diff --git a/users/templates/users/user.html b/users/templates/users/user.html index c111a67b..1f2e6c56 100644 --- a/users/templates/users/user.html +++ b/users/templates/users/user.html @@ -72,26 +72,26 @@ function submitBday() {
{{ userform.name.label_tag }} - {% render_field userform.name class="form-control" requiered=True %} + {% render_field userform.name class="form-control" %}
{{ userform.surname.label_tag }} - {% render_field userform.surname class="form-control" requiered=True %} + {% render_field userform.surname class="form-control" %}
{{ userform.pseudo.label_tag }} - {% render_field userform.pseudo class="form-control" requiered=True %} + {% render_field userform.pseudo class="form-control" %}
{% elif action_name == 'Create a club' %}
{{ userform.surname.label_tag }} - {% render_field userform.surname class="form-control" requiered=True %} + {% render_field userform.surname class="form-control" %}
{{ userform.pseudo.label_tag }} - {% render_field userform.pseudo class="form-control" requiered=True %} + {% render_field userform.pseudo class="form-control" %}
{% endif %} @@ -100,15 +100,15 @@ function submitBday() {
{{ userform.email.label_tag }} - {% render_field userform.email class="form-control" requiered=True %} + {% render_field userform.email class="form-control" %}
{{ userform.telephone.label_tag }} - {% render_field userform.telephone class="form-control" requiered=True %} + {% render_field userform.telephone class="form-control" %}
{{ userform.birthday.label_tag}} - {% render_field userform.birthday class="form-control" requiered=True %} + {% render_field userform.birthday class="form-control" onchange='submitBday()' %} {# #}
@@ -124,7 +124,7 @@ function submitBday() { {% else %} {% endif %} @@ -134,21 +134,18 @@ function submitBday() { var div = document.getElementById("div_disclaimer"); var input = document.getElementById("{{userform.disclaimer.auto_id}}"); - var Bdate = document.getElementById('{{userform.birthday.auto_id').value; - var Bday = +new Date(Bdate); + var Bdate = document.getElementById('{{userform.birthday.auto_id}}').value; + var Bday = +new Date(Bdate.replace(/(\d{2})[-/](\d{2})[-/](\d+)/, "$2/$1/$3")); var age = ((Date.now() - Bday) / (31557600000)); - console.log("{{userform.disclaimer.auto_id}}"); if (age < 18){ div.style.display = "block"; - input.setAttribute("requiered", "True"); - console.log(input); + input.setAttribute("requiered", "True"); } else{ div.style.display = "none"; input.removeAttribute("requiered"); - console.log(input); } } @@ -156,17 +153,17 @@ function submitBday() { {% elif action_name == 'Create a club' %}
{{ userform.email.label_tag }} - {% render_field userform.email class="form-control" requiered=True %} + {% render_field userform.email class="form-control" %}
{% endif %}
{{ userform.school.label_tag }} - {% render_field userform.school class="form-control" requiered=True %} + {% render_field userform.school class="form-control" %}
{{ userform.room.label_tag }} - {% render_field userform.room class="form-control" requiered=True %} + {% render_field userform.room class="form-control" %}
{{ userform.comment.label_tag }}