{% extends "forms/field.html.twig" %}

{% block field %}
{% set avatar = form.value('avatar') %}
{% if avatar %}
    <label><img style="max-width:200px;" src="{{ base_url_simple ~ '/' ~ (avatar|first).path }}" /></label>
{% else %}
    <label><img src="https://www.gravatar.com/avatar/{{ form.value('email')|md5 }}?s=200" /></label>
{% endif %}
{% endblock %}