forked from projects/file-explorer
Implement image previewing
I have tested this with png and jpeg/jpg which both work but most other image types should work as well.  Co-authored-by: Jan Klattenhoff <j.klattenhoff@neusta.de> Reviewed-on: sites/file-explorer#12 Co-authored-by: jank1619 <jan@kjan.email> Co-committed-by: jank1619 <jan@kjan.email>
This commit is contained in:
@ -15,7 +15,11 @@
|
||||
</a>
|
||||
|
||||
<div class="mt-6 text-gray-700 overflow-auto max-h-96">
|
||||
<p class="whitespace-pre-wrap leading-relaxed break-all text-balance">{{ file.content|raw }}</p>
|
||||
{% if file.mimeType starts with 'image' %}
|
||||
<img src="{{ path('serve_file', {filePath: file.name}) }}" alt="">
|
||||
{% else %}
|
||||
<p class="whitespace-pre-wrap leading-relaxed break-all text-balance">{{ file.content|raw }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user