Add image in fixtures (#699)
* Add image in fixtures * Add storage directory in gitignore * Add pictures for user, categories. Add upload system to service product * restore gitignore
|
|
@ -8,7 +8,6 @@ services:
|
||||||
target: app_php_dev
|
target: app_php_dev
|
||||||
volumes:
|
volumes:
|
||||||
- ./:/srv/app
|
- ./:/srv/app
|
||||||
- storage:/srv/app/public/storage
|
|
||||||
- ./docker/php/conf.d/app.dev.ini:/usr/local/etc/php/conf.d/app.dev.ini:ro
|
- ./docker/php/conf.d/app.dev.ini:/usr/local/etc/php/conf.d/app.dev.ini:ro
|
||||||
# If you develop on Mac or Windows you can remove the vendor/ directory
|
# If you develop on Mac or Windows you can remove the vendor/ directory
|
||||||
# from the bind-mount for better performance by enabling the next line:
|
# from the bind-mount for better performance by enabling the next line:
|
||||||
|
|
@ -24,7 +23,6 @@ services:
|
||||||
caddy:
|
caddy:
|
||||||
volumes:
|
volumes:
|
||||||
- ./public:/srv/app/public:ro
|
- ./public:/srv/app/public:ro
|
||||||
- storage:/srv/app/public/storage
|
|
||||||
- ./docker/caddy/Caddyfile:/etc/caddy/Caddyfile:ro
|
- ./docker/caddy/Caddyfile:/etc/caddy/Caddyfile:ro
|
||||||
|
|
||||||
maildev:
|
maildev:
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ App\Entity\Category:
|
||||||
category_service_4_0 (extends category_object):
|
category_service_4_0 (extends category_object):
|
||||||
parent: '@category_object_4'
|
parent: '@category_object_4'
|
||||||
name: Guitare
|
name: Guitare
|
||||||
|
image: 'de945081-21b6-46c2-864d-db6ed6b43311.png'
|
||||||
|
|
||||||
category_object_5 (extends category_object):
|
category_object_5 (extends category_object):
|
||||||
name: Entretien de la maison
|
name: Entretien de la maison
|
||||||
|
|
@ -35,6 +36,7 @@ App\Entity\Category:
|
||||||
|
|
||||||
category_object_7 (extends category_object):
|
category_object_7 (extends category_object):
|
||||||
name: Images & son
|
name: Images & son
|
||||||
|
image: 'd1fdbb3f-a5ca-4019-b488-fe6d8b06a4d3.png'
|
||||||
|
|
||||||
category_object_8 (extends category_object):
|
category_object_8 (extends category_object):
|
||||||
name: Informatique - téléphonie consoles et jeux vidéos
|
name: Informatique - téléphonie consoles et jeux vidéos
|
||||||
|
|
@ -44,12 +46,13 @@ App\Entity\Category:
|
||||||
|
|
||||||
category_object_10 (extends category_object):
|
category_object_10 (extends category_object):
|
||||||
name: Livres
|
name: Livres
|
||||||
|
image: '87c1aa88-1937-4a71-b4d9-325086783193.png'
|
||||||
category_object_11 (extends category_object):
|
category_object_11 (extends category_object):
|
||||||
name: Loisirs divers
|
name: Loisirs divers
|
||||||
|
|
||||||
category_object_12 (extends category_object):
|
category_object_12 (extends category_object):
|
||||||
name: Matériel de sports
|
name: Matériel de sports
|
||||||
|
image: '04f41100-e963-4f33-8aaf-f1c774e0d42f.png'
|
||||||
|
|
||||||
category_object_13 (extends category_object):
|
category_object_13 (extends category_object):
|
||||||
name: Matériel de vacances et weekend
|
name: Matériel de vacances et weekend
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,8 @@ App\Entity\Product:
|
||||||
name: Guitare électrique
|
name: Guitare électrique
|
||||||
description: >
|
description: >
|
||||||
Guitare en bon état.
|
Guitare en bon état.
|
||||||
age: 2010
|
age: 2010
|
||||||
|
images: ["d51c66ad-9e02-4fa9-8f37-5c84d928226e.jpg"]
|
||||||
|
|
||||||
loic_service_1 (extends service):
|
loic_service_1 (extends service):
|
||||||
id: <uuid('1ed7a2a8-0a78-605a-a8e0-f3a729006754')>
|
id: <uuid('1ed7a2a8-0a78-605a-a8e0-f3a729006754')>
|
||||||
|
|
@ -53,7 +54,8 @@ App\Entity\Product:
|
||||||
description: >
|
description: >
|
||||||
Initiation aux échecs pour débutants (1 heure).
|
Initiation aux échecs pour débutants (1 heure).
|
||||||
duration: >
|
duration: >
|
||||||
Une ou deux heures si besoin.
|
Une ou deux heures si besoin.
|
||||||
|
images: ["e2140911-4689-47df-a9cd-f87cef342cdd.jpg"]
|
||||||
|
|
||||||
# Kevin ———————————————————————————————————————————————————————————————————
|
# Kevin ———————————————————————————————————————————————————————————————————
|
||||||
kevin_object_1 (extends object):
|
kevin_object_1 (extends object):
|
||||||
|
|
@ -64,6 +66,7 @@ App\Entity\Product:
|
||||||
description: >
|
description: >
|
||||||
Très bien pour les déménagements, même proches.
|
Très bien pour les déménagements, même proches.
|
||||||
age: Acheté en 2012.
|
age: Acheté en 2012.
|
||||||
|
images: ["d4a5f2fb-57bb-4e6a-95eb-0614e8f62d45.jpg"]
|
||||||
|
|
||||||
kevin_object_2 (extends object):
|
kevin_object_2 (extends object):
|
||||||
owner: '@admin_kevin'
|
owner: '@admin_kevin'
|
||||||
|
|
@ -72,6 +75,7 @@ App\Entity\Product:
|
||||||
description: >
|
description: >
|
||||||
Très bien pour percer des trous dans la maison.
|
Très bien pour percer des trous dans la maison.
|
||||||
age: Acheté en 2015.
|
age: Acheté en 2015.
|
||||||
|
images: ["d75f07b1-52cb-4e39-929d-9da35e722627.jpg"]
|
||||||
|
|
||||||
# Camille —————————————————————————————————————————————————————————————————————
|
# Camille —————————————————————————————————————————————————————————————————————
|
||||||
camille_object_1 (extends object):
|
camille_object_1 (extends object):
|
||||||
|
|
@ -109,6 +113,7 @@ App\Entity\Product:
|
||||||
Pour transporter son enfant ou son chat.
|
Pour transporter son enfant ou son chat.
|
||||||
age: 2022
|
age: 2022
|
||||||
deposit: 5000
|
deposit: 5000
|
||||||
|
images: ["335dbbc1-3660-4f82-a529-fe79eb1a9a87.jpg"]
|
||||||
|
|
||||||
# user 16 —————————————————————————————————————————————————————————————————————
|
# user 16 —————————————————————————————————————————————————————————————————————
|
||||||
user_16_service_1 (extends service):
|
user_16_service_1 (extends service):
|
||||||
|
|
@ -129,6 +134,7 @@ App\Entity\Product:
|
||||||
Très belle guitare électrique en bon état.
|
Très belle guitare électrique en bon état.
|
||||||
age: 2013
|
age: 2013
|
||||||
deposit: 2000
|
deposit: 2000
|
||||||
|
images: ["e5889470-abfd-432c-aa96-0838608b936a.jpg"]
|
||||||
|
|
||||||
user_16_object_2 (extends object):
|
user_16_object_2 (extends object):
|
||||||
owner: '@user_16'
|
owner: '@user_16'
|
||||||
|
|
@ -136,7 +142,8 @@ App\Entity\Product:
|
||||||
name: Piano
|
name: Piano
|
||||||
description: >
|
description: >
|
||||||
Piano en bon état.
|
Piano en bon état.
|
||||||
age: 2010
|
age: 2010
|
||||||
|
images: ["f3fa0285-2b3c-4235-a618-9092ee55cae4.jpg"]
|
||||||
|
|
||||||
# place apes —————————————————————————————————————————————————————————————————————
|
# place apes —————————————————————————————————————————————————————————————————————
|
||||||
place_apes_service_1 (extends service):
|
place_apes_service_1 (extends service):
|
||||||
|
|
@ -163,7 +170,8 @@ App\Entity\Product:
|
||||||
description: >
|
description: >
|
||||||
Cours de rattrapage en histoire, aide aux devoirs, remise à niveau.
|
Cours de rattrapage en histoire, aide aux devoirs, remise à niveau.
|
||||||
duration: >
|
duration: >
|
||||||
Une journée.
|
Une journée.
|
||||||
|
images: ["c594de44-8999-46ed-89f0-6688c7d7c087.jpg"]
|
||||||
|
|
||||||
# Place 6 ———————————————————————————————————————————————————————————————————
|
# Place 6 ———————————————————————————————————————————————————————————————————
|
||||||
place_6_object_1 (extends object):
|
place_6_object_1 (extends object):
|
||||||
|
|
@ -175,6 +183,7 @@ App\Entity\Product:
|
||||||
duration: Une journée.
|
duration: Une journée.
|
||||||
age: De 2 à 10 ans
|
age: De 2 à 10 ans
|
||||||
deposit: 0
|
deposit: 0
|
||||||
|
images: ["434a9bb7-c140-4776-93e8-b8d018cd28f0.jpg"]
|
||||||
|
|
||||||
place_6_object_2 (extends object):
|
place_6_object_2 (extends object):
|
||||||
id: <uuid('1edf938b-7344-6684-87d5-d36fc869cf92')>
|
id: <uuid('1edf938b-7344-6684-87d5-d36fc869cf92')>
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ App\Entity\User:
|
||||||
lastname: 'Croteau'
|
lastname: 'Croteau'
|
||||||
mainAdminAccount: true
|
mainAdminAccount: true
|
||||||
address: '@address_camille'
|
address: '@address_camille'
|
||||||
|
avatar: 'a9a9bf49-24e4-4b3e-bdbd-86808c32939e.jpg'
|
||||||
|
|
||||||
admin_loic (extends admin_template):
|
admin_loic (extends admin_template):
|
||||||
id: <uuid('1ed674d3-886f-6ad4-bc25-15f868662c0c')>
|
id: <uuid('1ed674d3-886f-6ad4-bc25-15f868662c0c')>
|
||||||
|
|
@ -33,12 +34,14 @@ App\Entity\User:
|
||||||
lastname: 'Duclos'
|
lastname: 'Duclos'
|
||||||
devAccount: true
|
devAccount: true
|
||||||
address: '@address_loic'
|
address: '@address_loic'
|
||||||
|
avatar: '7c732ddb-9c13-45eb-aea0-e614f2340e6d.jpg'
|
||||||
|
|
||||||
admin_kevin (extends admin_template):
|
admin_kevin (extends admin_template):
|
||||||
id: <uuid('1ed69804-eeb9-6c32-990b-632c3a6846ba')>
|
id: <uuid('1ed69804-eeb9-6c32-990b-632c3a6846ba')>
|
||||||
email: 'kevin@example.com'
|
email: 'kevin@example.com'
|
||||||
firstname: 'Kevin'
|
firstname: 'Kevin'
|
||||||
lastname: 'Pirouet'
|
lastname: 'Pirouet'
|
||||||
|
avatar: '7c732ddb-9c13-45eb-aea0-e614f2340e6d.jpg'
|
||||||
|
|
||||||
admin_apes (extends admin_template):
|
admin_apes (extends admin_template):
|
||||||
id: <uuid('1ed69804-eeb9-6e6c-bce0-632c3a6846ba')>
|
id: <uuid('1ed69804-eeb9-6e6c-bce0-632c3a6846ba')>
|
||||||
|
|
@ -55,6 +58,7 @@ App\Entity\User:
|
||||||
devAccount: true
|
devAccount: true
|
||||||
address: '@address_region_hauts_de_france'
|
address: '@address_region_hauts_de_france'
|
||||||
category: '@category_object_16'
|
category: '@category_object_16'
|
||||||
|
avatar: 'a9a9bf49-24e4-4b3e-bdbd-86808c32939e.jpg'
|
||||||
|
|
||||||
# —— Places ————————————————————————————————————————————————————————————————
|
# —— Places ————————————————————————————————————————————————————————————————
|
||||||
place_{6} (extends place_template):
|
place_{6} (extends place_template):
|
||||||
|
|
@ -156,7 +160,7 @@ App\Entity\User:
|
||||||
firstname: <firstname()>
|
firstname: <firstname()>
|
||||||
lastname: <lastname()>
|
lastname: <lastname()>
|
||||||
address: null
|
address: null
|
||||||
avatar: 'ba827ea0-b140-4cbf-9786-77ac980c648c.jpg'
|
avatar: 'a9a9bf49-24e4-4b3e-bdbd-86808c32939e.jpg'
|
||||||
|
|
||||||
# user with an address and a preferred category set
|
# user with an address and a preferred category set
|
||||||
user_{17} (extends user_template):
|
user_{17} (extends user_template):
|
||||||
|
|
@ -173,3 +177,4 @@ App\Entity\User:
|
||||||
email: 'john.doe@example.com'
|
email: 'john.doe@example.com'
|
||||||
firstname: 'John'
|
firstname: 'John'
|
||||||
lastname: 'Doe'
|
lastname: 'Doe'
|
||||||
|
avatar: '7c732ddb-9c13-45eb-aea0-e614f2340e6d.jpg'
|
||||||
|
|
|
||||||
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 142 KiB |
|
After Width: | Height: | Size: 53 KiB |
|
After Width: | Height: | Size: 199 KiB |
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 61 KiB |
BIN
public/storage/uploads/product/d51c66ad-9e02-4fa9-8f37-5c84d928226e.jpg
Executable file
|
After Width: | Height: | Size: 84 KiB |
|
After Width: | Height: | Size: 107 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 102 KiB |
|
After Width: | Height: | Size: 92 KiB |
|
|
@ -10,6 +10,7 @@ use App\Enum\Product\ProductType;
|
||||||
use App\Enum\Product\ProductVisibility;
|
use App\Enum\Product\ProductVisibility;
|
||||||
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
|
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
|
||||||
use EasyCorp\Bundle\EasyAdminBundle\Field\ChoiceField;
|
use EasyCorp\Bundle\EasyAdminBundle\Field\ChoiceField;
|
||||||
|
use EasyCorp\Bundle\EasyAdminBundle\Field\ImageField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specific page for services.
|
* Specific page for services.
|
||||||
|
|
@ -53,15 +54,19 @@ final class ServiceCrudController extends AbstractProductCrudController
|
||||||
'nameField' => $nameField,
|
'nameField' => $nameField,
|
||||||
'descriptionField' => $descriptionField,
|
'descriptionField' => $descriptionField,
|
||||||
'durationField' => $durationField,
|
'durationField' => $durationField,
|
||||||
|
'imageField' => $imageField,
|
||||||
'createdAt' => $createdAt,
|
'createdAt' => $createdAt,
|
||||||
'updatedAt' => $updatedAt,
|
'updatedAt' => $updatedAt,
|
||||||
] = $this->getFields($pageName);
|
] = $this->getFields($pageName);
|
||||||
|
|
||||||
// list
|
// list
|
||||||
if ($pageName === Crud::PAGE_INDEX) {
|
if ($pageName === Crud::PAGE_INDEX) {
|
||||||
return [$nameField, $ownerField, $categoryField, $statusField, $visibilityField, $createdAt];
|
return [$nameField, $ownerField, $categoryField, $statusField, $visibilityField, $imageField, $createdAt];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @var ImageField $imageField */
|
||||||
|
$imageField->setCustomOption('first_image_only', false);
|
||||||
|
|
||||||
// forms
|
// forms
|
||||||
if ($pageName === Crud::PAGE_NEW || $pageName === Crud::PAGE_EDIT) {
|
if ($pageName === Crud::PAGE_NEW || $pageName === Crud::PAGE_EDIT) {
|
||||||
/** @var ChoiceField $statusField */
|
/** @var ChoiceField $statusField */
|
||||||
|
|
@ -69,7 +74,7 @@ final class ServiceCrudController extends AbstractProductCrudController
|
||||||
/** @var ChoiceField $visibilityField */
|
/** @var ChoiceField $visibilityField */
|
||||||
$visibilityField->setChoices(ProductVisibility::cases());
|
$visibilityField->setChoices(ProductVisibility::cases());
|
||||||
|
|
||||||
return [$nameField, $ownerField, $categoryField, $statusField, $visibilityField, $descriptionField, $durationField];
|
return [$nameField, $ownerField, $categoryField, $statusField, $visibilityField, $descriptionField, $imageField, $durationField];
|
||||||
}
|
}
|
||||||
|
|
||||||
// detail
|
// detail
|
||||||
|
|
@ -83,7 +88,7 @@ final class ServiceCrudController extends AbstractProductCrudController
|
||||||
$nameField,
|
$nameField,
|
||||||
$descriptionField,
|
$descriptionField,
|
||||||
$durationField,
|
$durationField,
|
||||||
|
$imageField,
|
||||||
$panels['tech_information'],
|
$panels['tech_information'],
|
||||||
$idField,
|
$idField,
|
||||||
$typeField,
|
$typeField,
|
||||||
|
|
|
||||||