]> _ Git - songbook.git/commitdiff
.
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 20 Sep 2023 16:09:18 +0000 (18:09 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 20 Sep 2023 16:09:18 +0000 (18:09 +0200)
app/Http/Controllers/FrontController.php
app/Models/Collection.php
app/SubForm/AudioTrack.php
composer.json
resources/views/collection.blade.php
resources/views/menu.blade.php

index 524891739dec6462db87c53d77140aa04d4e5950..cf46f8366bc38e8b7e2e70cc839686bbc74773b0 100644 (file)
@@ -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 = '';
 
index 6270f428fa3446d871e1dcbc329e955d3656b8da..a51403ef07bb18d539400c3e87b756f64346d589 100644 (file)
@@ -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() {
index 2ea889d5a82b64a185d67292ab42a51d342a8def..37d7b16aea7645adbe246e7650af2eab717de6bb 100644 (file)
@@ -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]);
     }
 }
index 3333304d6212359d79e5b873a131a40b2f2e1437..1d62d8d7b1923bb0047ff69517c4b85ecd4e5b59 100644 (file)
         "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"
     },
     "config": {
         "optimize-autoloader": true,
         "preferred-install": "dist",
-        "sort-packages": true
+        "sort-packages": true,
+        "allow-plugins": {
+            "php-http/discovery": true
+        }
     },
     "extra": {
         "laravel": {
index 7987749050cfb233df57e06874a7563e8ba39aea..04b94ba5935ea75a9a4aa534a6052d52daabc950 100644 (file)
                     @endforeach
                 </ul>
             @endforeach
+            @if(isset($collection_lists) && count($collection_lists))
+                <ul class="list">
+                    <li><h3>🎵 {{__('All')}}</h3></li>
+                    @foreach($collection_songs as $csong)
+                        @include('collection_song')
+                    @endforeach
+                </ul>
+            @endif
         </nav>
     </article>
 @endsection
index 9301fdd9702df51817594a4870f7f307eed32cda..df431532bfc9690264545f1a75f109bb4c39497c 100644 (file)
                                 </ul>
                             </li>
                         @endforeach
+                        <li><span>🎵 {{__('All')}}</span>
+                            <ul>
+                                @foreach($collection_songs as $csong)
+                                    @include('menu_song')
+                                @endforeach
+                            </ul>
+                        </li>
                     @endif
                 </ul>
             </li>
                     <li><a target="_blank" href="{{$partition}}">🎼 {{__('Partition')}}</a></li>
                 @endif
                 @if($collection->download_assets)
-                    <li><a download="{{$song->title}}.zip" href="/downloadassets/{{$song->id}}">⬇️ &nbsp;{{__('Télécharger')}}</a></li>
+                    <li><a download="{{$song->title}}.zip" href="/downloadassets/{{$song->id}}">⬇️
+                            &nbsp;{{__('Télécharger')}}</a></li>
                 @endif
             @endif
 
                 @php
                     $planning=\Cubist\Util\Url::isLocal($collection->agenda)?'/collection/'.$collection->id.'/'.$collection->agenda:$collection->agenda;
                 @endphp
-            <li>
-                <span>🗓️ {{__('Planning')}}</span>
-                <ul>
-                    <iframe src="{{$planning}}" style="width: 100%;height:100%;border: 0;"></iframe>
-                </ul>
-            </li>
+                <li>
+                    <span>🗓️ {{__('Planning')}}</span>
+                    <ul>
+                        <iframe src="{{$planning}}" style="width: 100%;height:100%;border: 0;"></iframe>
+                    </ul>
+                </li>
             @endif
 
             @if($collection->organisation_name)