{% load i18n %}
{% load rich_text %}

<div class="pretalx-session">
    <div class="pretalx-session-time-box avatar">
        {% if add_links %}
            <a href="{{ speaker.urls.public }}">
        {% endif %}
        <div class="avatar-wrapper">
            {% if speaker.user.avatar_url %}
                <img src="{{ speaker.user.avatar_url }}">
            {% else %}
                {% include "common/avatar.svg" %}
            {% endif %}
        </div>
        {% if add_links %}
            </a>
        {% endif %}
    </div>
    <div class="pretalx-session-info">
        <div class="title">
            {% if add_links %}
                <a href="{{ speaker.urls.public }}">{{ speaker.user.get_display_name }}</a>
            {% else %}
                {{ speaker.user.get_display_name }}
            {% endif %}
        </div>
        <div class="abstract">{{ speaker.biography|default:''|rich_text_without_links }}</div>
        {% if not filter_talks %}
            <ul>
                {% for talk in speaker.talks %}
                    <li>{{ talk.title }}</li>
                {% endfor %}
            </ul>
        {% elif sessions %}
            {% translate "This speaker also appears in:" %}
            <ul>
                {% for talk in sessions %}
                    <li>
                        {% if add_links %}
                            <a href="{{ talk.urls.public }}">{{ talk.title }}</a>
                        {% else %}
                            {{ talk.title }}
                        {% endif %}
                    </li>
                {% endfor %}
            </ul>
        {% endif %}
    </div>
</div>
