8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-21 19:03:11 +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['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'

View file

@ -72,26 +72,26 @@ function submitBday() {
<div class="form-row">
<div class="form-group col-md-4">
{{ userform.name.label_tag }}
{% render_field userform.name class="form-control" requiered=True %}
{% render_field userform.name class="form-control" %}
</div>
<div class="form-group col-md-4">
{{ userform.surname.label_tag }}
{% render_field userform.surname class="form-control" requiered=True %}
{% render_field userform.surname class="form-control" %}
</div>
<div class="form-group col-md-4">
{{ userform.pseudo.label_tag }}
{% render_field userform.pseudo class="form-control" requiered=True %}
{% render_field userform.pseudo class="form-control" %}
</div>
</div>
{% elif action_name == 'Create a club' %}
<div class="form-row">
<div class="form-group col-md-6">
{{ userform.surname.label_tag }}
{% render_field userform.surname class="form-control" requiered=True %}
{% render_field userform.surname class="form-control" %}
</div>
<div class="form-group col-md-6">
{{ userform.pseudo.label_tag }}
{% render_field userform.pseudo class="form-control" requiered=True %}
{% render_field userform.pseudo class="form-control" %}
</div>
</div>
{% endif %}
@ -100,15 +100,15 @@ function submitBday() {
<div class="form-row">
<div class="form-group col-md-4">
{{ userform.email.label_tag }}
{% render_field userform.email class="form-control" requiered=True %}
{% render_field userform.email class="form-control" %}
</div>
<div class="form-group col-md-4">
{{ userform.telephone.label_tag }}
{% render_field userform.telephone class="form-control" requiered=True %}
{% render_field userform.telephone class="form-control" %}
</div>
<div class="form-group col-md-4">
{{ 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()"> #}
</div>
</div>
@ -124,7 +124,7 @@ function submitBday() {
{% else %}
<div class="disclaimer" style="display:none;" id="div_disclaimer">
{{ userform.disclaimer.label_tag }}
{% render_field userform.disclaimer class="form-control" requiered=True %}
{% render_field userform.disclaimer class="form-control" %}
</div>
{% endif %}
</div>
@ -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' %}
<div class="form-group">
{{ userform.email.label_tag }}
{% render_field userform.email class="form-control" requiered=True %}
{% render_field userform.email class="form-control" %}
</div>
{% endif %}
<div class="form-group">
{{ userform.school.label_tag }}
{% render_field userform.school class="form-control" requiered=True %}
{% render_field userform.school class="form-control" %}
</div>
<div class="form-group">
{{ userform.room.label_tag }}
{% render_field userform.room class="form-control" requiered=True %}
{% render_field userform.room class="form-control" %}
</div>
<div class="form-group">
{{ userform.comment.label_tag }}