{% extends 'base.html.twig' %} {% block body %} {{ form_start(form) }}

{% if mode=="update" %} Modification UTILISATEUR {% elseif mode=="submit" %} Création UTILISATEUR {% elseif mode=="profil" %} Profil UTILISATEUR {% endif %}

{{ form_widget(form.submit) }} {% if mode=="profil" %} Annuler {% else %} Annuler {% endif %} {% if mode=="update" and user.id>=0 %} Supprimer {% endif %}

{% if app.session.flashbag.has('error') %}
Erreur
{% for flashMessage in app.session.flashbag.get('error') %} {{ flashMessage }}
{% endfor %}
{% endif %} {% if app.session.flashbag.has('notice') %}
Information
{% for flashMessage in app.session.flashbag.get('notice') %} {{ flashMessage }}
{% endfor %}
{% endif %}
{% set avatar= "noavatar.png" %} {% if user.avatar %} {% set avatar= user.avatar %} {% endif %} {{ form_widget(form.avatar) }} Modifier
Informations
{{ form_row(form.username) }} {% if form.password is defined %} {{ form_row(form.password) }} {%endif%} {{ form_row(form.lastname) }} {{ form_row(form.firstname) }} {{ form_row(form.email) }}
{% if form.roles is defined %}
Organisation
{{ form_row(form.groups) }} {{ form_row(form.roles) }}
{%endif%}
{{ form_end(form) }} {% endblock %} {% block localjavascript %} $(document).ready(function() { $("#user_password_first").val(""); $("#user_login").focus(); }); $("#user_avatar_img").on('load', function() { }) $("#user_avatar_img").on('error', function(){ var imgSrc = $(this).attr('src'); if(imgSrc!="/{{appAlias}}/uploads/avatar/") $(this).attr('src',imgSrc); }); {% endblock %}