<a href="{% url 'email' location_id destination %}">Create a new email</a>
{% if email_results and not email_permission == 0 %}
    <table class="table table-striped table-hover">
        <thead>
            <tr>
                <td width="70%">Subject</td>
                <td width="15%">Date</td>
                <td width="15%">Sent By</td>
            </tr>
        </thead>
        {% for row in email_results %}
            <tr>
                {% if email_permission > 1 %}
                    <td><a href="{% url 'email_information' row.email_content_id %}">{{ row.email_subject }}</a></td>
                {% else %}
                    <td>{{ row.email_subject }}</td>
                {% endif %}
                <td>{{ row.date_created }}</td>
                <td>{{ row.change_user }}</td>
            </tr>
        {% endfor %}
    </table>
{% else %}
<p>There is no email history</p>
{% endif %}