{% 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 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) }} {{ form_row(form.apikey) }}
{% 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!="{{ asset("uploads/avatar/") }}") $(this).attr('src',imgSrc); }); {% endblock %}