{% extends "admin/base_site.html" %}
{% load i18n admin_urls staticfiles %}

{% block extrastyle %}{{ block.super }}
  <link href="{% static 'fluentcms_emailtemplates/admin/preview.css' %}" type="text/css"/>
  {{ media.css }}{# add parler-admin.css #}
{% endblock %}

{% block extrahead %}{{ block.super }}
  <script type="text/javascript">
    function resizeIframe(obj) {
      obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
    }
  </script>
{% endblock %}

{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ app_label|capfirst }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst|escape }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'change' object.pk|admin_urlquote %}">{{ object|truncatewords:"18" }}</a>
&rsaquo; {% trans 'Preview' %}
</div>
{% endblock %}

{% block content %}
  <div id="content-main">
    {% if language_tabs %}{% include "admin/parler/language_tabs.html" %}{% endif %}

    <section id="preview">
      {# render inside an iframe to make sure no CSS is applied from the admin styles #}
      <iframe src="{% url opts|admin_urlname:'preview_frame' object.pk %}?language={{ object.get_current_language }}&amp;format={{ email_format }}" width="100%" frameborder="0" onload="resizeIframe(this);">- no iframe shown -</iframe>
    </section>

  </div>
{% endblock %}

