card.html 1.4 KB

123456789101112131415161718192021222324
  1. <!-- Staticfile thumbnail - preview of the static file -->
  2. <div class="extractor-thumbnail staticfile-thumbnail" style="width: 100%; height: 100px; overflow: hidden; background: #f5f5f5;">
  3. {% if output_path %}
  4. {% if output_path|lower|slice:"-4:" == ".pdf" or "application/pdf" in output_path %}
  5. <embed src="{{ output_path }}#toolbar=0&navpanes=0&scrollbar=0&page=1&view=FitH"
  6. type="application/pdf"
  7. style="width: 100%; height: 200px; margin-top: -20px; pointer-events: none;">
  8. {% elif output_path|lower|slice:"-4:" in ".jpg.png.gif.svg.bmp.webp.avif.heic" or output_path|lower|slice:"-5:" == ".jpeg" %}
  9. <img src="{{ output_path }}"
  10. style="width: 100%; height: 100%; object-fit: cover;"
  11. loading="lazy">
  12. {% elif output_path|lower|slice:"-4:" in ".mp4.webm.mov.avi.mkv" or output_path|lower|slice:"-5:" == ".mpeg" %}
  13. <video src="{{ output_path }}"
  14. style="width: 100%; height: 100%; object-fit: cover;"
  15. preload="metadata"
  16. muted></video>
  17. {% else %}
  18. <iframe src="{{ output_path }}"
  19. style="width: 100%; height: 100%; border: none; pointer-events: none;"
  20. loading="lazy"
  21. sandbox="allow-same-origin"></iframe>
  22. {% endif %}
  23. {% endif %}
  24. </div>