]> _ Git - psq.git/commitdiff
cretae labo articles (actu labos)
authorLouis Jeckel <louis.jeckel@outlook.cm>
Tue, 11 Aug 2020 09:43:58 +0000 (11:43 +0200)
committerLouis Jeckel <louis.jeckel@outlook.cm>
Tue, 11 Aug 2020 09:43:58 +0000 (11:43 +0200)
14 files changed:
app/Http/Controllers/Admin/LaboArticleController.php [new file with mode: 0644]
app/Http/Requests/Admin/LaboArticleRequest.php [new file with mode: 0644]
app/Models/LaboArticle.php [new file with mode: 0644]
app/Models/Slugs/LaboArticleSlug.php [new file with mode: 0644]
app/Repositories/LaboArticleRepository.php [new file with mode: 0644]
app/View/Components/PillBox.php
config/twill-navigation.php
database/migrations/2020_08_11_092617_create_labo_articles_tables.php [new file with mode: 0644]
public/css/app.css
resources/sass/app.scss
resources/views/admin/laboArticles/form.blade.php [new file with mode: 0644]
resources/views/admin/settings/strings.blade.php
resources/views/not-registered/index.blade.php
routes/admin.php

diff --git a/app/Http/Controllers/Admin/LaboArticleController.php b/app/Http/Controllers/Admin/LaboArticleController.php
new file mode 100644 (file)
index 0000000..fe2929a
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+
+namespace App\Http\Controllers\Admin;
+
+use A17\Twill\Http\Controllers\Admin\ModuleController;
+
+class LaboArticleController extends ModuleController
+{
+    protected $moduleName = 'laboArticles';
+}
diff --git a/app/Http/Requests/Admin/LaboArticleRequest.php b/app/Http/Requests/Admin/LaboArticleRequest.php
new file mode 100644 (file)
index 0000000..825ea9d
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+
+namespace App\Http\Requests\Admin;
+
+use A17\Twill\Http\Requests\Admin\Request;
+
+class LaboArticleRequest extends Request
+{
+    public function rulesForCreate()
+    {
+        return [];
+    }
+
+    public function rulesForUpdate()
+    {
+        return [];
+    }
+}
diff --git a/app/Models/LaboArticle.php b/app/Models/LaboArticle.php
new file mode 100644 (file)
index 0000000..ef9d7bc
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+
+namespace App\Models;
+
+use A17\Twill\Models\Behaviors\HasSlug;
+use A17\Twill\Models\Behaviors\HasMedias;
+use A17\Twill\Models\Model;
+
+class LaboArticle extends Model 
+{
+    use HasSlug, HasMedias;
+
+    protected $fillable = [
+        'published',
+        'title',
+        'description',
+    ];
+    
+    public $slugAttributes = [
+        'title',
+    ];
+    
+    public $mediasParams = [
+        'cover' => [
+            'desktop' => [
+                [
+                    'name' => 'desktop',
+                    'ratio' => 16 / 9,
+                ],
+            ],
+            'mobile' => [
+                [
+                    'name' => 'mobile',
+                    'ratio' => 1,
+                ],
+            ],
+            'flexible' => [
+                [
+                    'name' => 'free',
+                    'ratio' => 0,
+                ],
+                [
+                    'name' => 'landscape',
+                    'ratio' => 16 / 9,
+                ],
+                [
+                    'name' => 'portrait',
+                    'ratio' => 3 / 5,
+                ],
+            ],
+        ],
+    ];
+}
diff --git a/app/Models/Slugs/LaboArticleSlug.php b/app/Models/Slugs/LaboArticleSlug.php
new file mode 100644 (file)
index 0000000..6281206
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+
+namespace App\Models\Slugs;
+
+use A17\Twill\Models\Model;
+
+class LaboArticleSlug extends Model
+{
+    protected $table = "labo_article_slugs";
+}
diff --git a/app/Repositories/LaboArticleRepository.php b/app/Repositories/LaboArticleRepository.php
new file mode 100644 (file)
index 0000000..6334869
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+
+namespace App\Repositories;
+
+use A17\Twill\Repositories\Behaviors\HandleSlugs;
+use A17\Twill\Repositories\Behaviors\HandleMedias;
+use A17\Twill\Repositories\ModuleRepository;
+use App\Models\LaboArticle;
+
+class LaboArticleRepository extends ModuleRepository
+{
+    use HandleSlugs, HandleMedias;
+
+    public function __construct(LaboArticle $model)
+    {
+        $this->model = $model;
+    }
+}
index 7b8a5a285893f07f4e9c5bf1e4d2a259574aad16..f17bf776cf738b3623d6f93d4f57e56d17aeb484 100644 (file)
@@ -30,9 +30,7 @@ class PillBox extends Component
             $this->title = $title;
             $this->link = $link;
 
-        } else if($pillBoxes = $repository->forSlug($slug)){
-            /** @var PillBoxSpace $pillBoxSpace */
-            $pillBoxSpace = $pillBoxes->first();
+        } else if($pillBoxSpace = $repository->forSlug($slug)){
 
             $this->title = $pillBoxSpace->box_title;
             $this->link = $pillBoxSpace->box_link;
index 4eda29ffea55a344249385db7e9240535ffbe48c..29e71d6f3b4320af3e2f6893a566ee69a80eae4a 100644 (file)
@@ -23,12 +23,17 @@ return [
                     'title' => 'Campagnes publicitaires',
                     'module' => true
                 ],
-                'events' => [
-                    'title' => 'Evénements',
+                'laboArticles' => [
+                    'title' => 'Actu des labos',
                     'module' => true
                 ],
+
+//                'events' => [
+//                    'title' => 'Evénements',
+//                    'module' => true
+//                ],
                 'articles' => [
-                    'title' => 'Articles',
+                    'title' => 'Humeurs',
                     'module' => true
                 ],
                 'podcasts' => [
diff --git a/database/migrations/2020_08_11_092617_create_labo_articles_tables.php b/database/migrations/2020_08_11_092617_create_labo_articles_tables.php
new file mode 100644 (file)
index 0000000..a289469
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+
+class CreateLaboArticlesTables extends Migration
+{
+    public function up()
+    {
+        Schema::create('labo_articles', function (Blueprint $table) {
+            // this will create an id, a "published" column, and soft delete and timestamps columns
+            createDefaultTableFields($table);
+
+            // feel free to modify the name of this column, but title is supported by default (you would need to specify the name of the column Twill should consider as your "title" column in your module controller if you change it)
+            $table->string('title', 200)->nullable();
+
+            $table->string('chapo')->nullable();
+            $table->text('content')->nullable();
+
+            // add those 2 columns to enable publication timeframe fields (you can use publish_start_date only if you don't need to provide the ability to specify an end date)
+             $table->timestamp('publish_start_date')->nullable();
+             $table->timestamp('publish_end_date')->nullable();
+        });
+
+        Schema::create('labo_article_slugs', function (Blueprint $table) {
+            createDefaultSlugsTableFields($table, 'labo_article');
+        });
+
+
+    }
+
+    public function down()
+    {
+
+        Schema::dropIfExists('labo_article_slugs');
+        Schema::dropIfExists('labo_articles');
+    }
+}
index be4bfd6cc34a47af3514aed76bfe2584efe22f81..cbd0e1e8417050777a20ba3f8246cc788ec45fc0 100644 (file)
@@ -11433,6 +11433,10 @@ ul.leaders span + span {
   font-family: "Avenir Next Demi", sans-serif;
 }
 
+body {
+  margin-bottom: 4rem;
+}
+
 .box,
 div.pill-box div {
   box-shadow: 0 2px 0 rgba(90, 97, 105, 0.11), 0 4px 8px rgba(90, 97, 105, 0.12), 0 10px 10px rgba(90, 97, 105, 0.06), 0 7px 70px rgba(90, 97, 105, 0.1);
index cd5bbf893c87f299ac9c9b7d7303a4b52947215c..1db74ab8e89a8c1edc42ff8e03592db759559596 100644 (file)
 @import "pill_boxes";
 @import "title_dots";
 
+body {
+    margin-bottom: 4rem;
+}
+
 .box {
     box-shadow: 0 2px 0 rgba(90, 97, 105, 0.11),
     0 4px 8px rgba(90, 97, 105, 0.12),
diff --git a/resources/views/admin/laboArticles/form.blade.php b/resources/views/admin/laboArticles/form.blade.php
new file mode 100644 (file)
index 0000000..2a22637
--- /dev/null
@@ -0,0 +1,9 @@
+@extends('twill::layouts.form')
+
+@section('contentFields')
+    @formField('input', [
+        'name' => 'description',
+        'label' => 'Description',
+        'maxlength' => 100
+    ])
+@stop
index a2db18a7b520aa8b5b7cb14ffa87b68107f6671f..874cc88ef3bd68827dd6d6d60ec00afdcafd94ea 100644 (file)
@@ -6,7 +6,20 @@
         'name' => 'not_registered_text',
         'maxlength' => 1000,
         'required' => true,
-        'toolbarOptions' => [ [ 'header' => [2, 3, false] ], 'bold', 'italic', 'underline', 'strike', 'list-ordered', 'list-unordered', [ 'indent' => '-1'], [ 'indent' => '+1' ] ],
-
+        'toolbarOptions' => [ [ 'header' => [2, 3, false] ], 'link', 'bold', 'italic', 'underline', 'strike', 'list-ordered', 'list-unordered', [ 'indent' => '-1'], [ 'indent' => '+1' ] ],
+    ])
+    @formField('wysiwyg', [
+        'label' => 'Texte page pas encore abonné bas gauche',
+        'name' => 'not_registered_text_left',
+        'maxlength' => 1000,
+        'required' => true,
+        'toolbarOptions' => [ [ 'header' => [2, 3, false] ], 'link', 'bold', 'italic', 'underline', 'strike', 'list-ordered', 'list-unordered', [ 'indent' => '-1'], [ 'indent' => '+1' ] ],
+    ])
+    @formField('wysiwyg', [
+        'label' => 'Texte page pas encore abonné bas droite',
+        'name' => 'not_registered_text_right',
+        'maxlength' => 1000,
+        'required' => true,
+        'toolbarOptions' => [ [ 'header' => [2, 3, false] ], 'link', 'bold', 'italic', 'underline', 'strike', 'list-ordered', 'list-unordered', [ 'indent' => '-1'], [ 'indent' => '+1' ] ],
     ])
 @stop
index 82c0f25a69530a8faf93395f2fc1c3ad7bbf27e7..7eb7786e09051df3684ca9b6e07caf1169e62cd5 100644 (file)
@@ -9,11 +9,23 @@
         <div class="col-sm-6">
             <img src="{{asset('img/not-registered.jpg')}}" alt="Image pas encore abonné" class="w-100">
         </div>
-        <div class="col-sm-6 pt-3">
+        <div class="col-sm-6 pt-3 box">
             {!! $settings->byKey('not_registered_text') !!}
         </div>
 
     </div>
+    <div class="row mt-4">
+        <div class="col-sm-6 px-2">
+            <div class="box p-3">
+                {!! $settings->byKey('not_registered_text_left') !!}
+            </div>
+        </div>
+        <div class="col-sm-6 px-2">
+            <div class="box p-3">
+                {!! $settings->byKey('not_registered_text_right') !!}
+            </div>
+        </div>
+    </div>
 </div>
 
 
index e4cd783b3dd8f780b0884351453f8f61a16419c3..7abe2c0c005f7b309d541dc3776e094b80b67847 100644 (file)
@@ -9,6 +9,7 @@ Route::prefix('content')->group(function() {
     Route::module('adCampaigns');
     Route::module('events');
     Route::module('podcasts');
+    Route::module('laboArticles');
     Route::module('guests'); //podcast guests
 });