Implement image previewing #12
@ -26,7 +26,7 @@ readonly class DirContent
|
|||||||
$fileInfo->getType() ?? 'N/A',
|
$fileInfo->getType() ?? 'N/A',
|
||||||
$fileInfo->getPath(),
|
$fileInfo->getPath(),
|
||||||
$content,
|
$content,
|
||||||
mime_content_type($fileInfo->getFilename()),
|
mime_content_type($fileInfo->getPath() . '/' . $fileInfo->getFilename()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,11 @@
|
|||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div class="mt-6 text-gray-700 overflow-auto max-h-96">
|
<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>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
x
Reference in New Issue
Block a user