From 853e8c13bcb7ffd56073c754a3e815ccc7b61f49 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 20 Sep 2023 18:09:18 +0200 Subject: [PATCH] . --- app/Http/Controllers/FrontController.php | 4 ++-- app/Models/Collection.php | 8 +++++--- app/SubForm/AudioTrack.php | 8 ++++---- composer.json | 8 +++++--- resources/views/collection.blade.php | 8 ++++++++ resources/views/menu.blade.php | 22 +++++++++++++++------- 6 files changed, 39 insertions(+), 19 deletions(-) diff --git a/app/Http/Controllers/FrontController.php b/app/Http/Controllers/FrontController.php index 5248917..cf46f83 100644 --- a/app/Http/Controllers/FrontController.php +++ b/app/Http/Controllers/FrontController.php @@ -43,7 +43,7 @@ class FrontController extends Controller { return $this->notionCollection($collection); } - $lists = CollectionList::withoutGlobalScope('ownerclause')->where('collection', $collection->id)->get(); + $lists = CollectionList::withoutGlobalScope('ownerclause')->where('collection', $collection->id)->orderBy('id','desc')->get(); $songs = $this->_getSongsOfCollection($collection->id, $lists); return view('collection', ['menu' => true, 'songs' => $songs, 'collection' => $collection, 'collection_songs' => $songs, 'collection_lists' => $lists]); @@ -95,7 +95,7 @@ class FrontController extends Controller { } - $lists = CollectionList::withoutGlobalScope('ownerclause')->where('collection', $collection->id)->get(); + $lists = CollectionList::withoutGlobalScope('ownerclause')->where('collection', $collection->id)->orderBy('id','desc')->get(); $partition = false; $lyrics_html = ''; diff --git a/app/Models/Collection.php b/app/Models/Collection.php index 6270f42..a51403e 100644 --- a/app/Models/Collection.php +++ b/app/Models/Collection.php @@ -7,6 +7,7 @@ use Cubist\Backpack\Magic\Fields\Checkbox; use Cubist\Backpack\Magic\Fields\Color; use Cubist\Backpack\Magic\Fields\FilesOrURL; use Cubist\Backpack\Magic\Fields\Images; +use Cubist\Backpack\Magic\Fields\SelectFromArray; use Cubist\Backpack\Magic\Fields\SelectFromModel; use Cubist\Backpack\Magic\Fields\Slug; use Cubist\Backpack\Magic\Fields\Table; @@ -48,9 +49,10 @@ class Collection extends CubistMagicAbstractModel { $this->addField('agenda', FilesOrURL::class, 'Planning / Agenda', ['default' => false, 'database_default' => false]); $this->addField('organisation_name', Text::class, 'Label du lien "Répartition / organisation"', ['default' => false, 'database_default' => false]); $this->addField('organisation', FilesOrURL::class, 'Répartition / organisation', ['default' => false, 'database_default' => false]); - $this->addField('notion_key',Text::class,'Clé Notion'); - $this->addField('notion_database',Text::class,'Base de données Notion'); - $this->addField('notion_home',URL::class,'Home Notion'); + $this->addField('notion_key', Text::class, 'Clé Notion'); + $this->addField('notion_database', Text::class, 'Base de données Notion'); + $this->addField('notion_home', URL::class, 'Home Notion'); + $this->addField('radio', SelectFromArray::class, 'Radio', ['options' => ['disable' => __('Désactivée'), 'main' => __('Activée pour la liste principale'), 'all' => __('Activée pour toutes les listes')], "allows_empty" => false, 'default' => 'disabled']); } protected function _getFreeFileBaseDirectory() { diff --git a/app/SubForm/AudioTrack.php b/app/SubForm/AudioTrack.php index 2ea889d..37d7b16 100644 --- a/app/SubForm/AudioTrack.php +++ b/app/SubForm/AudioTrack.php @@ -3,16 +3,15 @@ namespace App\SubForm; use App\Field\Tone; +use Cubist\Backpack\Magic\Fields\Checkbox; use Cubist\Backpack\Magic\Fields\Files; use Cubist\Backpack\Magic\Fields\Integer; use Cubist\Backpack\Magic\Fields\Text; use Cubist\Backpack\Magic\Fields\URL; use Cubist\Backpack\Magic\SubForm; -class AudioTrack extends SubForm -{ - public function init() - { +class AudioTrack extends SubForm { + public function init() { parent::init(); $this->addField('name', Text::class, 'Nom'); @@ -21,5 +20,6 @@ class AudioTrack extends SubForm $this->addField('start', Integer::class, 'Commencer à ', ['suffix' => 'seconds']); $this->addField('end', Integer::class, 'Terminer à ', ['suffix' => 'seconds']); $this->addField('file', Files::class, 'ou Fichier'); + $this->addField('radio', Checkbox::class, 'Inclure dans la radio', ['default' => true]); } } diff --git a/composer.json b/composer.json index 3333304..1d62d8d 100644 --- a/composer.json +++ b/composer.json @@ -26,13 +26,12 @@ "ext-simplexml": "*", "ext-tidy": "*", "ext-zip": "*", - "cubist/cms-back": "dev-master", + "cubist/cms-back": "dev-backpack4.1", "fruitcake/laravel-cors": "^2.2", "guzzlehttp/psr7": "^2.0", "league/csv": "^9.8", "mariosimao/notion-sdk-php": "dev-parent-block-fix", "mxl/laravel-job": "^1.3", - "norkunas/youtube-dl-php": "dev-master", "php-ffmpeg/php-ffmpeg": "^0.18.0", "phpoffice/phpspreadsheet": "^1.25" }, @@ -51,7 +50,10 @@ "config": { "optimize-autoloader": true, "preferred-install": "dist", - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "php-http/discovery": true + } }, "extra": { "laravel": { diff --git a/resources/views/collection.blade.php b/resources/views/collection.blade.php index 7987749..04b94ba 100644 --- a/resources/views/collection.blade.php +++ b/resources/views/collection.blade.php @@ -27,6 +27,14 @@ @endforeach @endforeach + @if(isset($collection_lists) && count($collection_lists)) + + @endif @endsection diff --git a/resources/views/menu.blade.php b/resources/views/menu.blade.php index 9301fdd..df43153 100644 --- a/resources/views/menu.blade.php +++ b/resources/views/menu.blade.php @@ -31,6 +31,13 @@ @endforeach +
  • 🎵 {{__('All')}} + +
  • @endif @@ -115,7 +122,8 @@
  • 🎼 {{__('Partition')}}
  • @endif @if($collection->download_assets) -
  • ⬇️  {{__('Télécharger')}}
  • +
  • ⬇️ +  {{__('Télécharger')}}
  • @endif @endif @@ -123,12 +131,12 @@ @php $planning=\Cubist\Util\Url::isLocal($collection->agenda)?'/collection/'.$collection->id.'/'.$collection->agenda:$collection->agenda; @endphp -
  • - 🗓️ {{__('Planning')}} - -
  • +
  • + 🗓️ {{__('Planning')}} + +
  • @endif @if($collection->organisation_name) -- 2.39.5