mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 17:39:06 +02:00
Allow to show the footprint image in part info.
Also added an placehoder image for parts, who dont have an image.
This commit is contained in:
parent
2e3713cd5e
commit
40714c1914
4 changed files with 86 additions and 3 deletions
|
@ -34,6 +34,7 @@ namespace App\Controller;
|
|||
|
||||
|
||||
use App\Entity\Part;
|
||||
use App\Services\AttachmentFilenameService;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
|
@ -44,14 +45,15 @@ class PartController extends AbstractController
|
|||
* @Route("/part/{id}/info", name="part_info")
|
||||
* @Route("/part/{id}")
|
||||
*/
|
||||
function show(Part $part)
|
||||
function show(Part $part, AttachmentFilenameService $attachmentFilenameService)
|
||||
{
|
||||
$filename = $part->getMasterPictureFilename(true);
|
||||
dump($filename);
|
||||
|
||||
return $this->render('show_part_info.html.twig',
|
||||
[
|
||||
"part" => $part
|
||||
"part" => $part,
|
||||
"main_image" => $attachmentFilenameService->attachmentPathToAbsolutePath($filename)
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue