{% load i18n %}
{% load thumbnail %}


{% if userprofile %}

    {% if userprofile.avatar %}
        {% thumbnail userprofile.avatar "50x50" crop="center" as im %}
            <img src="{{ im.url }}" alt="" class="ui avatar image" style="{% if border_color %}border-color: {{ border_color }}; {% endif %}"/>
        {% endthumbnail %}
    {% else %}

        <img src="{{ userprofile.template_avatar }}" alt="" class="ui avatar image" width="{{ width }}" height="{{ height }}" style="background-color: {{ userprofile.color }}"/>

    {% endif %}
{% else %}
        <img src="/static/images/avatar/common.png" alt="" class="ui avatar image" width="50" height="50" style="background-color: #cfcfcf;"/>
{% endif %}
