<!--!  Copyright (C) 2010-2023 Edgewall Software

  This software is licensed as described in the file COPYING, which
  you should have received as part of this distribution. The terms
  are also available at https://trac.edgewall.org/wiki/TracLicense.

  This software consists of voluntary contributions made by many
  individuals. For the exact contribution history, see the revision
  history and logs, available at https://trac.edgewall.org/.

Display a div for visualizing a preview of a file content.

Arguments:
 - preview: a preview usually obtained from calling Mimeview.preview_data()
-->
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:i18n="http://genshi.edgewall.org/i18n"
      py:strip="">
  ${preview.rendered}
  <py:choose>
    <p py:when="preview.size == 0">
      <strong>(The file is empty)</strong>
    </p>
    <p py:when="not preview.rendered">
      <py:choose>
        <py:when test="preview.max_file_size_reached"><i18n:msg params="size">
          <strong>HTML preview not available</strong>, since the file size exceeds ${pretty_size(preview.max_file_size)}.
        </i18n:msg></py:when>
        <py:otherwise><i18n:msg>
          <strong>HTML preview not available</strong>, since no preview renderer could handle it.
        </i18n:msg></py:otherwise>
      </py:choose>
      <i18n:msg>Try <a href="$preview.raw_href">downloading</a> the file instead.</i18n:msg>
    </p>
  </py:choose>
</html>
