{% extends "admin/change_form.html" %}
{% load i18n admin_urls static admin_modify %}
{% block extrastyle %}
{{ block.super }}
<style>
iframe.appmail{
    border: 1px dashed gray;
    width: 600px;
    display: inline-block;
}
</style>
{% endblock %}
{% block object-tools-items %}
    {{ block.super }}
    <li>
        <a href="{% url 'appmail:send_test_email' %}?templates={{ original.id }}&amp;source=1">{% trans "Send test" %}</a>
    </li>
{% endblock %}
{% block admin_change_form_document_ready %}
{{ block.super }}
<!-- From - http://stackoverflow.com/a/20722176/45698
used to resize iframes to content height -->
<script type="text/javascript">
function resizeIframe(obj){
    obj.style.height = 0;
    obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
}
</script>
{% endblock admin_change_form_document_ready %}