{% 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.pseudo) }} {{ form_row(form.email) }}
{% if form.roles is defined %}
Organisation
{{ form_row(form.groups) }} {{ form_row(form.roles) }}
{%endif%} {%if mode!="submit" %}
Ma Page
{% if mode=="profil" %} {{ render(path("app_config_user_render",{mode:mode,category:"site"})) }} {% else %} {{ render(path("app_config_render",{mode:mode,category:"site",userid:user.id})) }} {% endif %}
Social
{% if mode=="profil" %} {{ render(path("app_config_user_render",{mode:mode,category:"social"})) }} {% else %} {{ render(path("app_config_render",{mode:mode,category:"social",userid:user.id})) }} {% endif %}
Hero
{% if mode=="profil" %} {{ render(path("app_config_user_render",{mode:mode,category:"hero"})) }} {% else %} {{ render(path("app_config_render",{mode:mode,category:"hero",userid:user.id})) }} {% endif %}
Images
{% if mode=="profil" %} {{ render(path("app_config_user_render",{mode:mode,category:"image"})) }} {% else %} {{ render(path("app_config_render",{mode:mode,category:"image",userid:user.id})) }} {% endif %}
{% 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 %}