{% if app.user %}
{% if app.user.contact.avatar is defined and app.user.contact.avatar is not empty %}
{% set filelabel = sulu_resolve_media(app.user.contact.avatar.id, 'fr').fileVersion.name %}
{% else %}
{% set filelabel = 'Cliquez ici pour mettre une photo de profil' %}
{% endif %}
{% if app.user.contact.typologieActeur %}
{% set typologieActeurName = app.user.contact.typologieActeur.name %}
{% else %}
{% set typologieActeurName = '' %}
{% endif %}
{% if app.user.contact.typologieStructure %}
{% set typologieStructure = app.user.contact.typologieStructure.name %}
{% else %}
{% set typologieStructure = '' %}
{% endif %}
{% else %}
{% set filelabel = 'Cliquez ici pour mettre une photo de profil' %}
{% set typologieActeurName = '' %}
{% set territoireIntervName = '' %}
{% set typologieStructure = '' %}
{% set type = 'profile' %}
{% endif %}
{% if formType is defined %}
{% set type = formType %}
{% endif %}
{% set liClass = "dflex w100 jcsb fwwrap" %}
<div class="{{ type }}-form-container mlr-1em cblue">
{% if type is defined and type == "registration" %}
<div class="header-cont">
<h1 class="mb-0p5em">Inscription</h1>
<span class="lh24 mb-2em diblock">Pas encore membre de PQN-A ? Rien de plus simple ! Il suffit de créer votre espace personnel en 1 clic !</span>
</div>
{% endif %}
{% for message in app.flashes('error') %}
<div class="mb-10px">{{ message }}</div>
{% endfor %}
{{ form_start(form) }}
<div class="mes-informations br8 in">
{% include "articles/blocks/noscript.html.twig" %}
{% if type is defined and type == "registration" %}
<h2 class="fw400 fs36 lh40 mb-1em">Qui êtes-vous ?</h2>
{% else %}
<h2 class="fs24 fw400 lh32 mb-40px">Mes informations</h2>
{% endif %}
<ul>
<li class="{{liClass}}">
{{ form_row(form.firstName) }}
{{ form_row(form.lastName) }}
</li>
<li class="{{liClass}}">
<div>
{% if type == "registration" %}
{{ form_errors(form.email) }}
{{ form_widget(form.email) }}
{% endif %}
{{ form_label(form.mainEmail) }}
{{ form_widget(form.mainEmail) }}
</div>
{{ form_row(form.number) }}
</li>
<li class="dflex jcsb fwwrap">
{{ form_row(form.typologieActeurValue) }}
<div id="autres-typologie-container">
{% if form.typologieActeurValue.vars.value == "Autres" %}
{{ form_label(form.autresTypologieActeur) }}
{{ form_widget(form.autresTypologieActeur) }}
{% endif %}
</div>
</li>
<li class="dflex jcsb fwwrap">
<div class="file-input-container prelative">
<span class="fw400 fs14 lh20">
Photo de profil
</span>
<div class="prelative">
{{ form_row(form.avatar, {'label': filelabel}) }}
<img src="/resources/img/paper-clip-icon.svg" alt="Profil" class="pabsolute" width="15" height="16">
</div>
</div>
</li>
<li class="dflex w100 fwwrap social-media-li">
{{ form_row(form.socialMediaProfiles) }}
</li>
<li class="dflex w100 jcc">
{{ form_row(form.submit) }}
</li>
{% if type is defined and type == "registration" %}
{% include "community/block/info-oblig.html.twig" %}
{% endif %}
</ul>
</div>
<div class="mon-activite br8">
{% if type is defined and type == "registration" %}
<h2 class="fw400 fs36 lh40 mb-1em">Quel est votre travail ?</h2>
{% else %}
<h2 class="fs24 fw400 lh32 mb-40px">Mon activité</h2>
{% endif %}
<ul class="prelative">
{% if type is defined and type == "registration" %}
<li>
<button class="cblue fs16 lh24 pabsolute" id="previous1">
Précédent
</button>
</li>
{% endif %}
<li class="{{liClass}}">
{{ form_row(form.structure, {'attr': {'autocomplete': 'off'}}) }}
<div id="structure-container">
{{ form_row(form.structureText, {'value' : typologieStructure, 'attr': {'autocomplete': 'off'}}) }}
<div>
<label class="fw400 fs14 lh20"></label>
<div id="registration_typologieStructure">
{% for structure in form.typologieStructure %}
{{ form_label(structure, null, {
label_attr: {'tabindex': 0 },
'attr': {'autocomplete': 'off'}
}) }}
{% endfor %}
</div>
<div class="hidden" id="structureRadioContainer">
{% for structure in form.typologieStructure %}
{{ form_widget(structure) }}
{% endfor %}
</div>
</div>
</div>
</li>
<li class="{{liClass}}">
{{ form_row(form.street) }}
{{ form_row(form.city) }}
</li>
<li class="{{liClass}}">
{{ form_row(form.zip) }}
<div id="fonction-container">
{% if form.fonction.vars.data is defined and form.fonction.vars.data is not empty %}
{% set fonctionId = form.vars.id ~ '_fonction' %}
<label for="{{fonctionId}}" class="fw400 fs14 lh20 required">{{ field_label(form.fonction) }}</label>
<select name="{{ field_name(form.fonction) }}" id="{{fonctionId}}" data-value="{{form.fonction.vars.data}}">
{% for label, value in field_choices(form.fonction) %}
<option value="{{ value }}" {% if value == form.fonction.vars.data %} selected {% endif %}>{{ label }}</option>
{% endfor %}
</select>
{% endif %}
</div>
</li>
<li class="{{liClass}}">
{{ form_row(form.fonction_desc) }}
</li>
<li class="{{liClass}}">
<div id="departement-container">
{% set fonctionId = form.vars.id ~ '_departement' %}
<label for="{{fonctionId}}" class="fw400 fs14 lh20 required">{{ field_label(form.departement) }}</label>
<select name="{{ field_name(form.departement) }}" id="{{fonctionId}}" data-value="{{form.departement.vars.value}}" {% if app.user and app.user.contact.territoireInterv is not empty %} data-territoire="{{app.user.contact.territoireInterv.id}}" {% endif %}>
<option value="">Aucun</option>
{% for label, value in field_choices(form.departement) %}
<option value="{{ value }}" {% if value == form.departement.vars.value %} selected {% endif %}>{{ label }}</option>
{% endfor %}
</select>
</div>
</li>
<li class="{{liClass}} note-container">
{{ form_row(form.note) }}
</li>
<li class="dflex w100 jcsb fdc fwwrap">
<label class="fw400 fs14 lh20">
Thématiques d'intervention et d'intérêt*
</label>
<div class="thematique-container fwwrap nolimit" id="thematique-container">
{% for child in form.thematiques %}
<div class="thematique-row">
{{ form_widget(child) }}
{{ form_label(child, null, {translation_domain: 'fr'}) }}
</div>
{% endfor %}
</div>
</li>
<li class="dflex w100 jcsb fdc fwwrap">
<label class="fw400 fs14 lh20">
Abonnements aux lettres d’infos sur les sujets
</label>
<div class="thematique-container fwwrap nolimit" id="thematique-container">
{% for child in form.optins %}
<div class="thematique-row">
{{ form_widget(child) }}
{{ form_label(child, null, {translation_domain: 'fr'}) }}
</div>
{% endfor %}
</div>
</li>
<li class="dflex w100 jcc">
{{ form_row(form.submit2) }}
</li>
{% if type is defined and type == "registration" %}
{% include "community/block/info-oblig.html.twig" %}
{% endif %}
</ul>
</div>
<div class="reset-password br8">
{% if type is defined and type == "registration" %}
<h2 class="fw400 fs36 lh40 mb-1em">Confidentialité</h2>
{% else %}
<h2 class="fs24 fw400 lh32 mb-40px">Modifier mon mot de passe</h2>
{% endif %}
<ul class="prelative">
{% if type is defined and type == "registration" %}
<li>
<button class="cblue fs16 lh24 pabsolute" id="previous2">
Précédent
</button>
</li>
{% endif %}
<li class="{{liClass}}">
<div class="prelative" id="firstpassword-container">
{{ form_label(form.plainPassword.first) }}
{{ form_widget(form.plainPassword.first) }}
{% if type is defined and type == "registration" %}
<button class="pabsolute showpass" id="showpass1">{{ source("/svg/eye-icon.html.twig") }}</button>
{% endif %}
</div>
<div class="prelative">
{{ form_label(form.plainPassword.second) }}
{{ form_widget(form.plainPassword.second) }}
{% if type is defined and type == "registration" %}
<button class="pabsolute showpass" id="showpass2">{{ source("/svg/eye-icon.html.twig") }}</button>
{% endif %}
</div>
</li>
{% if type is defined and type == "registration" %}
<li class="{{liClass}}">
{{ form_row(form.visibleAnnuaire) }}
</li>
<li class="dflex w100 fwwrap terms">
<div>
{{ form_widget(form.terms) }}
{{ form_label(form.terms) }}
</div>
<span class="fw400 fs14 lh20">Voir la
<a href="/politique-de-confidentialite" class="cblue">politique de confidentialité</a>
</span>
{{ form_errors(form.terms) }}
</li>
{% endif %}
{% if type is defined and type == "registration" %}
{{ form_row(form.recaptcha) }}
{% endif %}
<li class="dflex w100 fdc aic mt-1em">
{{ form_row(form.submit3) }}
</li>
{% if type is defined and type == "registration" %}
{% include "community/block/info-oblig.html.twig" %}
{% endif %}
</ul>
</div>
{{ form_row(form._token) }}
{{ form_end(form, {render_rest: false}) }}
{% if type is defined and type == "profile" %}
<div class="center mb-40px">
<a href="{{ path('sulu_community.logout') }}" class="deconnect">Déconnexion</a>
</div>
{% endif %}
</div>