]> _ Git - psq.git/commitdiff
glide + block editor
authorLouis Jeckel <louis.jeckel@outlook.cm>
Mon, 4 May 2020 17:18:35 +0000 (19:18 +0200)
committerLouis Jeckel <louis.jeckel@outlook.cm>
Mon, 4 May 2020 17:18:35 +0000 (19:18 +0200)
app/Http/Controllers/ImageController.php
app/Models/AdCampaign.php
config/cors.php
config/twill-navigation.php
config/twill.php
database/migrations/2020_05_02_130334_create_events_tables.php
resources/views/admin/articles/form.blade.php
resources/views/site/blocks/text.blade.php [new file with mode: 0644]
resources/views/site/layouts/block.blade.php [new file with mode: 0644]

index 500e9ad262a6e17250a2b19b846ff4d37ca0a903..22121ced06b3b636c264ca4b3b596d4ad1e55331 100644 (file)
@@ -14,12 +14,11 @@ class ImageController extends Controller
 {
     public function show($path)
     {
-        \Debugbar::disable();
-        return "a";
+
         $server = ServerFactory::create([
-            'response' => new LaravelResponseFactory($request),
+            'response' => new LaravelResponseFactory(request()),
             'source' => Storage::cloud()->getDriver(),
-            'cache' => $filesystem->getDriver(),
+            'cache' => Storage::getDriver(),
             'cache_path_prefix' => '.cache',
             'base_url' => 'images',
             'driver' => 'imagick',
@@ -27,18 +26,7 @@ class ImageController extends Controller
         ]);
 
 
-        $img = $server->makeImage($path, request()->all());
-
-//        $file = Storage::get($img);
-//        $type = Storage::mimeType($img);
-//
-//        $response = Response::make($file, 200);
-//
-//        $response->header("Content-Type", $type);
-
-//        return $response;
-
-        \Image::make($filesystem->get($img))->response();
+//        return \Image::make(Storage::get($server->makeImage($path, request()->all())))->response();
 
         return $server->getImageResponse($path, request()->all());
 
index b07026ab7466945618350ab87b75a1e673521cbc..ac5ea6550c8d929d528e8cfb1ed4046a0dc21094 100644 (file)
@@ -27,33 +27,14 @@ class AdCampaign extends Model implements Sortable
     ];
 
     public $mediasParams = [
-        'cover' => [
-            'desktop' => [
+        'image' => [
+            'preview' => [
                 [
-                    'name' => 'desktop',
+                    'name' => 'Miniature',
                     'ratio' => 16 / 9,
                 ],
             ],
-            'mobile' => [
-                [
-                    'name' => 'mobile',
-                    'ratio' => 1,
-                ],
-            ],
-            'flexible' => [
-                [
-                    'name' => 'free',
-                    'ratio' => 0,
-                ],
-                [
-                    'name' => 'landscape',
-                    'ratio' => 16 / 9,
-                ],
-                [
-                    'name' => 'portrait',
-                    'ratio' => 3 / 5,
-                ],
-            ],
+
         ],
     ];
 }
index 558369dca41bf7de39f68917cdfc61732082cf08..3e9813ee5c5853f0c44a5d5631b6e73cd30196e5 100644 (file)
@@ -12,10 +12,11 @@ return [
     | in web browsers. You are free to adjust these settings as needed.
     |
     | To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
+     @todo SET THIS
     |
     */
 
-    'paths' => ['api/*'],
+    'paths' => ['/*'],
 
     'allowed_methods' => ['*'],
 
index 55db34dd36833d62a3fbc322e70245385a875e38..7edf0d4c3fd46e489994ea03f5382af5fc34fb02 100644 (file)
@@ -12,25 +12,18 @@ return [
         'route' => '/publish',
         'raw' => true
     ],
-    'pdfFiles' => [
-        'title' => 'PdfFiles',
-        'module' => true
-    ],
     'adCampaigns' => [
-        'title' => 'AdCampaigns',
+        'title' => 'Campagnes publicitaires',
         'module' => true
     ],
     'events' => [
-        'title' => 'Events',
+        'title' => 'Evénements',
         'module' => true
     ],
     'articles' => [
-                'title' => 'Articles',
-                'module' => true
+        'title' => 'Articles',
+        'module' => true
     ],
-
-
-
     'featured' => [
        'title' => 'Features',
        'route' => 'admin.featured.homepage',
@@ -43,5 +36,4 @@ return [
    ],
 
 
-
 ];
index e9449d898639464324807ee6031259572c283a2c..2a8473500a702b214a50496b7f1992b811b73181 100644 (file)
@@ -210,6 +210,64 @@ return [
 
     'media_library' => [
         'image_service' => \A17\Twill\Services\MediaLibrary\Glide::class,
-    ]
+    ],
+    'block_editor' => [
+        'block_single_layout' => 'site.layouts.block', // layout to use when rendering a single block in the editor
+        'block_views_path' => 'site.blocks', // path where a view file per block type is stored
+        'block_views_mappings' => [], // custom mapping of block types and views
+        'block_preview_render_childs' => true, // indicates if childs should be rendered when using repeater in blocks
+        'block_presenter_path' => null, // allow to set a custom presenter to a block model
+        // Indicates if blocks templates should be inlined in HTML.
+        // When setting to false, make sure to build Twill with your all your custom blocks using php artisan twill:build.
+        'inline_blocks_templates' => true,
+        'custom_vue_blocks_resource_path' => 'assets/js/blocks', // path to custom vue blocks in your resources directory
+        'blocks' => [
+            'text' => [
+                'title' => 'Body text',
+                'icon' => 'text',
+                'component' => 'a17-block-wysiwyg',
+            ],
+            'image' => [
+                'title' => 'Image',
+                'icon' => 'image',
+                'component' => 'a17-block-image',
+            ],
+        ],
+        'crops' => [
+            'image' => [
+                'desktop' => [
+                    [
+                        'name' => 'desktop',
+                        'ratio' => 16 / 9,
+                        'minValues' => [
+                            'width' => 100,
+                            'height' => 100,
+                        ],
+                    ],
+                ],
+                'tablet' => [
+                    [
+                        'name' => 'tablet',
+                        'ratio' => 4 / 3,
+                        'minValues' => [
+                            'width' => 100,
+                            'height' => 100,
+                        ],
+                    ],
+                ],
+                'mobile' => [
+                    [
+                        'name' => 'mobile',
+                        'ratio' => 1,
+                        'minValues' => [
+                            'width' => 100,
+                            'height' => 100,
+                        ],
+                    ],
+                ],
+            ],
+        ],
+        'repeaters' => [],
+    ],
 
 ];
index 62227aec9b63e9359c6b562b4cbc5bf918e819ae..8513fc3eca9a7717338682c89ce32402da717305 100644 (file)
@@ -17,7 +17,7 @@ class CreateEventsTables extends Migration
             // your generated model and form include a description field, to get you started, but feel free to get rid of it if you don't need it
             $table->text('description')->nullable();
 
-            $table->dateTime('start_date');
+            $table->dateTime('start_date')->nullable();
             $table->dateTime('end_date')->nullable();
             $table->string('organizer')->nullable();
 
index 2dd200de2adbb510098cd284603e99968a84c18f..508877954ca6d159e4f91f3bac90f33b590b0d4e 100644 (file)
@@ -6,7 +6,5 @@
         'label' => 'Description',
         'maxlength' => 400
     ])
-    @formField('block_editor', [
-        'blocks' => ['title', 'quote', 'text', 'image', 'grid', 'test', 'publications', 'news']
-    ])
+    @formField('block_editor')
 @stop
diff --git a/resources/views/site/blocks/text.blade.php b/resources/views/site/blocks/text.blade.php
new file mode 100644 (file)
index 0000000..885022f
--- /dev/null
@@ -0,0 +1 @@
+{!! $block->input('html') !!}
diff --git a/resources/views/site/layouts/block.blade.php b/resources/views/site/layouts/block.blade.php
new file mode 100644 (file)
index 0000000..7653476
--- /dev/null
@@ -0,0 +1,6 @@
+@extends('layouts.app', ['hideNav' => true])
+
+@section('content')
+    @yield('content')
+@endsection
+