mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-04 23:44:33 +02:00
Show attachment name and filename when hovering over an table picture.
This commit is contained in:
parent
53dd0c4228
commit
19e132c746
2 changed files with 17 additions and 4 deletions
|
@ -161,12 +161,18 @@ final class PartsDataTable implements DataTableTypeInterface
|
|||
return '';
|
||||
}
|
||||
|
||||
$title = htmlspecialchars($preview_attachment->getName());
|
||||
if ($preview_attachment->getFilename()) {
|
||||
$title .= ' (' . htmlspecialchars($preview_attachment->getFilename()) . ')';
|
||||
}
|
||||
|
||||
return sprintf(
|
||||
'<img alt="%s" src="%s" data-thumbnail="%s" class="%s">',
|
||||
'<img alt="%s" src="%s" data-thumbnail="%s" class="%s" data-title="%s">',
|
||||
'Part image',
|
||||
$this->attachmentURLGenerator->getThumbnailURL($preview_attachment),
|
||||
$this->attachmentURLGenerator->getThumbnailURL($preview_attachment, 'thumbnail_md'),
|
||||
'img-fluid hoverpic'
|
||||
'img-fluid hoverpic',
|
||||
$title
|
||||
);
|
||||
},
|
||||
])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue