]> _ Git - odl.git/commitdiff
wip #5027 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 17 Jan 2022 15:21:09 +0000 (16:21 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 17 Jan 2022 15:21:09 +0000 (16:21 +0100)
app/Models/Settings.php
resources/views/vendor/backpack/base/inc/sidebar_content.blade.php

index f4f133597821371136ec0329db7c7814b3b7f02d..542ab0ba7df36c0685762adfc0a25598c6554697 100644 (file)
@@ -6,85 +6,15 @@ namespace App\Models;
 
 class Settings extends \Cubist\Backpack\Magic\Models\Settings
 {
+    protected $_options = ['name' => 'settings',
+        'singular' => 'paramètre',
+        'plural' => 'paramètres',
+        'oneinstance' => true];
+
     public function setFields()
     {
-        parent::setFields();
-
-        $this->addField(['name' => 'email',
-            'type' => 'Email',
-            'label' => 'E-mail',
-            'tab' => 'Informations de contact']);
-
-        $this->addField(['name' => 'phone',
-            'type' => 'Text',
-            'label' => 'Téléphone',
-            'translatable' => true,
-            'tab' => 'Informations de contact']);
-
-        $this->addField(['name' => 'address',
-            'type' => 'Textarea',
-            'label' => 'Adresse',
-            'translatable' => false,
-            'tab' => 'Informations de contact']);
-
-        //=== Social Networks
-        $this->addField([
-            'name' => 'social',
-            'type' => 'BunchOfFields',
-            'bunch' => 'App\SubForms\SocialNetworks',
-            'label' => 'Réseaux Sociaux',
-            'tab' => 'Réseaux Sociaux',
-        ]);
-
-        //=== Forms
-        $this->addField([
-            'name' => 'form_default_recipients',
-            'type' => 'Tags',
-            'label' => 'Destinataires par défaut des formulaires',
-            'tab' => 'Formulaires',
-        ]);
-
-        $this->addField([
-            'name' => 'form_privacy',
-            'type' => 'Markdown',
-            'label' => 'Mention légale vie privée affichée sous les formulaires',
-            'tab' => 'Formulaires',
-        ]);
-
-
-        //=== Footer
-        $this->addField([
-            'name' => 'footer_text',
-            'type' => 'Textarea',
-            'label' => 'Texte de footer',
-            'attributes' => [
-                'rows' => 4,
-            ],
-            'tab' => 'Footer',
-        ]);
-
-        $this->addField([
-            'name' => 'footer_heading_contact',
-            'type' => 'Text',
-            'label' => 'Titre de colonne « Nous contacter »',
-            'tab' => 'Footer',
-        ]);
+        $this->addField('pin', 'Text', 'Code PIN', ['pattern' => '\d{4}']);
 
-        $this->addField([
-            'name' => 'footer_heading_strengths',
-            'type' => 'Text',
-            'label' => 'Titre de colonne « PMI à votre service »',
-            'tab' => 'Footer'
-        ]);
 
-        //=== Strengths / Points Forts
-        $this->addField([
-            'name' => 'strengths',
-            'type' => 'BunchOfFieldsMultiple',
-            'bunch' => 'App\SubForms\Strength',
-            'label' => 'Points Forts',
-            'tab' => 'Footer',
-            'translatable' => true,
-        ]);
     }
 }
index 68439385a65308ea55febb56070f3a26e36ed42f..f733708f153951145ee232104ec5695c7292c4f6 100644 (file)
                             class='la la-book'></i>
                         <span>Ressources</span></a></li>
             @endcan
-            @can('tour:read')
-                <li class='nav-item'><a class='nav-link' href='{{ backpack_url('tour') }}'><i
-                            class='la la-map-signs'></i>
-                        <span>Visite guidée</span></a></li>
+            @can('settings')
+                <li class='nav-item'><a class='nav-link' href='{{ backpack_url('settings') }}'><i
+                            class='la la-cog'></i>
+                        <span>Paramètres</span></a></li>
             @endcan
 
         </ul>