{% 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_user_config_render",{by:mode,category:"site"})) }} {% else %} {{ render(path("app_admin_config_render",{by:mode,category:"site",userid:user.id})) }} {% endif %}
Social
{% if mode=="profil" %} {{ render(path("app_user_config_render",{by:mode,category:"social"})) }} {% else %} {{ render(path("app_admin_config_render",{by:mode,category:"social",userid:user.id})) }} {% endif %}
Hero
{% if mode=="profil" %} {{ render(path("app_user_config_render",{by:mode,category:"hero"})) }} {% else %} {{ render(path("app_admin_config_render",{by:mode,category:"hero",userid:user.id})) }} {% endif %}
Images
{% if mode=="profil" %} {{ render(path("app_user_config_render",{by:mode,category:"image"})) }} {% else %} {{ render(path("app_admin_config_render",{by:mode,category:"image",userid:user.id})) }} {% endif %}
{% endif %}
{%if mode!="submit" %}
Catégories d'Illustrations
{% if mode=="profil" %} {{ render(path("app_user_category")) }} {% else %} {{ render(path("app_admin_category",{by:mode,userid:user.id})) }} {% endif %}
Illustrations
{% if mode=="profil" %} {{ render(path("app_user_illustration")) }} {% else %} {{ render(path("app_admin_illustration",{by:mode,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 %}