enhance components, add mailtemplate, add traits for translations, for stats
This commit is contained in:
58
app/Mail/Acheminement.php
Normal file
58
app/Mail/Acheminement.php
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Mail;
|
||||||
|
|
||||||
|
use App\Models\Core\Mail\MailTemplate;
|
||||||
|
use App\Repositories\Core\DateTime;
|
||||||
|
use Illuminate\Bus\Queueable;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
use Spatie\MailTemplates\TemplateMailable;
|
||||||
|
use App\Repositories\Shop\Customers;
|
||||||
|
|
||||||
|
|
||||||
|
class Acheminement extends TemplateMailable
|
||||||
|
{
|
||||||
|
use Queueable, SerializesModels;
|
||||||
|
|
||||||
|
protected static $templateModelClass = MailTemplate::class;
|
||||||
|
|
||||||
|
public $user;
|
||||||
|
|
||||||
|
public $male;
|
||||||
|
|
||||||
|
public $subject;
|
||||||
|
|
||||||
|
public $url;
|
||||||
|
|
||||||
|
public function __construct($user, $subject = '')
|
||||||
|
{
|
||||||
|
$this->user = $user;
|
||||||
|
$this->male = $user->gender == 1;
|
||||||
|
$this->subject = $subject;
|
||||||
|
$this->from[] = ['address' => 'boutique@jardinenvie.com','name' => 'Boutique JardinEnVie'];
|
||||||
|
$this->reply_to = ['address' => 'boutique@jardinenvie.com','name' => 'Boutique JardinEnVie'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getDataByUser($user_id)
|
||||||
|
{
|
||||||
|
$user = self::getUser($user_id);
|
||||||
|
|
||||||
|
return $user ? [
|
||||||
|
'user' => $user->toArray(),
|
||||||
|
'male' => $user->gender == 1,
|
||||||
|
] : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getUser($id)
|
||||||
|
{
|
||||||
|
return Customers::get($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function build()
|
||||||
|
{
|
||||||
|
$data = ['user' => $this->user];
|
||||||
|
$template = $this->getTemplate();
|
||||||
|
return $this->view($template, $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
58
app/Mail/Bienvenue.php
Normal file
58
app/Mail/Bienvenue.php
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Mail;
|
||||||
|
|
||||||
|
use App\Models\Core\Mail\MailTemplate;
|
||||||
|
use App\Repositories\Core\DateTime;
|
||||||
|
use Illuminate\Bus\Queueable;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
use Spatie\MailTemplates\TemplateMailable;
|
||||||
|
use App\Repositories\Shop\Customers;
|
||||||
|
|
||||||
|
|
||||||
|
class Bienvenue extends TemplateMailable
|
||||||
|
{
|
||||||
|
use Queueable, SerializesModels;
|
||||||
|
|
||||||
|
protected static $templateModelClass = MailTemplate::class;
|
||||||
|
|
||||||
|
public $user;
|
||||||
|
|
||||||
|
public $male;
|
||||||
|
|
||||||
|
public $subject;
|
||||||
|
|
||||||
|
public $url;
|
||||||
|
|
||||||
|
public function __construct($user, $subject = '')
|
||||||
|
{
|
||||||
|
$this->user = $user;
|
||||||
|
$this->male = $user->gender == 1;
|
||||||
|
$this->subject = $subject;
|
||||||
|
$this->from[] = ['address' => 'boutique@jardinenvie.com','name' => 'Boutique JardinEnVie'];
|
||||||
|
$this->reply_to = ['address' => 'boutique@jardinenvie.com','name' => 'Boutique JardinEnVie'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getDataByUser($user_id)
|
||||||
|
{
|
||||||
|
$user = self::getUser($user_id);
|
||||||
|
|
||||||
|
return $user ? [
|
||||||
|
'user' => $user->toArray(),
|
||||||
|
'male' => $user->gender == 1,
|
||||||
|
] : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getUser($id)
|
||||||
|
{
|
||||||
|
return Customers::get($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function build()
|
||||||
|
{
|
||||||
|
$data = ['user' => $this->user];
|
||||||
|
$template = $this->getTemplate();
|
||||||
|
return $this->view($template, $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
58
app/Mail/ConfirmationCommande.php
Normal file
58
app/Mail/ConfirmationCommande.php
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Mail;
|
||||||
|
|
||||||
|
use App\Models\Core\Mail\MailTemplate;
|
||||||
|
use App\Repositories\Core\DateTime;
|
||||||
|
use Illuminate\Bus\Queueable;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
use Spatie\MailTemplates\TemplateMailable;
|
||||||
|
use App\Repositories\Shop\Customers;
|
||||||
|
|
||||||
|
|
||||||
|
class ConfirmationCommande extends TemplateMailable
|
||||||
|
{
|
||||||
|
use Queueable, SerializesModels;
|
||||||
|
|
||||||
|
protected static $templateModelClass = MailTemplate::class;
|
||||||
|
|
||||||
|
public $user;
|
||||||
|
|
||||||
|
public $male;
|
||||||
|
|
||||||
|
public $subject;
|
||||||
|
|
||||||
|
public $url;
|
||||||
|
|
||||||
|
public function __construct($user, $subject = '')
|
||||||
|
{
|
||||||
|
$this->user = $user;
|
||||||
|
$this->male = $user->gender == 1;
|
||||||
|
$this->subject = $subject;
|
||||||
|
$this->from[] = ['address' => 'boutique@jardinenvie.com','name' => 'Boutique JardinEnVie'];
|
||||||
|
$this->reply_to = ['address' => 'boutique@jardinenvie.com','name' => 'Boutique JardinEnVie'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getDataByUser($user_id)
|
||||||
|
{
|
||||||
|
$user = self::getUser($user_id);
|
||||||
|
|
||||||
|
return $user ? [
|
||||||
|
'user' => $user->toArray(),
|
||||||
|
'male' => $user->gender == 1,
|
||||||
|
] : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getUser($id)
|
||||||
|
{
|
||||||
|
return Customers::get($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function build()
|
||||||
|
{
|
||||||
|
$data = ['user' => $this->user];
|
||||||
|
$template = $this->getTemplate();
|
||||||
|
return $this->view($template, $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
58
app/Mail/Preparation.php
Normal file
58
app/Mail/Preparation.php
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Mail;
|
||||||
|
|
||||||
|
use App\Models\Core\Mail\MailTemplate;
|
||||||
|
use App\Repositories\Core\DateTime;
|
||||||
|
use Illuminate\Bus\Queueable;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
use Spatie\MailTemplates\TemplateMailable;
|
||||||
|
use App\Repositories\Shop\Customers;
|
||||||
|
|
||||||
|
|
||||||
|
class Preparation extends TemplateMailable
|
||||||
|
{
|
||||||
|
use Queueable, SerializesModels;
|
||||||
|
|
||||||
|
protected static $templateModelClass = MailTemplate::class;
|
||||||
|
|
||||||
|
public $user;
|
||||||
|
|
||||||
|
public $male;
|
||||||
|
|
||||||
|
public $subject;
|
||||||
|
|
||||||
|
public $url;
|
||||||
|
|
||||||
|
public function __construct($user, $subject = '')
|
||||||
|
{
|
||||||
|
$this->user = $user;
|
||||||
|
$this->male = $user->gender == 1;
|
||||||
|
$this->subject = $subject;
|
||||||
|
$this->from[] = ['address' => 'boutique@jardinenvie.com','name' => 'Boutique JardinEnVie'];
|
||||||
|
$this->reply_to = ['address' => 'boutique@jardinenvie.com','name' => 'Boutique JardinEnVie'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getDataByUser($user_id)
|
||||||
|
{
|
||||||
|
$user = self::getUser($user_id);
|
||||||
|
|
||||||
|
return $user ? [
|
||||||
|
'user' => $user->toArray(),
|
||||||
|
'male' => $user->gender == 1,
|
||||||
|
] : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getUser($id)
|
||||||
|
{
|
||||||
|
return Customers::get($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function build()
|
||||||
|
{
|
||||||
|
$data = ['user' => $this->user];
|
||||||
|
$template = $this->getTemplate();
|
||||||
|
return $this->view($template, $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -11,8 +11,6 @@ class MailTemplate extends parentMailTemplate
|
|||||||
{
|
{
|
||||||
use HasTranslations, RevisionableTrait, Userstamps;
|
use HasTranslations, RevisionableTrait, Userstamps;
|
||||||
|
|
||||||
protected $connection = 'central';
|
|
||||||
|
|
||||||
public $translatable = ['subject', 'html_template', 'text_template'];
|
public $translatable = ['subject', 'html_template', 'text_template'];
|
||||||
|
|
||||||
protected $revisionCreationsEnabled = false;
|
protected $revisionCreationsEnabled = false;
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Repositories\Core;
|
|
||||||
|
|
||||||
use Qoraiche\MailEclipse\MailEclipse;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
|
|
||||||
class Mailer
|
|
||||||
{
|
|
||||||
public static function getTemplates()
|
|
||||||
{
|
|
||||||
// $mailables = MailEclipse::getMailables();
|
|
||||||
// DB::rollBack();
|
|
||||||
// dump($mailables);
|
|
||||||
/*
|
|
||||||
$mailables = (null !== $mailables) ? $mailables->sortBy('name') : collect([]);
|
|
||||||
foreach ($mailables as $mailable)
|
|
||||||
{
|
|
||||||
$templates[] = $mailable['name'];
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
$templates = ['EventInscription','EventSaveTheDate','MatinalesBadge','MatinalesThanks','MatinalesReplays'];
|
|
||||||
return $templates;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getTemplate($template_id)
|
|
||||||
{
|
|
||||||
$templates = self::getTemplates();
|
|
||||||
return $templates[$template_id];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
26
app/Traits/HasTranslations.php
Normal file
26
app/Traits/HasTranslations.php
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Traits;
|
||||||
|
|
||||||
|
use Spatie\Translatable\HasTranslations as BaseHasTranslations;
|
||||||
|
|
||||||
|
trait HasTranslations
|
||||||
|
{
|
||||||
|
use BaseHasTranslations;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert the model instance to an array.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function toArray()
|
||||||
|
{
|
||||||
|
$attributes = parent::toArray();
|
||||||
|
foreach ($this->getTranslatableAttributes() as $field) {
|
||||||
|
$attributes[$field] = $this->getTranslation($field, \App::getLocale());
|
||||||
|
$attributes[$field.'_translations'] = $this->getTranslations($field);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $attributes;
|
||||||
|
}
|
||||||
|
}
|
||||||
13
app/Traits/StatHelpers.php
Normal file
13
app/Traits/StatHelpers.php
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Traits;
|
||||||
|
|
||||||
|
trait StatHelpers
|
||||||
|
{
|
||||||
|
public static function getLastValue()
|
||||||
|
{
|
||||||
|
$item = self::query()->start(now())->end(now()->subSecond())->groupByDay()->get();
|
||||||
|
|
||||||
|
return $item ? $item[0]->value : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -112,7 +112,6 @@
|
|||||||
"facade/ignition": "^2.9",
|
"facade/ignition": "^2.9",
|
||||||
"fakerphp/faker": "^1.13",
|
"fakerphp/faker": "^1.13",
|
||||||
"fossbarrow/laravel-phpcs": "dev-main",
|
"fossbarrow/laravel-phpcs": "dev-main",
|
||||||
"imanghafoori/laravel-microscope": "1.0.278",
|
|
||||||
"kevincobain2000/laravel-erd": "^1.3",
|
"kevincobain2000/laravel-erd": "^1.3",
|
||||||
"mockery/mockery": "^1.4.2",
|
"mockery/mockery": "^1.4.2",
|
||||||
"nunomaduro/collision": "^5.4",
|
"nunomaduro/collision": "^5.4",
|
||||||
|
|||||||
213
resources/lang/fr/Core.php
Normal file
213
resources/lang/fr/Core.php
Normal file
@@ -0,0 +1,213 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'save' => 'Sauver',
|
||||||
|
'cancel' => 'Annuler',
|
||||||
|
'dashboard' => 'Tableau de bord',
|
||||||
|
'edit_profile' => 'Editer votre profil',
|
||||||
|
'change_password' => 'Modifier votre mot de passe',
|
||||||
|
'old_password' => 'Ancien mot de passe',
|
||||||
|
'expired_password' => 'Votre mot de passe est expiré. Vous devez changer votre mot de passe.',
|
||||||
|
'add' => 'Ajouter',
|
||||||
|
'search' => 'Chercher',
|
||||||
|
'reset' => 'Réinitialiser',
|
||||||
|
'close' => 'Fermer',
|
||||||
|
'apply' => 'Appliquer',
|
||||||
|
'forward_to' => 'Faire suivre',
|
||||||
|
'answer' => 'Répondre',
|
||||||
|
'new' => 'Nouveau',
|
||||||
|
'lang' => 'Langue',
|
||||||
|
'name' => 'Nom',
|
||||||
|
'gender' => 'Genre',
|
||||||
|
'position' => 'Poste',
|
||||||
|
'department' => 'Département',
|
||||||
|
'office' => 'Bureau',
|
||||||
|
'lastname' => 'Nom',
|
||||||
|
'firstname' => 'Prénom',
|
||||||
|
'phone' => 'Téléphone',
|
||||||
|
'phone_central' => 'Téléphone principal',
|
||||||
|
'phone_pro' => 'Téléphone professionnel',
|
||||||
|
'fax' => 'Fax',
|
||||||
|
'email' => 'Email',
|
||||||
|
'mobile' => 'Mobile',
|
||||||
|
'country' => 'Pays',
|
||||||
|
'list' => 'Liste',
|
||||||
|
'active' => 'Actif',
|
||||||
|
'inactive' => 'Inactif',
|
||||||
|
'title' => 'Titre',
|
||||||
|
'website' => 'Adresse web',
|
||||||
|
'color' => 'Couleur',
|
||||||
|
'select' => 'Sélectionner',
|
||||||
|
'selected' => 'Sélectionné(s)',
|
||||||
|
'non_selected' => 'Non sélectionné(s)',
|
||||||
|
'moved' => 'Déplacé(s)',
|
||||||
|
'move_all' => 'Tout déplacer',
|
||||||
|
'empty_list' => 'Liste vide',
|
||||||
|
'show_all' => 'Tout voir',
|
||||||
|
'showing_all' => 'Voir tout : ',
|
||||||
|
'filtered' => 'Filtré(s) : ',
|
||||||
|
'from' => 'sur',
|
||||||
|
'remove_all' => 'Tout enlever',
|
||||||
|
'remove_selected' => 'Enlever la sélection',
|
||||||
|
'select_all' => 'Tout sélectionner',
|
||||||
|
'yes' => 'Oui',
|
||||||
|
'no' => 'Non',
|
||||||
|
'selction' => 'sélection',
|
||||||
|
'mr' => 'M.',
|
||||||
|
'mrs' => 'Mme',
|
||||||
|
'zipcode' => 'Code postal',
|
||||||
|
'company' => 'Entreprise',
|
||||||
|
'address' => 'Adresse',
|
||||||
|
'street' => 'Rue',
|
||||||
|
'state' => 'Région',
|
||||||
|
'postal_address' => 'Adresse postale',
|
||||||
|
'city' => 'Ville',
|
||||||
|
'person_in_charge' => 'Responsable',
|
||||||
|
'administrative_codes' => 'Renseignements administratifs',
|
||||||
|
'category' => 'Catégorie',
|
||||||
|
'choose_a_file' => 'Choisissez un fichier',
|
||||||
|
'select_a_value' => 'Selectionnez une valeur',
|
||||||
|
'members_area' => 'Espace réservé',
|
||||||
|
'login' => 'Identifiant',
|
||||||
|
'password' => 'Mot de passe',
|
||||||
|
'login_to_your_account' => 'Se connecter à votre compte',
|
||||||
|
'password_reset' => 'Réinitialisation du mot de passe',
|
||||||
|
'sign_in' => 'Connexion',
|
||||||
|
'updated_at' => 'Mis à jour le',
|
||||||
|
'settings' => 'Paramètres',
|
||||||
|
'selection' => 'sélection',
|
||||||
|
'street_complement' => 'Complément d\'adresse',
|
||||||
|
'submit' => 'Envoyer',
|
||||||
|
'confirm_new_password' => 'Confirmez le nouveau mot de passe',
|
||||||
|
'comments' => [
|
||||||
|
'title' => 'Commentaires',
|
||||||
|
'name' => 'Commentaire',
|
||||||
|
'description' => 'Gérer les commentaires',
|
||||||
|
'add' => 'Ajouter un commentaire',
|
||||||
|
'show' => 'Voir un commentaire',
|
||||||
|
'edit' => 'Editer un commentaire',
|
||||||
|
'del' => 'Effacer un commentaire',
|
||||||
|
'list' => 'Liste des commentaires',
|
||||||
|
'successadd' => 'Le commentaire a été correctement ajouté',
|
||||||
|
'successmod' => 'Le commentaire a été correctement modifiée',
|
||||||
|
'successdel' => 'Le commentaire a été correctement effacé',
|
||||||
|
'confirmdelete' => 'Confirmez-vous la suppression du commentaire ?',
|
||||||
|
'count' => 'Nb de commentaires',
|
||||||
|
],
|
||||||
|
'at' => 'à',
|
||||||
|
'the' => 'Le',
|
||||||
|
'has_been_modified_by' => 'a été modifié(e) par',
|
||||||
|
'have_modified' => 'a modifié ',
|
||||||
|
'the_field' => 'Le champ',
|
||||||
|
'created_at' => 'Créé le',
|
||||||
|
'filters' => 'Filtres',
|
||||||
|
'declare_bug' => 'Déclarer un bug',
|
||||||
|
'volume' => 'Volume',
|
||||||
|
'users' => [
|
||||||
|
'title' => 'Utilisateurs',
|
||||||
|
'name' => 'utilisateur',
|
||||||
|
'description' => 'Gérer les utilisateurs',
|
||||||
|
'add' => 'Ajouter un utilisateur',
|
||||||
|
'edit' => 'Editer un utilisateur',
|
||||||
|
'del' => 'Effacer un utilisateur',
|
||||||
|
'list' => 'Liste des utilisateurs',
|
||||||
|
'successadd' => 'L\'utilisateur a été correctement ajouté',
|
||||||
|
'successmod' => 'L\'utilisateur a été correctement modifié',
|
||||||
|
'successdel' => 'L\'utilisateur a été correctement effacé',
|
||||||
|
'confirmdelete' => 'Confirmez-vous la suppression de l\'utilisateur ?',
|
||||||
|
],
|
||||||
|
'roles' => [
|
||||||
|
'title' => 'Roles',
|
||||||
|
'name' => 'Role',
|
||||||
|
'description' => 'Gérer les roles',
|
||||||
|
'add' => 'Ajouter un role',
|
||||||
|
'show' => 'Voir un role',
|
||||||
|
'edit' => 'Editer un role',
|
||||||
|
'del' => 'Effacer un role',
|
||||||
|
'list' => 'Liste des roles',
|
||||||
|
'successadd' => 'Le role a été correctement ajouté',
|
||||||
|
'successmod' => 'Le role a été correctement modifiée',
|
||||||
|
'successdel' => 'Le role a été correctement effacé',
|
||||||
|
'confirmdelete' => 'Confirmez-vous la suppression du role ?',
|
||||||
|
'count' => 'Nb de roles',
|
||||||
|
],
|
||||||
|
'permissions' => [
|
||||||
|
'title' => 'Permissions',
|
||||||
|
'name' => 'Permission',
|
||||||
|
'description' => 'Gérer les permissions',
|
||||||
|
'add' => 'Ajouter une permission',
|
||||||
|
'edit' => 'Editer une permission',
|
||||||
|
'del' => 'Effacer une permission',
|
||||||
|
'list' => 'Liste des permissions',
|
||||||
|
'successadd' => 'La permission a été correctement ajoutée',
|
||||||
|
'successmod' => 'La permission a été correctement modifiée',
|
||||||
|
'successdel' => 'La permission a été correctement effacée',
|
||||||
|
'confirmdelete' => 'Confirmez-vous la suppression de la permission ?',
|
||||||
|
],
|
||||||
|
'bugs' => [
|
||||||
|
'title' => 'Bugs',
|
||||||
|
'name' => 'Bug',
|
||||||
|
'description' => 'Gérer les bugs',
|
||||||
|
'add' => 'Ajouter un bug',
|
||||||
|
'edit' => 'Editer un bug',
|
||||||
|
'del' => 'Effacer un bug',
|
||||||
|
'list' => 'Liste des bugs',
|
||||||
|
'successadd' => 'Le bug a été correctement ajouté',
|
||||||
|
'successmod' => 'Le bug a été correctement modifié',
|
||||||
|
'successdel' => 'Le bug a été correctement effacé',
|
||||||
|
'confirmdelete' => 'Confirmez-vous la suppression du bug ?',
|
||||||
|
'count' => 'Nb de bugs',
|
||||||
|
],
|
||||||
|
'mail_templates' => [
|
||||||
|
'title' => 'Templates de mails',
|
||||||
|
'name' => 'Template de mails',
|
||||||
|
'description' => 'Gérer les templates de mails',
|
||||||
|
'add' => 'Ajouter un template',
|
||||||
|
'edit' => 'Editer un template',
|
||||||
|
'del' => 'Effacer un template',
|
||||||
|
'list' => 'Liste des templates de mail',
|
||||||
|
'successadd' => 'Le template a été correctement ajouté',
|
||||||
|
'successmod' => 'Le template a été correctement modifié',
|
||||||
|
'successdel' => 'Le template a été correctement effacé',
|
||||||
|
'confirmdelete' => 'Confirmez-vous la suppression du template ?',
|
||||||
|
'count' => 'Nb de templates',
|
||||||
|
],
|
||||||
|
'mailables' => 'Fonctions de mail',
|
||||||
|
'variables' => 'Variables',
|
||||||
|
'change_to' => 'Changer vers',
|
||||||
|
'deleted_at' => 'Effacé le',
|
||||||
|
'created_by' => 'Créé par',
|
||||||
|
'updated_by' => 'Mis à jour par',
|
||||||
|
'deleted_by' => 'Effacé par',
|
||||||
|
'expire_at' => 'Expire le',
|
||||||
|
'last_login' => 'Dernière connexion',
|
||||||
|
'status' => 'Statut',
|
||||||
|
'type' => 'Type',
|
||||||
|
'private' => 'Privé',
|
||||||
|
'public' => 'Publique',
|
||||||
|
'slug' => 'Variable',
|
||||||
|
'priority' => 'Priorité',
|
||||||
|
'due_date' => 'Due date',
|
||||||
|
'subject' => 'Sujet',
|
||||||
|
'duration' => 'Durée',
|
||||||
|
'preview' => 'Prévisualiser',
|
||||||
|
'date' => 'Date',
|
||||||
|
'application_modules' => [
|
||||||
|
'title' => 'Modules applications',
|
||||||
|
'name' => 'Module application',
|
||||||
|
'count' => 'Nb de modules',
|
||||||
|
'description' => 'Gérer les modules',
|
||||||
|
'add' => 'Ajouter un module',
|
||||||
|
'edit' => 'Editer un module',
|
||||||
|
'del' => 'Effacer un module',
|
||||||
|
'list' => 'Liste des modules',
|
||||||
|
'successadd' => 'Le module a été correctement ajouté',
|
||||||
|
'successmod' => 'Le module a été correctement modifié',
|
||||||
|
'successdel' => 'Le module a été correctement effacé',
|
||||||
|
'confirmdelete' => 'Confirmez-vous la suppression du module ?',
|
||||||
|
],
|
||||||
|
'person' => 'Personne',
|
||||||
|
'processing' => 'En cours',
|
||||||
|
'all' => 'Tous',
|
||||||
|
'impersonate' => 'Se faire passer pour',
|
||||||
|
];
|
||||||
@@ -1,12 +1,10 @@
|
|||||||
@extends('layout.index', [
|
@extends('layout.index', [
|
||||||
'title' => __('Core.mail_templates.title'),
|
'title' => __('Core.mail_templates.title'),
|
||||||
'subtitle' => __('Core.mail_templates.list'),
|
'subtitle' => __('Core.mail_templates.list'),
|
||||||
'breadcrumb' => [
|
'breadcrumb' => []
|
||||||
]
|
|
||||||
])
|
])
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
|
||||||
<x-card>
|
<x-card>
|
||||||
@include('components.datatable', [
|
@include('components.datatable', [
|
||||||
'route' => route('Admin.Core.Mail.MailTemplate.index'),
|
'route' => route('Admin.Core.Mail.MailTemplate.index'),
|
||||||
@@ -23,13 +21,14 @@
|
|||||||
@component('components.layout.modal-filters', ['title' => 'Filters', 'id' => 'modal-mail_templates-filters'])
|
@component('components.layout.modal-filters', ['title' => 'Filters', 'id' => 'modal-mail_templates-filters'])
|
||||||
@include('admin.Core.Mail.MailTemplate.partials.filters', ['model' => 'mail_templates'])
|
@include('admin.Core.Mail.MailTemplate.partials.filters', ['model' => 'mail_templates'])
|
||||||
@endcomponent
|
@endcomponent
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@include('load.form.datepicker')
|
@include('load.form.datepicker')
|
||||||
@include('load.form.select2')
|
@include('load.form.select2')
|
||||||
@include('load.form.editor')
|
@include('load.form.editor')
|
||||||
|
@include('load.form.toggle')
|
||||||
@include('load.form.upload.fileinput')
|
@include('load.form.upload.fileinput')
|
||||||
|
@include('load.layout.modal')
|
||||||
|
|
||||||
@push('js')
|
@push('js')
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -21,16 +21,11 @@
|
|||||||
'required' => true,
|
'required' => true,
|
||||||
])
|
])
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4">
|
<div class="col-6">
|
||||||
<div id="mail_template-vars">
|
<div id="mail_template-vars">
|
||||||
@include('admin.Core.Mail.MailTemplate.partials.vars', ['vars' => $mail_template['vars'] ?? []])
|
@include('admin.Core.Mail.MailTemplate.partials.vars', ['vars' => $mail_template['vars'] ?? []])
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-2 text-right">
|
|
||||||
<label>@lang('Core.change_to')</label><br/>
|
|
||||||
<img id="lang_en" class="lang" data-lang="en" role="button" src="{{ asset('vendor/blade-flags/language-en.svg') }}" width="32" height="32"/>
|
|
||||||
<img id="lang_fr" class="lang d-none" data-lang="fr" role="button" src="{{ asset('vendor/blade-flags/language-fr.svg') }}" width="32" height="32"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="mode_fr" class="">
|
<div id="mode_fr" class="">
|
||||||
@@ -67,42 +62,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="mode_en" class="d-none">
|
|
||||||
<div class="row mb-3">
|
|
||||||
<div class="col-6">
|
|
||||||
@include('components.form.input', [
|
|
||||||
'name' => 'subject[en]',
|
|
||||||
'value' => $mail_template['subject_translations']['en'] ?? '',
|
|
||||||
'label' => __('Core.subject'),
|
|
||||||
'required' => true,
|
|
||||||
])
|
|
||||||
</div>
|
|
||||||
<div class ="col-6">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row mb-3">
|
|
||||||
<div class="col-12">
|
|
||||||
@include('components.form.editor', [
|
|
||||||
'name' => 'html_template[en]',
|
|
||||||
'value' => $mail_template['html_template_translations']['en'] ?? '',
|
|
||||||
'label' => 'HTML',
|
|
||||||
'rows' => 10,
|
|
||||||
])
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row mb-3">
|
|
||||||
<div class="col-12">
|
|
||||||
@include('components.form.textarea', [
|
|
||||||
'name' => 'text_template[en]',
|
|
||||||
'value' => $mail_template['text_template_translations']['en'] ?? '',
|
|
||||||
'label' => 'Text',
|
|
||||||
])
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{ Form::close() }}
|
{{ Form::close() }}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<div class="row h-100 products @if($article_nature == 1) shadow2 @endif" data-id="semences">
|
<div class="row btn h-100 products @if($article_nature == 1) shadow2 @endif" data-id="semences">
|
||||||
<div class="col-lg-6 col-xs-12">
|
<div class="col-lg-6 col-xs-12">
|
||||||
<img src="/img/article_natures/semences.png" class="img-fluid">
|
<img src="/img/article_natures/semences.png" class="img-fluid">
|
||||||
</div>
|
</div>
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<div class="row h-100 products @if($article_nature == 2) shadow2 @endif" data-id="plants">
|
<div class="row btn h-100 products @if($article_nature == 2) shadow2 @endif" data-id="plants">
|
||||||
<div class="col-lg-6 col-xs-12">
|
<div class="col-lg-6 col-xs-12">
|
||||||
<img src="/img/article_natures/plants.png" class="img-fluid" class="img-fluid">
|
<img src="/img/article_natures/plants.png" class="img-fluid" class="img-fluid">
|
||||||
</div>
|
</div>
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<div class="row h-100 products @if($article_nature == 3) shadow2 @endif" data-id="legumes">
|
<div class="row btn h-100 products @if($article_nature == 3) shadow2 @endif" data-id="legumes">
|
||||||
<div class="col-lg-6 col-xs-12">
|
<div class="col-lg-6 col-xs-12">
|
||||||
<img src="/img/article_natures/legumes.png" class="img-fluid" class="img-fluid">
|
<img src="/img/article_natures/legumes.png" class="img-fluid" class="img-fluid">
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,8 +1,19 @@
|
|||||||
@include('load.form.datepicker')
|
@if (($readonly ?? false) || ($disabled ?? false))
|
||||||
|
@include('components.form.input')
|
||||||
<div class="input-group date" data-target-input="nearest">
|
@else
|
||||||
@include('components.form.input', ['class' => 'datepicker', 'meta' => 'data-target="#'.str_slug($name).'"', 'placeholder' => App\Repositories\Core\DateTime::getLocaleFormatDate() ])
|
@include('components.form.label')
|
||||||
<div class="input-group-append" data-target="#{{ str_slug($name) }}" data-toggle="datetimepicker">
|
<div class="input-group date" data-target-input="nearest">
|
||||||
|
@include('components.form.input', [
|
||||||
|
'type' => 'text',
|
||||||
|
'class' => $class ?? ' datepicker',
|
||||||
|
'meta' => 'data-target="#' . ($id_name ?? str_slug($name, '-')) . '"',
|
||||||
|
'placeholder' => $placeholder ?? App\Repositories\Core\DateTime::getLocaleFormatDate(),
|
||||||
|
'label' => false,
|
||||||
|
])
|
||||||
|
<div class="input-group-append" data-target="#{{ $id_name ?? str_slug($name, '-') }}" data-toggle="datetimepicker">
|
||||||
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
|
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@include('load.form.datepicker')
|
||||||
|
|||||||
11
resources/views/components/form/daterangepicker.blade.php
Normal file
11
resources/views/components/form/daterangepicker.blade.php
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
@include('load.form.daterangepicker')
|
||||||
|
|
||||||
|
<div class="input-group date {{ $classGroup ?? '' }}" data-target-input="nearest">
|
||||||
|
@include('components.form.input', [
|
||||||
|
'class' => ($class ?? '') . ' daterangepickerItems',
|
||||||
|
'placeholder' => $placeholder ?? App\Repositories\Core\DateTime::getLocaleFormatDate(),
|
||||||
|
])
|
||||||
|
<div class="input-group-append">
|
||||||
|
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -1,19 +1,9 @@
|
|||||||
<textarea
|
@include('components.form.textarea', [
|
||||||
name="{{ $name }}"
|
'rows' => $rows ?? 3,
|
||||||
@if (isset($id_name))id="{{ $id_name }}"@endif
|
'class' => 'editor ' . ($class ?? ''),
|
||||||
class="editor form-control @if (isset($class)){{ $class }}@endif"
|
])
|
||||||
@if (isset($rows)) rows="{{ $rows }}"@endif
|
|
||||||
>@if (isset($value)){{ $value }}@endif</textarea>
|
|
||||||
|
|
||||||
|
|
||||||
@if(!defined('LOAD_EDITOR'))
|
@if(!defined('LOAD_EDITOR'))
|
||||||
@include('load.form.editor')
|
@include('load.form.editor')
|
||||||
@push('js')
|
|
||||||
<script>
|
|
||||||
$(function() {
|
|
||||||
initEditor();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@endpush
|
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
|
@include('components.form.label')
|
||||||
|
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
|
@include('components.form.input', ['label' => false])
|
||||||
@include('components.form.input')
|
|
||||||
|
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<button class="btn btn-outline-secondary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
<button class="btn btn-outline-secondary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
<i class="fa fa-globe"></i>
|
<i class="fa fa-globe"></i>
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
@if (is_array($translations))
|
@if (is_array($translations ?? false))
|
||||||
@foreach ($translations as $lang => $translation)
|
@foreach ($translations as $lang => $translation)
|
||||||
<a class="dropdown-item" href="#">{{ $lang }} : {{ $translation }}</a>
|
<a class="dropdown-item" href="#">{{ $lang }} : {{ $translation }}</a>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
@if(empty($name))
|
||||||
|
<code>
|
||||||
|
<x-boilerplate::input>
|
||||||
|
The name attribute has not been set
|
||||||
|
</code>
|
||||||
|
@else
|
||||||
|
<div class="form-group{{ isset($groupClass) ? ' '.$groupClass : '' }}"{!! isset($groupId) ? ' id="'.$groupId.'"' : '' !!}>
|
||||||
|
@isset($label)
|
||||||
|
<label>{!! __($label) !!}</label>
|
||||||
|
@endisset
|
||||||
|
@if($prepend || $prependText || $append || $appendText)
|
||||||
|
<div class="input-group">
|
||||||
|
@endif
|
||||||
|
@if($prepend || $prependText)
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
@if($prepend)
|
||||||
|
{!! $prepend !!}
|
||||||
|
@else
|
||||||
|
<span class="input-group-text">{!! $prependText !!}</span>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@if($type === 'password')
|
||||||
|
{!! Form::password($name, array_merge(['class' => 'form-control'.$errors->first($name,' is-invalid').(isset($class) ? ' '.$class : '')], $attributes)) !!}
|
||||||
|
@elseif($type === 'file')
|
||||||
|
{!! Form::file($name, array_merge(['class' => 'form-control-file'.$errors->first($name,' is-invalid').(isset($class) ? ' '.$class : '')], $attributes)) !!}
|
||||||
|
@elseif($type === 'select')
|
||||||
|
{!! Form::select($name, $options ?? [], old($name, $value ?? ''), array_merge(['class' => 'form-control'.$errors->first($name,' is-invalid').(isset($class) ? ' '.$class : '')], $attributes)) !!}
|
||||||
|
@else
|
||||||
|
{!! Form::{$type ?? 'text'}($name, old($name, $value ?? ''), array_merge(['class' => 'form-control'.$errors->first($name,' is-invalid').(isset($class) ? ' '.$class : '')], $attributes)) !!}
|
||||||
|
@endif
|
||||||
|
@if($append || $appendText)
|
||||||
|
<div class="input-group-append">
|
||||||
|
@if($append)
|
||||||
|
{!! $append !!}
|
||||||
|
@else
|
||||||
|
<span class="input-group-text">{!! $appendText !!}</span>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@if($prepend || $prependText || $append || $appendText)
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@if($help ?? false)
|
||||||
|
<small class="form-text text-muted">@lang($help)</small>
|
||||||
|
@endif
|
||||||
|
@error($name)
|
||||||
|
<div class="error-bubble"><div>{{ $message }}</div></div>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
@@ -1,17 +1,18 @@
|
|||||||
|
@include('components.form.label')
|
||||||
|
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
@include('components.form.input')
|
@include('components.form.input', ['label' => false])
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<div class="input-group-text btn btn-{{ $class ?? '' }}" role="button"><i class="fa fa-{{ $icon ?? '' }}"></i></div>
|
<div class="input-group-text btn btn-{{ $class ?? '' }}" role="button"><i class="fa fa-{{ $icon ?? '' }}"></i></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if (isset($click))
|
@isset($click)
|
||||||
@push('js')
|
@push('js')
|
||||||
<script>
|
<script>
|
||||||
$('.btn-{{ $class ?? '' }}').off().click(function() {
|
$('.btn-{{ $class ?? '' }}').off().click(function() {
|
||||||
var value = $(this).closest('.input-group').find('input').val();
|
var value = $(this).closest('.input-group').find('input').val();
|
||||||
console.log(value);
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
@endif
|
@endisset
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
|
@include('components.form.label')
|
||||||
|
|
||||||
<input type="number" name="{{ $name }}" id="{{ $id_name ?? str_slug($name,'-') }}" class="form-control {{ $class ?? ''}}" value="{{ $value ?? ''}}"
|
<input type="number" name="{{ $name }}" id="{{ $id_name ?? str_slug($name,'-') }}" class="form-control {{ $class ?? ''}}" value="{{ $value ?? ''}}"
|
||||||
@if (isset($data_id))
|
@if ($required ?? false) required @endif
|
||||||
data-id="{{ $data_id }}"
|
@if ($disabled ?? false) disabled @endif
|
||||||
@endif
|
@if ($readonly ?? false) readonly @endif
|
||||||
@if (isset($required))
|
@if ($autofocus ?? false) autofocus @endif
|
||||||
required="required"
|
@if ($size ?? false) size="{{ $size }}" @endif
|
||||||
@endif
|
@if ($autocomplete ?? false) autocomplete="{{ $autocomplete }}" @endif
|
||||||
{{ isset($min) ? 'min="' . $min . '"' : ''}}
|
@if ($min ?? false) min={{ $min }} @endif
|
||||||
{{ isset($max) ? 'max="' . $max . '"' : ''}}
|
@if ($max ?? false) max={{ $max }} @endif
|
||||||
{{ isset($step) ? 'step="' . $step . '"' : ''}}
|
@if ($step ?? false) step={{ $step }} @endif
|
||||||
{{ isset($placeholder) ? 'placeholder="' . $placeholder. '"' : ''}}
|
@if ($formid ?? false) form="{{ $formid }}" @endif
|
||||||
>
|
@if ($mask ?? false) data-inputmask="'mask': '{{ $mask }}'" @endif
|
||||||
|
@if ($pattern ?? false) pattern="{{ $pattern }}" @endif
|
||||||
|
@if ($placeholder ?? false) placeholder="{{ $placeholder }}" @endif
|
||||||
|
{!! $meta ?? '' !!} >
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
@include('components.form.label')
|
||||||
|
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
|
|
||||||
@include('components.form.input', ['type' => 'number', 'meta' => "step = '.01'"])
|
@include('components.form.input', ['type' => 'number', 'step' => '.01', 'label' => false])
|
||||||
|
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<button class="btn bg-light" type="button" aria-haspopup="false" aria-expanded="false">
|
<button class="btn bg-light" type="button" aria-haspopup="false" aria-expanded="false">
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
@include('components.form.input', ['mask' => '99.99.99.99.99'])
|
@include('components.form.input')
|
||||||
|
|||||||
8
resources/views/components/form/inputs/search.blade.php
Normal file
8
resources/views/components/form/inputs/search.blade.php
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-search"></i></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input type="text" name="{{ $name }}" class="form-control search-btn" placeholder="{{ __('search') }}" value="">
|
||||||
|
|
||||||
|
</div>
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
|
@include('components.form.label')
|
||||||
|
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
@include('components.form.input', ['class' => 'url'])
|
@include('components.form.input', ['class' => 'url', 'label' => false])
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
@if (isset($with_download) && $with_download)
|
@if (isset($with_download) && $with_download)
|
||||||
<div class="input-group-text btn btn-web" role="button"><i class="fa {{ (isset($status) && $status) ? 'fa-check green' : 'fa-download' }}"></i></div>
|
<div class="input-group-text btn btn-web" role="button"><i class="fa {{ (isset($status) && $status) ? 'fa-check green' : 'fa-download' }}"></i></div>
|
||||||
|
|||||||
@@ -1,16 +1,31 @@
|
|||||||
<select name="{{ $name }}"
|
@include('components.form.label')
|
||||||
@if (isset($id_name))id="{{ $id_name }}"@endif
|
|
||||||
class="form-control {{ $class ?? null }}"
|
@if (($disabled ?? false) || ($readonly ?? false))
|
||||||
@if (isset($style))style="{{ $style }}" @endif
|
@include('components.form.input', ['type' => 'hidden', 'label' => false])
|
||||||
@if (isset($meta)) {{ $meta }} @endif
|
@endif
|
||||||
@if (isset($required))required="required"@endif
|
<select name="{{ $name }}" class="form-control {{ $class ?? null }}"
|
||||||
@if (isset($disabled) && $disabled)disabled="disabled"@endif
|
@if ($id_name ?? false) id="{{ $id_name }}" @endif
|
||||||
@if (isset($multiple))multiple="multiple"@endif
|
@if ($style ?? false) style="{{ $style }}" @endif
|
||||||
|
@if ($required ?? false) required @endif
|
||||||
|
@if ($readonly ?? false) readonly @endif
|
||||||
|
@if ($disabled ?? false) disabled @endif
|
||||||
|
@if ($multiple ?? false) multiple @endif
|
||||||
|
@if ($size ?? false) size="{{ $size }}" @endif
|
||||||
|
@if ($dataId ?? false) data-id="{{ $dataId }}" @endif
|
||||||
|
{{ $meta ?? null}}
|
||||||
>
|
>
|
||||||
@if (isset($with_empty))
|
@isset($with_empty)
|
||||||
<option value=''>{{ $with_empty }}</option>
|
<option value="{{ $with_empty_value ?? '' }}">{{ $with_empty }}</option>
|
||||||
|
@endisset
|
||||||
|
|
||||||
|
@if ($tree ?? false)
|
||||||
|
@include('components.form.options.options-tree')
|
||||||
|
@else
|
||||||
|
@if ($multiple ?? false)
|
||||||
|
@include('components.form.options.options-multiple')
|
||||||
|
@else
|
||||||
|
@include('components.form.options')
|
||||||
|
@endif
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@include('components.form.options')
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
@@ -1 +1,16 @@
|
|||||||
@include('components.form.select', ['class' => 'duallist', 'multiple' => true])
|
@if ($disabled ?? false)
|
||||||
|
@if (count($list ?? []))
|
||||||
|
<ul>
|
||||||
|
@foreach($list as $key => $item)
|
||||||
|
@if (in_array($key, $values))
|
||||||
|
<li>{{ $item }}</li>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
@endif
|
||||||
|
@else
|
||||||
|
@include('components.form.select', [
|
||||||
|
'class' => 'duallist',
|
||||||
|
'multiple' => true,
|
||||||
|
])
|
||||||
|
@endif
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
@include('components.form.select', ['class' => 'duallist', 'tree' => true])
|
||||||
@@ -1,13 +1 @@
|
|||||||
<select
|
@include('components.form.select', ['tree' => true])
|
||||||
name="{{ $name }}"
|
|
||||||
@if (isset($id_name))id="{{ $id_name }}"@endif
|
|
||||||
class="@if (isset($class)){{ $class }} @else form-control @endif"
|
|
||||||
@if (isset($style))style="{{ $style }}" @endif
|
|
||||||
@if (isset($required))required="required"@endif
|
|
||||||
@if (isset($multiple))multiple="multiple"@endif
|
|
||||||
>
|
|
||||||
@if (isset($with_empty))
|
|
||||||
<option>{{ $with_empty }}</option>
|
|
||||||
@endif
|
|
||||||
@include('components.form.options.options-tree')
|
|
||||||
</select>
|
|
||||||
|
|||||||
@@ -1,6 +1,14 @@
|
|||||||
<textarea
|
@include('components.form.label')
|
||||||
name="{{ $name }}"
|
|
||||||
@if (isset($id_name))id="{{ $id_name }}"@endif
|
<textarea name="{{ $name }}"
|
||||||
|
@isset($id_name)id="{{ $id_name }}"@endisset
|
||||||
class="form-control {{ $class ?? null }}"
|
class="form-control {{ $class ?? null }}"
|
||||||
@if (isset($rows)) rows="{{ $rows }}"@endif
|
@isset($rows) rows="{{ $rows }}"@endisset
|
||||||
>{{ $value ?? null }}</textarea>
|
@if ($style ?? false) style="{{ $style }}" @endif
|
||||||
|
@if ($disabled ?? false) disabled @endif
|
||||||
|
@if ($required ?? false) required @endif
|
||||||
|
@if ($readonly ?? false) readonly @endif
|
||||||
|
@if ($autofocus ?? false) autofocus @endif
|
||||||
|
@if ($maxlength ?? false) maxlength="{{ $maxlength }}" @endif
|
||||||
|
{{ $meta ?? null}}
|
||||||
|
>{{ $value ?? ''}}</textarea>
|
||||||
|
|||||||
@@ -9,8 +9,6 @@
|
|||||||
<script>
|
<script>
|
||||||
$.fn.fileinput.defaults.language = '{{ App::getLocale() }}';
|
$.fn.fileinput.defaults.language = '{{ App::getLocale() }}';
|
||||||
</script>
|
</script>
|
||||||
@endif
|
|
||||||
@endpush
|
|
||||||
<script>
|
<script>
|
||||||
function initUpload(selector) {
|
function initUpload(selector) {
|
||||||
var selector = '.file';
|
var selector = '.file';
|
||||||
@@ -21,5 +19,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@endif
|
||||||
|
@endpush
|
||||||
@php(define('LOAD_FILEINPUT', true))
|
@php(define('LOAD_FILEINPUT', true))
|
||||||
@endif
|
@endif
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
@if(!defined('LOAD_CHEVRON'))
|
@if(!defined('LOAD_CHEVRON'))
|
||||||
@push('scripts')
|
@push('scripts')
|
||||||
|
@component('boilerplate::minify')
|
||||||
<script>
|
<script>
|
||||||
function initChevron(sel) {
|
function initChevron(sel) {
|
||||||
var selector = (typeof(sel) == 'undefined') ? '.card-header .btn-link' : sel;
|
var selector = (typeof(sel) == 'undefined') ? '.card-header .btn-link' : sel;
|
||||||
@@ -9,8 +9,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@endcomponent
|
||||||
@endpush
|
@endpush
|
||||||
|
|
||||||
@php(define('LOAD_CHEVRON', true))
|
@php(define('LOAD_CHEVRON', true))
|
||||||
@endif
|
@endif
|
||||||
@@ -1,38 +1,72 @@
|
|||||||
@if(!defined('LOAD_MODAL'))
|
@if(!defined('LOAD_MODAL'))
|
||||||
|
|
||||||
@push('js')
|
@push('js')
|
||||||
|
@component('boilerplate::minify')
|
||||||
<script>
|
<script>
|
||||||
function openModal(title, form_id, url_open, url_save, callback, size, no_confirm, buttons, callback_after_loaded) {
|
|
||||||
|
// bootbox.setLocale('{{ App::getLocale() }}');
|
||||||
|
|
||||||
|
function openModal(title, form_id, url_open, url_save, callback, size, no_confirm, options) {
|
||||||
var status = 0;
|
var status = 0;
|
||||||
|
|
||||||
|
if (typeof(options) != 'undefined') {
|
||||||
|
var className = (typeof(options['className']) == 'undefined') ? '' : options['className'];
|
||||||
|
var onHide = (typeof(options['onHide']) == 'undefined') ? false : options['onHide'];
|
||||||
|
var onHidden = (typeof(options['onHidden']) == 'undefined') ? false : options['onHidden'];
|
||||||
|
var onShow = (typeof(options['onShow']) == 'undefined') ? false : options['onShow'];
|
||||||
|
var onShown = (typeof(options['onShown']) == 'undefined') ? false : options['onShown'];
|
||||||
|
var onPostModal = (typeof(options['onPostModal']) == 'undefined') ? false : options['onPostModal'];
|
||||||
|
}
|
||||||
|
|
||||||
var dialog = bootbox.dialog({
|
var dialog = bootbox.dialog({
|
||||||
title: title,
|
title: title,
|
||||||
message: '<p><i class="fa fa-spin fa-spinner"></i> {{ __('loading') }} ...</p>',
|
message: '<p><i class="fa fa-spin fa-spinner"></i> {{ __('loading') }} ...</p>',
|
||||||
size: size ? size : 'large',
|
size: size ? size : 'large',
|
||||||
scrollable: true,
|
scrollable: true,
|
||||||
buttons: buildModalButtons(form_id, no_confirm, buttons)
|
className: className,
|
||||||
|
onHide: function(e) {
|
||||||
|
// console.log(status);
|
||||||
|
if (onHide) {
|
||||||
|
eval(onHide);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onHidden: function(e) {
|
||||||
|
// console.log(status);
|
||||||
|
if (onHidden) {
|
||||||
|
eval(onHidden);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShow: function(e) {
|
||||||
|
var modal = e.target.firstChild;
|
||||||
|
// console.log(modal);
|
||||||
|
// console.log($('.close'));
|
||||||
|
if (onShow) {
|
||||||
|
eval(onShow);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShown: function(e) {
|
||||||
|
var modal = e.target.firstChild;
|
||||||
|
// console.log(modal);
|
||||||
|
// console.log($('.close'));
|
||||||
|
if (onShown) {
|
||||||
|
eval(onShown);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
buttons: buildModalButtons(form_id, no_confirm, callback)
|
||||||
});
|
});
|
||||||
|
|
||||||
dialog.init(function() {
|
changeModalContent(dialog, url_open);
|
||||||
$.get(url_open, function(data) {
|
|
||||||
dialog.find('.bootbox-body').html(data);
|
if (! no_confirm) {
|
||||||
if (callback_after_loaded) {
|
handlePostModal(form_id, url_save, callback, onPostModal);
|
||||||
eval(callback_after_loaded);
|
|
||||||
}
|
}
|
||||||
if (typeof(url_save) !== 'undefined') {
|
return dialog;
|
||||||
handlePostModal(form_id,url_save, callback);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeModalContent(dialog, url, callback) {
|
function changeModalContent(dialog, url, callback) {
|
||||||
dialog.init(function() {
|
dialog.init(function() {
|
||||||
$.get(url, function(data) {
|
$.get(url, function(data) {
|
||||||
dialog.find('.bootbox-body').html(data);
|
dialog.find('.bootbox-body').html(data);
|
||||||
if (callback) {
|
|
||||||
eval(callback);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -49,56 +83,122 @@
|
|||||||
function viewWindow(url, size, title) {
|
function viewWindow(url, size, title) {
|
||||||
var width = (size == 'sm') ? 400 : 600;
|
var width = (size == 'sm') ? 400 : 600;
|
||||||
var title = title ? title : 'Web viewer';
|
var title = title ? title : 'Web viewer';
|
||||||
window.open(url,title,"menubar=no, status=no, scrollbars=no, menubar=no, width=" + width + ", height=400");
|
window.open(url, title, "menubar=no, status=no, scrollbars=no, menubar=no, width=" + width + ", height=400");
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildModalButtons(form_id, no_confirm, buttons) {
|
function buildModalButtons(form_id, no_confirm, callback) {
|
||||||
if (!no_confirm) {
|
return no_confirm ? '' : {
|
||||||
var buttons = {
|
|
||||||
cancel: {
|
cancel: {
|
||||||
label: '{{ __('Annuler') }}',
|
label: '<i class="fa fa-ban"></i> {{ __("Core.cancel") }}',
|
||||||
className: 'btn-secondary'
|
className: 'btn-secondary'
|
||||||
},
|
},
|
||||||
confirm: {
|
confirm: {
|
||||||
label: '{{ __('Sauver') }}',
|
label: '<i class="fa fa-save"></i> {{ __("Core.save") }}',
|
||||||
className: 'btn-success',
|
className: 'btn-success',
|
||||||
callback: function() {
|
callback: function() {
|
||||||
submitModal(form_id);
|
return submitModal(form_id, callback);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return buttons;
|
|
||||||
}
|
|
||||||
|
|
||||||
function submitModal(form_id) {
|
function submitModal(form_id, callback) {
|
||||||
if (typeof(tinyMCE) != 'undefined') {
|
if (typeof(tinyMCE) != 'undefined') {
|
||||||
tinyMCE.triggerSave();
|
tinyMCE.triggerSave();
|
||||||
}
|
}
|
||||||
$('form ' + form_id).submit();
|
var $form = $(form_id);
|
||||||
status = 1;
|
console.log('submitModal ' + form_id);
|
||||||
|
if ($form.valid()) {
|
||||||
|
deactivateButton($form);
|
||||||
|
console.log('check valid');
|
||||||
|
$form.submit();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function handlePostModal(form_id, url_save, callback) {
|
function handlePostModal(form_id, url_save, callback, onPostModal) {
|
||||||
$('form ' + form_id).submit(function(e) {
|
// console.log('handlePostModal');
|
||||||
|
// initValidator();
|
||||||
|
var response = false;
|
||||||
|
$(form_id).submit(function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var formData = new FormData(this);
|
console.log('handlepostmodal submit');
|
||||||
|
|
||||||
|
if (onPostModal) {
|
||||||
|
response = eval(onPostModal);
|
||||||
|
} else {
|
||||||
|
response = postModal(form_id, url_save, callback);
|
||||||
|
}
|
||||||
|
// console.log(response);
|
||||||
|
});
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
function postModal(form_id, url_save, callback) {
|
||||||
|
console.log('postModal');
|
||||||
|
console.log(form_id);
|
||||||
|
console.log(callback);
|
||||||
|
var ret = false;
|
||||||
|
var $form = $(form_id);
|
||||||
|
var myForm = document.getElementById(form_id.substring(1));
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: url_save,
|
url: url_save,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
data: formData,
|
data: new FormData(myForm),
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (callback) {
|
if (callback) {
|
||||||
eval(callback);
|
eval(callback);
|
||||||
}
|
}
|
||||||
|
if (!data.error) {
|
||||||
|
bootbox.hideAll();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
crossDomain: true,
|
||||||
|
headers: {
|
||||||
|
"accept": "application/json",
|
||||||
|
"Access-Control-Allow-Origin":"*"
|
||||||
},
|
},
|
||||||
cache: false,
|
cache: false,
|
||||||
contentType: false,
|
contentType: false,
|
||||||
processData: false
|
processData: false
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openWindow(url, target) {
|
||||||
|
target = (typeof(target) == 'undefined') ? '_blank' : target;
|
||||||
|
if (target == '_blank') {
|
||||||
|
var anchor = document.createElement('a');
|
||||||
|
anchor.href = url;
|
||||||
|
anchor.target = "_blank";
|
||||||
|
anchor.click();
|
||||||
|
} else {
|
||||||
|
window.location = url;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function reactivateButton($form) {
|
||||||
|
console.log('activateButton');
|
||||||
|
var $button = $form.closest('.modal-content').find('.bootbox-accept').first();
|
||||||
|
if ($button.attr("disabled")) {
|
||||||
|
$button.prop("disabled", false);
|
||||||
|
$button.html("<i class='fa fa-save'></i> {{ __('Core.save') }}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function deactivateButton($form) {
|
||||||
|
console.log('deactivateButton');
|
||||||
|
console.log($form);
|
||||||
|
var $button = $form.closest('.modal-content').find('.bootbox-accept').first();
|
||||||
|
console.log($button);
|
||||||
|
$button.prop("disabled", true);
|
||||||
|
$button.html("<i class='fa fa-spinner fa-spin'></i> {{ __('Core.processing') }}");
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@endcomponent
|
||||||
@endpush
|
@endpush
|
||||||
|
|
||||||
@php(define('LOAD_MODAL', true))
|
@php(define('LOAD_MODAL', true))
|
||||||
|
|||||||
Reference in New Issue
Block a user