8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-25 22:03:10 +00:00

Modification du champ mail

This commit is contained in:
root 2018-08-28 23:26:38 +02:00
parent 52efe5ff2d
commit 5808d53d17
2 changed files with 15 additions and 21 deletions

View file

@ -313,8 +313,6 @@ class AdherentForm(FormRevMixin, FieldPermissionFormMixin, ModelForm):
self.fields['email'].label = _("Email address") self.fields['email'].label = _("Email address")
self.fields['school'].label = _("School") self.fields['school'].label = _("School")
self.fields['comment'].label = _("Comment") 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['school'].empty_label = _("Select a school")
self.fields['birthday'].label = _("Your birthday") self.fields['birthday'].label = _("Your birthday")
@ -337,7 +335,6 @@ class AdherentForm(FormRevMixin, FieldPermissionFormMixin, ModelForm):
'comment', 'comment',
'birthday', 'birthday',
'disclaimer', 'disclaimer',
'room',
'shell', 'shell',
'telephone', 'telephone',
'gpg_fingerprint' 'gpg_fingerprint'

View file

@ -72,26 +72,26 @@ function submitBday() {
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4"> <div class="form-group col-md-4">
{{ userform.name.label_tag }} {{ userform.name.label_tag }}
{% render_field userform.name class="form-control" requiered=True %} {% render_field userform.name class="form-control" %}
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
{{ userform.surname.label_tag }} {{ userform.surname.label_tag }}
{% render_field userform.surname class="form-control" requiered=True %} {% render_field userform.surname class="form-control" %}
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
{{ userform.pseudo.label_tag }} {{ userform.pseudo.label_tag }}
{% render_field userform.pseudo class="form-control" requiered=True %} {% render_field userform.pseudo class="form-control" %}
</div> </div>
</div> </div>
{% elif action_name == 'Create a club' %} {% elif action_name == 'Create a club' %}
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-6"> <div class="form-group col-md-6">
{{ userform.surname.label_tag }} {{ userform.surname.label_tag }}
{% render_field userform.surname class="form-control" requiered=True %} {% render_field userform.surname class="form-control" %}
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
{{ userform.pseudo.label_tag }} {{ userform.pseudo.label_tag }}
{% render_field userform.pseudo class="form-control" requiered=True %} {% render_field userform.pseudo class="form-control" %}
</div> </div>
</div> </div>
{% endif %} {% endif %}
@ -100,15 +100,15 @@ function submitBday() {
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4"> <div class="form-group col-md-4">
{{ userform.email.label_tag }} {{ userform.email.label_tag }}
{% render_field userform.email class="form-control" requiered=True %} {% render_field userform.email class="form-control" %}
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
{{ userform.telephone.label_tag }} {{ userform.telephone.label_tag }}
{% render_field userform.telephone class="form-control" requiered=True %} {% render_field userform.telephone class="form-control" %}
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
{{ userform.birthday.label_tag}} {{ userform.birthday.label_tag}}
{% render_field userform.birthday class="form-control" requiered=True %} {% render_field userform.birthday class="form-control" onchange='submitBday()' %}
{# <input class="form-control" id="bday" name="bday" date-date-format="dd-mm-yy" requiered=True placeholder="Date de naissance" type="date" onchange="submitBday()"> #} {# <input class="form-control" id="bday" name="bday" date-date-format="dd-mm-yy" requiered=True placeholder="Date de naissance" type="date" onchange="submitBday()"> #}
</div> </div>
</div> </div>
@ -124,7 +124,7 @@ function submitBday() {
{% else %} {% else %}
<div class="disclaimer" style="display:none;" id="div_disclaimer"> <div class="disclaimer" style="display:none;" id="div_disclaimer">
{{ userform.disclaimer.label_tag }} {{ userform.disclaimer.label_tag }}
{% render_field userform.disclaimer class="form-control" requiered=True %} {% render_field userform.disclaimer class="form-control" %}
</div> </div>
{% endif %} {% endif %}
</div> </div>
@ -134,21 +134,18 @@ function submitBday() {
var div = document.getElementById("div_disclaimer"); var div = document.getElementById("div_disclaimer");
var input = document.getElementById("{{userform.disclaimer.auto_id}}"); var input = document.getElementById("{{userform.disclaimer.auto_id}}");
var Bdate = document.getElementById('{{userform.birthday.auto_id').value; var Bdate = document.getElementById('{{userform.birthday.auto_id}}').value;
var Bday = +new Date(Bdate); var Bday = +new Date(Bdate.replace(/(\d{2})[-/](\d{2})[-/](\d+)/, "$2/$1/$3"));
var age = ((Date.now() - Bday) / (31557600000)); var age = ((Date.now() - Bday) / (31557600000));
console.log("{{userform.disclaimer.auto_id}}");
if (age < 18){ if (age < 18){
div.style.display = "block"; div.style.display = "block";
input.setAttribute("requiered", "True"); input.setAttribute("requiered", "True");
console.log(input);
} }
else{ else{
div.style.display = "none"; div.style.display = "none";
input.removeAttribute("requiered"); input.removeAttribute("requiered");
console.log(input);
} }
} }
@ -156,17 +153,17 @@ function submitBday() {
{% elif action_name == 'Create a club' %} {% elif action_name == 'Create a club' %}
<div class="form-group"> <div class="form-group">
{{ userform.email.label_tag }} {{ userform.email.label_tag }}
{% render_field userform.email class="form-control" requiered=True %} {% render_field userform.email class="form-control" %}
</div> </div>
{% endif %} {% endif %}
<div class="form-group"> <div class="form-group">
{{ userform.school.label_tag }} {{ userform.school.label_tag }}
{% render_field userform.school class="form-control" requiered=True %} {% render_field userform.school class="form-control" %}
</div> </div>
<div class="form-group"> <div class="form-group">
{{ userform.room.label_tag }} {{ userform.room.label_tag }}
{% render_field userform.room class="form-control" requiered=True %} {% render_field userform.room class="form-control" %}
</div> </div>
<div class="form-group"> <div class="form-group">
{{ userform.comment.label_tag }} {{ userform.comment.label_tag }}