forked from projects/file-explorer
feat: add image rendering in file display template
This commit is contained in:
parent
54bcfd3775
commit
987e49cdec
@ -26,7 +26,7 @@ readonly class DirContent
|
||||
$fileInfo->getType() ?? 'N/A',
|
||||
$fileInfo->getPath(),
|
||||
$content,
|
||||
mime_content_type($fileInfo->getFilename()),
|
||||
mime_content_type($fileInfo->getPath() . '/' . $fileInfo->getFilename()),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,11 @@
|
||||
</a>
|
||||
|
||||
<div class="mt-6 text-gray-700 overflow-auto max-h-96">
|
||||
{% 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 %}
|
Loading…
x
Reference in New Issue
Block a user