{% load thumbnail cms_tags i18n %}

{% trans "Instructors" as title_default %}

{% if instructor_list and "core.change_instructor" in perms %}<p><a class="btn btn-outline-secondary" href="{% url 'admin:core_instructor_changelist' %}">{% trans "Edit Instructor Bios" %}</a></p>{% endif %}

{% if instructor_list and list_title %}
    <h2>{{ list_title|default:title_default }}</h2>

    {% if list_intro %}
        <p>{{ list_intro|safe }}</p>
    {% endif %}

    <hr />
{% endif %}
{% for teacher in instructor_list %}
<a name="{{ teacher.firstName }}-{{ teacher.lastName }}"></a>
<div class="bio">
    <h3>
        {{ teacher.firstName }} {{ teacher.lastName }}
        {% if teacher.availableForPrivates %}<small><a href="mailto:{{ teacher.publicEmail }}">{% trans "schedule a private" %}</a></small>{% endif %}
    </h3>

    <img class="float-left instructor-bio-photo" src="{% if teacher.image %}{% thumbnail teacher.image thumbnail_dimensions|default:'133x133' crop %}{% endif %}" width="{{ thumbnail.width|default:'133' }}" />
    <div class="post-body">
        {% render_model teacher "bio" "" "" "safe" %}
    </div>
    <div class="video">
        {{ teacher.video }}
    </div>
</div>
{% if not forloop.last %}
<hr />
{% endif %}
{% endfor %}
