add pdf-cover
This commit is contained in:
parent
bd95cf4613
commit
7cc2b2a9e8
19 changed files with 119 additions and 11 deletions
6
public/site/blueprints/files/pdf-cover.yml
Normal file
6
public/site/blueprints/files/pdf-cover.yml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
title: Image
|
||||
|
||||
accept:
|
||||
mime: image/*
|
||||
type: image
|
||||
focus: false
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue