mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 09:35:49 +02:00
Improved rendering of attachment icons
This commit is contained in:
parent
52e459ec60
commit
5aaba102a7
2 changed files with 9 additions and 9 deletions
|
@ -29,16 +29,16 @@ use InvalidArgumentException;
|
||||||
class FAIconGenerator
|
class FAIconGenerator
|
||||||
{
|
{
|
||||||
protected const EXT_MAPPING = [
|
protected const EXT_MAPPING = [
|
||||||
'fa-file-pdf' => ['pdf'],
|
'fa-file-pdf' => ['pdf', 'ps', 'eps'],
|
||||||
'fa-file-image' => Attachment::PICTURE_EXTS,
|
'fa-file-image' => Attachment::PICTURE_EXTS,
|
||||||
'fa-file-alt' => ['txt', 'md', 'rtf', 'log', 'rst', 'tex'],
|
'fa-file-lines' => ['txt', 'md', 'log', 'rst', 'tex'],
|
||||||
'fa-file-csv' => ['csv'],
|
'fa-file-csv' => ['csv', 'tsv'],
|
||||||
'fa-file-word' => ['doc', 'docx', 'odt'],
|
'fa-file-word' => ['doc', 'docx', 'odt', 'rtf'],
|
||||||
'fa-file-archive' => ['zip', 'rar', 'bz2', 'tar', '7z', 'gz'],
|
'fa-file-zipper' => ['zip', 'rar', 'bz2', 'tar', '7z', 'gz', 'tgz'],
|
||||||
'fa-file-audio' => ['mp3', 'wav', 'aac', 'm4a', 'wma'],
|
'fa-file-audio' => ['mp3', 'wav', 'aac', 'm4a', 'wma', 'ogg', 'flac', 'alac'],
|
||||||
'fa-file-powerpoint' => ['ppt', 'pptx', 'odp', 'pps', 'key'],
|
'fa-file-powerpoint' => ['ppt', 'pptx', 'odp', 'pps', 'key'],
|
||||||
'fa-file-excel' => ['xls', 'xlr', 'xlsx', 'ods'],
|
'fa-file-excel' => ['xls', 'xlr', 'xlsx', 'ods', 'numbers'],
|
||||||
'fa-file-code' => ['php', 'xml', 'html', 'js', 'ts', 'htm', 'c', 'cpp'],
|
'fa-file-code' => ['php', 'xml', 'html', 'js', 'ts', 'htm', 'c', 'cpp', 'json'],
|
||||||
'fa-file-video' => ['webm', 'avi', 'mp4', 'mkv', 'wmv'],
|
'fa-file-video' => ['webm', 'avi', 'mp4', 'mkv', 'wmv'],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
</div>
|
</div>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro attachment_icon(attachment, attachment_helper, class = "fa-fw fas fa-3x", link = true) %}
|
{% macro attachment_icon(attachment, attachment_helper, class = "fa-fw fas fa-3x hoverpic", link = true) %}
|
||||||
{% set disabled = attachment.secure and not is_granted("show_secure", attachment) %}
|
{% set disabled = attachment.secure and not is_granted("show_secure", attachment) %}
|
||||||
{% if not attachment_helper or attachment_helper.fileExisting(attachment) %}
|
{% if not attachment_helper or attachment_helper.fileExisting(attachment) %}
|
||||||
{% if link and not disabled %}
|
{% if link and not disabled %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue