forked from ScoDoc/ScoDoc
amélioration formulaires ajout correspondants
This commit is contained in:
parent
434e571a98
commit
e2c5a19655
@ -348,8 +348,16 @@ class CorrespondantCreationForm(FlaskForm):
|
|||||||
validators=[DataRequired(message=CHAMP_REQUIS)],
|
validators=[DataRequired(message=CHAMP_REQUIS)],
|
||||||
render_kw={"class": "form-control"},
|
render_kw={"class": "form-control"},
|
||||||
)
|
)
|
||||||
nom = _build_string_field("Nom (*)", render_kw={"class": "form-control"})
|
nom = StringField(
|
||||||
prenom = _build_string_field("Prénom (*)", render_kw={"class": "form-control"})
|
"Nom (*)",
|
||||||
|
validators=[DataRequired('Le champ "Nom" est requis')],
|
||||||
|
render_kw={"class": "form-control"},
|
||||||
|
)
|
||||||
|
prenom = StringField(
|
||||||
|
"Prénom (*)",
|
||||||
|
validators=[DataRequired('Le champ "Prénom" est requis')],
|
||||||
|
render_kw={"class": "form-control"},
|
||||||
|
)
|
||||||
telephone = _build_string_field(
|
telephone = _build_string_field(
|
||||||
"Téléphone (*)", required=False, render_kw={"class": "form-control"}
|
"Téléphone (*)", required=False, render_kw={"class": "form-control"}
|
||||||
)
|
)
|
||||||
@ -379,7 +387,6 @@ class CorrespondantCreationForm(FlaskForm):
|
|||||||
if not self.telephone.data and not self.mail.data:
|
if not self.telephone.data and not self.mail.data:
|
||||||
msg = "Saisir un moyen de contact (mail ou téléphone)"
|
msg = "Saisir un moyen de contact (mail ou téléphone)"
|
||||||
self.telephone.errors.append(msg)
|
self.telephone.errors.append(msg)
|
||||||
self.mail.errors.append(msg)
|
|
||||||
validate = False
|
validate = False
|
||||||
|
|
||||||
return validate
|
return validate
|
||||||
@ -464,7 +471,6 @@ class CorrespondantModificationForm(FlaskForm):
|
|||||||
if not self.telephone.data and not self.mail.data:
|
if not self.telephone.data and not self.mail.data:
|
||||||
msg = "Saisir un moyen de contact (mail ou téléphone)"
|
msg = "Saisir un moyen de contact (mail ou téléphone)"
|
||||||
self.telephone.errors.append(msg)
|
self.telephone.errors.append(msg)
|
||||||
self.mail.errors.append(msg)
|
|
||||||
validate = False
|
validate = False
|
||||||
|
|
||||||
return validate
|
return validate
|
||||||
|
@ -130,3 +130,8 @@
|
|||||||
#form-entreprise-filter > label {
|
#form-entreprise-filter > label {
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.title-form {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #a94442
|
||||||
|
}
|
@ -17,6 +17,9 @@
|
|||||||
<form method="POST" action="" novalidate>
|
<form method="POST" action="" novalidate>
|
||||||
{{ form.hidden_tag() }}
|
{{ form.hidden_tag() }}
|
||||||
{% for subfield in form.correspondants %}
|
{% for subfield in form.correspondants %}
|
||||||
|
{% if form.correspondants.errors %}
|
||||||
|
<p class="help-block title-form">Formulaire Correspondants-{{ loop.index-1 }}</p>
|
||||||
|
{% endif %}
|
||||||
{% for subsubfield in subfield %}
|
{% for subsubfield in subfield %}
|
||||||
{% if subsubfield.errors %}
|
{% if subsubfield.errors %}
|
||||||
{% for error in subsubfield.errors %}
|
{% for error in subsubfield.errors %}
|
||||||
|
Loading…
Reference in New Issue
Block a user