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:
Jan Böhmer 2019-03-12 19:59:18 +01:00
parent 2e3713cd5e
commit 40714c1914
4 changed files with 86 additions and 3 deletions

View file

@ -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)
]
);
}