From: Vincent Vanwaelscappel Date: Mon, 17 Jan 2022 15:21:09 +0000 (+0100) Subject: wip #5027 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=a07ec9911989235fb455463557ed885929d2802d;p=odl.git wip #5027 @0.5 --- diff --git a/app/Models/Settings.php b/app/Models/Settings.php index f4f1335..542ab0b 100644 --- a/app/Models/Settings.php +++ b/app/Models/Settings.php @@ -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, - ]); } } diff --git a/resources/views/vendor/backpack/base/inc/sidebar_content.blade.php b/resources/views/vendor/backpack/base/inc/sidebar_content.blade.php index 6843938..f733708 100644 --- a/resources/views/vendor/backpack/base/inc/sidebar_content.blade.php +++ b/resources/views/vendor/backpack/base/inc/sidebar_content.blade.php @@ -29,10 +29,10 @@ class='la la-book'> Ressources @endcan - @can('tour:read') - + @can('settings') + @endcan