+++ /dev/null
-<?php
-
-namespace App\Http\Controllers\Admin;
-
-use A17\Twill\Http\Controllers\Admin\ModuleController;
-
-class ArticleController extends ModuleController
-{
- protected $moduleName = 'articles';
-}
--- /dev/null
+<?php
+
+namespace App\Http\Controllers\Admin;
+
+use A17\Twill\Http\Controllers\Admin\ModuleController;
+
+class HumeurController extends ModuleController
+{
+ protected $moduleName = 'humeurs';
+}
--- /dev/null
+<?php
+
+namespace App\Http\Controllers\Admin;
+
+use A17\Twill\Http\Controllers\Admin\ModuleController;
+
+class WeeklyAgendaController extends ModuleController
+{
+ protected $moduleName = 'weeklyAgendas';
+
+ protected $titleColumnKey = "start_date";
+
+ protected $indexOptions = [
+ 'publish' => false,
+ 'bulkPublish' => false,
+ ];
+
+ protected $indexColumns = [
+ 'start_date' => [
+ 'title' => 'Date de début',
+ 'field' => 'start_date',
+ 'sort' => true,
+ ],
+
+ ];
+}
+++ /dev/null
-<?php
-
-namespace App\Http\Requests\Admin;
-
-use A17\Twill\Http\Requests\Admin\Request;
-
-class ArticleRequest extends Request
-{
- public function rulesForCreate()
- {
- return [];
- }
-
- public function rulesForUpdate()
- {
- return [];
- }
-}
--- /dev/null
+<?php
+
+namespace App\Http\Requests\Admin;
+
+use A17\Twill\Http\Requests\Admin\Request;
+
+class HumeurRequest extends Request
+{
+ public function rulesForCreate()
+ {
+ return [];
+ }
+
+ public function rulesForUpdate()
+ {
+ return [];
+ }
+}
--- /dev/null
+<?php
+
+namespace App\Http\Requests\Admin;
+
+use A17\Twill\Http\Requests\Admin\Request;
+
+class WeeklyAgendaRequest extends Request
+{
+ public function rulesForCreate()
+ {
+ return [];
+ }
+
+ public function rulesForUpdate()
+ {
+ return [];
+ }
+}
+++ /dev/null
-<?php
-
-namespace App\Models;
-
-use A17\Twill\Models\Behaviors\HasBlocks;
-use A17\Twill\Models\Behaviors\HasSlug;
-use A17\Twill\Models\Behaviors\HasMedias;
-use A17\Twill\Models\Behaviors\HasRevisions;
-use A17\Twill\Models\Behaviors\HasPosition;
-use A17\Twill\Models\Behaviors\Sortable;
-use A17\Twill\Models\Model;
-
-class Article extends Model implements Sortable
-{
- use HasBlocks, HasSlug, HasMedias, HasRevisions, HasPosition;
-
- protected $fillable = [
- 'published',
- 'title',
- 'description',
- 'position',
- ];
-
- 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,
- ],
- ],
- ],
- ];
-
-
-
-}
--- /dev/null
+<?php
+
+namespace App\Models;
+
+use A17\Twill\Models\Behaviors\HasSlug;
+use A17\Twill\Models\Model;
+
+class Humeur extends Model
+{
+ use HasSlug;
+
+ protected $fillable = [
+ 'published',
+ 'title',
+ 'content',
+ 'extract',
+ 'publish_start_date'
+ ];
+
+ public $slugAttributes = [
+ 'title',
+ ];
+
+}
+++ /dev/null
-<?php
-
-namespace App\Models\Revisions;
-
-use A17\Twill\Models\Revision;
-
-class ArticleRevision extends Revision
-{
- protected $table = "article_revisions";
-}
+++ /dev/null
-<?php
-
-namespace App\Models\Slugs;
-
-use A17\Twill\Models\Model;
-
-class ArticleSlug extends Model
-{
- protected $table = "article_slugs";
-}
--- /dev/null
+<?php
+
+namespace App\Models\Slugs;
+
+use A17\Twill\Models\Model;
+
+class HumeurSlug extends Model
+{
+ protected $table = "humeur_slugs";
+}
--- /dev/null
+<?php
+
+namespace App\Models;
+
+use A17\Twill\Models\Behaviors\HasBlocks;
+use A17\Twill\Models\Behaviors\HasMedias;
+use A17\Twill\Models\Model;
+
+class WeeklyAgenda extends Model
+{
+ use HasMedias;
+
+ protected $fillable = [
+ 'start_date',
+ 'title',
+ ];
+
+ protected $appends = ['title'];
+
+ public $mediasParams = [
+ 'events' => [
+ 'default' => [
+ [
+ 'name' => 'default',
+ 'ratio' => 0,
+ ],
+ ],
+ ],
+ ];
+
+ public function getTitleAttribute()
+ {
+ return $this->start_date;
+ }
+
+
+}
+
+++ /dev/null
-<?php
-
-namespace App\Repositories;
-
-use A17\Twill\Repositories\Behaviors\HandleBlocks;
-use A17\Twill\Repositories\Behaviors\HandleSlugs;
-use A17\Twill\Repositories\Behaviors\HandleMedias;
-use A17\Twill\Repositories\Behaviors\HandleRevisions;
-use A17\Twill\Repositories\Behaviors\HandleTags;
-use A17\Twill\Repositories\ModuleRepository;
-use App\Models\Article;
-
-class ArticleRepository extends ModuleRepository
-{
- use HandleBlocks, HandleSlugs, HandleMedias, HandleRevisions;
-
- public function __construct(Article $model)
- {
- $this->model = $model;
- }
-}
--- /dev/null
+<?php
+
+namespace App\Repositories;
+
+use A17\Twill\Repositories\Behaviors\HandleSlugs;
+use A17\Twill\Repositories\ModuleRepository;
+use App\Models\Humeur;
+
+class HumeurRepository extends ModuleRepository
+{
+ use HandleSlugs;
+
+ public function __construct(Humeur $model)
+ {
+ $this->model = $model;
+ }
+}
--- /dev/null
+<?php
+
+namespace App\Repositories;
+
+use A17\Twill\Repositories\Behaviors\HandleBlocks;
+use A17\Twill\Repositories\Behaviors\HandleMedias;
+use A17\Twill\Repositories\ModuleRepository;
+use App\Models\WeeklyAgenda;
+
+class WeeklyAgendaRepository extends ModuleRepository
+{
+ use HandleMedias;
+
+ public function __construct(WeeklyAgenda $model)
+ {
+ $this->model = $model;
+ }
+}
],
'content' => [
'title' => 'Contenu du site',
- 'route' => 'admin.content.homepage',
+ 'route' => 'pdfFiles.index',
+ 'module' => true,
'primary_navigation' => [
- 'homepage' => [
- 'title' => "Page d'accueil",
- 'route' => 'admin.content.homepage',
- ],
- 'pdfFiles' => [
- 'title' => 'Lettres',
- 'module' => true
- ],
-
- 'adCampaigns' => [
- 'title' => 'Campagnes publicitaires',
- 'module' => true
- ],
- 'laboArticles' => [
- 'title' => 'Actu des labos',
- 'module' => true
- ],
+// 'homepage' => [
+// 'title' => "Page d'accueil",
+// 'route' => 'admin.content.homepage',
+// ],
+ 'pdfFiles' => [
+ 'title' => 'Lettres',
+ 'module' => true
+ ],
+
+ 'adCampaigns' => [
+ 'title' => 'Campagnes publicitaires',
+ 'module' => true
+ ],
+ 'laboArticles' => [
+ 'title' => 'Actu des labos',
+ 'module' => true
+ ],
+ 'humeurs' => [
+ 'title' => 'Humeurs',
+ 'module' => true
+ ],
+ 'weeklyAgendas' => [
+ 'title' => 'Agenda',
+ 'module' => true
+ ],
+
+
// 'events' => [
// 'title' => 'Evénements',
// 'module' => true
// ],
- 'articles' => [
- 'title' => 'Humeurs',
- 'module' => true
- ],
- 'podcasts' => [
- 'title' => 'Podcasts',
- 'module' => true
- ],
+// 'articles' => [
+// 'title' => 'Humeurs',
+// 'module' => true
+// ],
+ 'podcasts' => [
+ 'title' => 'Podcasts',
+ 'module' => true
+ ],
],
],
],
'pillBoxSpaces' => [
- 'title' => 'Emplacement encadrés',
- 'module' => true
- ]
+ 'title' => 'Emplacement encadrés',
+ 'module' => true
+ ]
]
],
'otherContent' => [
],
'max_items' => 4,
],
- 'bloc_articles' => [
- 'name' => 'News de la semaine',
- 'bucketables' => [
- [
- 'module' => 'articles',
- 'name' => 'Articles',
- 'scopes' => ['published' => true],
- ],
- ],
- 'max_items' => 4,
- ],
'events' => [
'name' => 'Evénement mis en avant',
'bucketables' => [
'media_library' => [
'image_service' => \A17\Twill\Services\MediaLibrary\Glide::class,
+ 'extra_metadatas_fields' => [
+ ['name' => 'url', 'label' => 'Lien', 'type' => 'input'],
+ ],
],
'block_editor' => [
'block_single_layout' => 'site.layouts.block', // layout to use when rendering a single block in the editor
--- /dev/null
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class DropArticlesTables extends Migration
+{
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ \Schema::dropIfExists('article_slugs');
+ \Schema::dropIfExists('article_revisions');
+ \Schema::dropIfExists('articles');
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ //
+ }
+}
--- /dev/null
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+
+class CreateHumeursTables extends Migration
+{
+ public function up()
+ {
+ Schema::create('humeurs', 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();
+
+ // 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('extract')->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('humeur_slugs', function (Blueprint $table) {
+ createDefaultSlugsTableFields($table, 'humeur');
+ });
+
+
+ }
+
+ public function down()
+ {
+
+ Schema::dropIfExists('humeur_slugs');
+ Schema::dropIfExists('humeurs');
+ }
+}
--- /dev/null
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+
+class CreateWeeklyAgendasTables extends Migration
+{
+ public function up()
+ {
+ Schema::create('weekly_agendas', 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->date('start_date')->nullable();
+// $table->string('title')->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();
+ });
+
+
+
+
+
+
+ }
+
+ public function down()
+ {
+
+ Schema::dropIfExists('weekly_agendas');
+ }
+}
--- /dev/null
+@extends('twill::layouts.form')
+
+@section('contentFields')
+ @formField('input', [
+ 'name' => 'description',
+ 'label' => 'Description',
+ 'maxlength' => 100
+ ])
+@stop
--- /dev/null
+@extends('twill::layouts.form')
+
+@section('contentFields')
+ @formField('wysiwyg', [
+ 'name' => 'extract',
+ 'label' => 'Extrait',
+ 'maxlength' => 250
+ ])
+
+ @formField('wysiwyg', [
+ 'name' => 'content',
+ 'label' => 'Article complet',
+ ])
+@stop
+
--- /dev/null
+@formField('date_picker', [
+ 'name' => 'start_date',
+ 'label' => 'Date de la semaine (au lundi)',
+ 'withTime' => false,
+ 'altFormat' => 'j F Y'
+])
--- /dev/null
+@extends('twill::layouts.form')
+
+@section('contentFields')
+ @formField('medias', [
+ 'name' => 'events',
+ 'label' => 'Evénements',
+ 'withVideoUrl' => false,
+ 'withCaption' => false,
+ 'withAddinfo' => false,
+ 'extraMetadatas' => [['name' => 'url', 'label' => 'URL']],
+ 'max' => 50,
+ ])
+@stop
Route::module('events');
Route::module('podcasts');
Route::module('laboArticles');
+ Route::module('weeklyAgendas');
+ Route::module('eventImages');
+ Route::module('humeurs');
Route::module('guests'); //podcast guests
+
});
Route::prefix('settings')->group(function() {