{% extends "workshops/_page.html" %}

{% load breadcrumbs %}
{% load crispy_forms_tags %}
{% load selectable_tags %}

{% block breadcrumbs %}
    {% breadcrumb_main_page %}
    {% breadcrumb_active title %}
{% endblock %}

{% block content %}
    {% crispy form %}
{% if persons == None %}
{% elif persons %}
    <table class="table table-striped">
        <tr>
    	    <th>taught</th>
    	    <th>airport</th>
    	    <th>person</th>
    	</tr>
    {% for p in persons %}
        <tr class="instructor_row" id="instructor_{{forloop.counter0}}">
    	    <td id="instructor_num_taught_{{forloop.counter0}}">{{ p.num_taught }}</td>
    	    <td id="instructor_airport_{{forloop.counter0}}"><a href="{% url 'airport_details' p.airport.iata %}">{{ p.airport }}</a></td>
    	    <td id="instructor_personal_{{forloop.counter0}}"><a href="{{ p.get_absolute_url }}">{{ p.get_full_name }}</a>{% if p.email and p.may_contact %} &lt;{{ p.email|urlize }}&gt;{% endif %}</td>
    	</tr>
    {% endfor %}
    </table>
{% else %}
    <p>No matches.</p>
{% endif %}
{% endblock %}

{% block extrajs %}
{{ form.media }}
{% endblock extrajs %}

{% extends "workshops/_page.html" %}

{% load breadcrumbs %}
{% load crispy_forms_tags %}
{% load selectable_tags %}

{% block breadcrumbs %}
    {% breadcrumb_main_page %}
    {% breadcrumb_active title %}
{% endblock %}

{% block content %}
    {% crispy form %}
{% if persons %}
    <table class="table table-striped">
        <tr>
    	    <th>taught</th>
    	    <th>airport</th>
    	    <th>person</th>
    	</tr>
    {% for p in persons %}
        <tr class="instructor_row" id="instructor_{{forloop.counter0}}">
    	    <td id="instructor_num_taught_{{forloop.counter0}}">{{ p.num_taught }}</td>
    	    <td id="instructor_airport_{{forloop.counter0}}"><a href="{% url 'airport_details' p.airport.iata %}">{{ p.airport }}</a></td>
    	    <td id="instructor_personal_{{forloop.counter0}}"><a href="{{ p.get_absolute_url }}">{{ p.get_full_name }}</a>{% if p.email and p.may_contact %} &lt;{{ p.email|urlize }}&gt;{% endif %}</td>
    	</tr>
    {% empty %}
        <p>No matches.</p>
    {% endfor %}
    </table>
{% endif %}
{% endblock %}

{% block extrajs %}
{{ form.media }}
{% endblock extrajs %}

Simplify and pythonize find_instructor template logic
Simplify and pythonize find_instructor template logic
