add pdf-cover

This commit is contained in:
isUnknown 2024-11-28 16:56:55 +01:00
parent bd95cf4613
commit 7cc2b2a9e8
19 changed files with 119 additions and 11 deletions

View file

@ -0,0 +1,6 @@
title: Image
accept:
mime: image/*
type: image
focus: false

View file

@ -7,6 +7,14 @@ focus: false
fields:
comments:
type: hidden
cover:
label: Image de couverture
type: files
multiple: false
width: 1/3
layout: cards
uploads: pdf-cover
label:
label: Nom
type: text
width: 1/3

View file

@ -41,11 +41,11 @@ tabs:
label: Verre brut
type: files
multiple: false
template: pdf
uploads: pdf
finishedGlass:
label: Verre parachevé
type: files
mutliple: false
template: pdf
uploads: pdf
stepName:
type: hidden

View file

@ -17,6 +17,7 @@ function getFileData($file) {
if($file->extension() == "pdf") {
$data['comments'] = $file->comments()->exists() && $file->comments() ? Data::decode($file->comments()->value(), 'yaml') : [];
$data['cover'] = $file->cover()->exists() && $file->cover()->isNotEmpty() ? $file->cover()->toFile()->resize(576)->url() : false;
}
return $data;