enhance components, add mailtemplate, add traits for translations, for stats
This commit is contained in:
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', [
|
||||
'title' => __('Core.mail_templates.title'),
|
||||
'subtitle' => __('Core.mail_templates.list'),
|
||||
'breadcrumb' => [
|
||||
]
|
||||
'breadcrumb' => []
|
||||
])
|
||||
|
||||
@section('content')
|
||||
|
||||
<x-card>
|
||||
@include('components.datatable', [
|
||||
'route' => route('Admin.Core.Mail.MailTemplate.index'),
|
||||
@@ -23,13 +21,14 @@
|
||||
@component('components.layout.modal-filters', ['title' => 'Filters', 'id' => 'modal-mail_templates-filters'])
|
||||
@include('admin.Core.Mail.MailTemplate.partials.filters', ['model' => 'mail_templates'])
|
||||
@endcomponent
|
||||
|
||||
@endsection
|
||||
|
||||
@include('load.form.datepicker')
|
||||
@include('load.form.select2')
|
||||
@include('load.form.editor')
|
||||
@include('load.form.toggle')
|
||||
@include('load.form.upload.fileinput')
|
||||
@include('load.layout.modal')
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
|
||||
@@ -21,16 +21,11 @@
|
||||
'required' => true,
|
||||
])
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="col-6">
|
||||
<div id="mail_template-vars">
|
||||
@include('admin.Core.Mail.MailTemplate.partials.vars', ['vars' => $mail_template['vars'] ?? []])
|
||||
</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 id="mode_fr" class="">
|
||||
@@ -67,42 +62,6 @@
|
||||
</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() }}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="row mb-3">
|
||||
<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">
|
||||
<img src="/img/article_natures/semences.png" class="img-fluid">
|
||||
</div>
|
||||
@@ -8,7 +8,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<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">
|
||||
<img src="/img/article_natures/plants.png" class="img-fluid" class="img-fluid">
|
||||
</div>
|
||||
@@ -16,7 +16,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<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">
|
||||
<img src="/img/article_natures/legumes.png" class="img-fluid" class="img-fluid">
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,19 @@
|
||||
@include('load.form.datepicker')
|
||||
@if (($readonly ?? false) || ($disabled ?? false))
|
||||
@include('components.form.input')
|
||||
@else
|
||||
@include('components.form.label')
|
||||
<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>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="input-group date" data-target-input="nearest">
|
||||
@include('components.form.input', ['class' => 'datepicker', 'meta' => 'data-target="#'.str_slug($name).'"', 'placeholder' => App\Repositories\Core\DateTime::getLocaleFormatDate() ])
|
||||
<div class="input-group-append" data-target="#{{ str_slug($name) }}" data-toggle="datetimepicker">
|
||||
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
@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
|
||||
name="{{ $name }}"
|
||||
@if (isset($id_name))id="{{ $id_name }}"@endif
|
||||
class="editor form-control @if (isset($class)){{ $class }}@endif"
|
||||
@if (isset($rows)) rows="{{ $rows }}"@endif
|
||||
>@if (isset($value)){{ $value }}@endif</textarea>
|
||||
@include('components.form.textarea', [
|
||||
'rows' => $rows ?? 3,
|
||||
'class' => 'editor ' . ($class ?? ''),
|
||||
])
|
||||
|
||||
|
||||
@if(!defined('LOAD_EDITOR'))
|
||||
@if(!defined('LOAD_EDITOR'))
|
||||
@include('load.form.editor')
|
||||
@push('js')
|
||||
<script>
|
||||
$(function() {
|
||||
initEditor();
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@endif
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
@include('components.form.label')
|
||||
|
||||
<div class="input-group">
|
||||
|
||||
@include('components.form.input')
|
||||
|
||||
@include('components.form.input', ['label' => false])
|
||||
<div class="input-group-append">
|
||||
<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>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
@if (is_array($translations))
|
||||
@if (is_array($translations ?? false))
|
||||
@foreach ($translations as $lang => $translation)
|
||||
<a class="dropdown-item" href="#">{{ $lang }} : {{ $translation }}</a>
|
||||
@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">
|
||||
@include('components.form.input')
|
||||
@include('components.form.input', ['label' => false])
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text btn btn-{{ $class ?? '' }}" role="button"><i class="fa fa-{{ $icon ?? '' }}"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (isset($click))
|
||||
@isset($click)
|
||||
@push('js')
|
||||
<script>
|
||||
$('.btn-{{ $class ?? '' }}').off().click(function() {
|
||||
var value = $(this).closest('.input-group').find('input').val();
|
||||
console.log(value);
|
||||
});
|
||||
</script>
|
||||
@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 ?? ''}}"
|
||||
@if (isset($data_id))
|
||||
data-id="{{ $data_id }}"
|
||||
@endif
|
||||
@if (isset($required))
|
||||
required="required"
|
||||
@endif
|
||||
{{ isset($min) ? 'min="' . $min . '"' : ''}}
|
||||
{{ isset($max) ? 'max="' . $max . '"' : ''}}
|
||||
{{ isset($step) ? 'step="' . $step . '"' : ''}}
|
||||
{{ isset($placeholder) ? 'placeholder="' . $placeholder. '"' : ''}}
|
||||
>
|
||||
@if ($required ?? false) required @endif
|
||||
@if ($disabled ?? false) disabled @endif
|
||||
@if ($readonly ?? false) readonly @endif
|
||||
@if ($autofocus ?? false) autofocus @endif
|
||||
@if ($size ?? false) size="{{ $size }}" @endif
|
||||
@if ($autocomplete ?? false) autocomplete="{{ $autocomplete }}" @endif
|
||||
@if ($min ?? false) min={{ $min }} @endif
|
||||
@if ($max ?? false) max={{ $max }} @endif
|
||||
@if ($step ?? false) step={{ $step }} @endif
|
||||
@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,7 +1,9 @@
|
||||
@include('components.form.label')
|
||||
|
||||
<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">
|
||||
<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">
|
||||
@include('components.form.input', ['class' => 'url'])
|
||||
@include('components.form.input', ['class' => 'url', 'label' => false])
|
||||
<div class="input-group-append">
|
||||
@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>
|
||||
|
||||
@@ -1,16 +1,31 @@
|
||||
<select name="{{ $name }}"
|
||||
@if (isset($id_name))id="{{ $id_name }}"@endif
|
||||
class="form-control {{ $class ?? null }}"
|
||||
@if (isset($style))style="{{ $style }}" @endif
|
||||
@if (isset($meta)) {{ $meta }} @endif
|
||||
@if (isset($required))required="required"@endif
|
||||
@if (isset($disabled) && $disabled)disabled="disabled"@endif
|
||||
@if (isset($multiple))multiple="multiple"@endif
|
||||
@include('components.form.label')
|
||||
|
||||
@if (($disabled ?? false) || ($readonly ?? false))
|
||||
@include('components.form.input', ['type' => 'hidden', 'label' => false])
|
||||
@endif
|
||||
<select name="{{ $name }}" class="form-control {{ $class ?? null }}"
|
||||
@if ($id_name ?? false) id="{{ $id_name }}" @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))
|
||||
<option value=''>{{ $with_empty }}</option>
|
||||
@isset($with_empty)
|
||||
<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
|
||||
|
||||
@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
|
||||
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>
|
||||
@include('components.form.select', ['tree' => true])
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
<textarea
|
||||
name="{{ $name }}"
|
||||
@if (isset($id_name))id="{{ $id_name }}"@endif
|
||||
@include('components.form.label')
|
||||
|
||||
<textarea name="{{ $name }}"
|
||||
@isset($id_name)id="{{ $id_name }}"@endisset
|
||||
class="form-control {{ $class ?? null }}"
|
||||
@if (isset($rows)) rows="{{ $rows }}"@endif
|
||||
>{{ $value ?? null }}</textarea>
|
||||
@isset($rows) rows="{{ $rows }}"@endisset
|
||||
@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,17 +9,17 @@
|
||||
<script>
|
||||
$.fn.fileinput.defaults.language = '{{ App::getLocale() }}';
|
||||
</script>
|
||||
<script>
|
||||
function initUpload(selector) {
|
||||
var selector = '.file';
|
||||
$(selector).fileinput({
|
||||
showCaption: false,
|
||||
dropZoneEnabled: false,
|
||||
showUpload: false,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endif
|
||||
@endpush
|
||||
<script>
|
||||
function initUpload(selector) {
|
||||
var selector = '.file';
|
||||
$(selector).fileinput({
|
||||
showCaption: false,
|
||||
dropZoneEnabled: false,
|
||||
showUpload: false,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
@php(define('LOAD_FILEINPUT', true))
|
||||
@endif
|
||||
@@ -1,16 +1,15 @@
|
||||
@if(!defined('LOAD_CHEVRON'))
|
||||
@push('scripts')
|
||||
|
||||
<script>
|
||||
function initChevron(sel) {
|
||||
var selector = (typeof(sel) == 'undefined') ? '.card-header .btn-link' : sel;
|
||||
$(selector).click(function() {
|
||||
$(this).find('i').toggleClass('fa-chevron-right fa-chevron-down')
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
@component('boilerplate::minify')
|
||||
<script>
|
||||
function initChevron(sel) {
|
||||
var selector = (typeof(sel) == 'undefined') ? '.card-header .btn-link' : sel;
|
||||
$(selector).click(function() {
|
||||
$(this).find('i').toggleClass('fa-chevron-right fa-chevron-down')
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endcomponent
|
||||
@endpush
|
||||
|
||||
@php(define('LOAD_CHEVRON', true))
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@@ -1,105 +1,205 @@
|
||||
@if(!defined('LOAD_MODAL'))
|
||||
|
||||
@push('js')
|
||||
@component('boilerplate::minify')
|
||||
<script>
|
||||
|
||||
<script>
|
||||
function openModal(title, form_id, url_open, url_save, callback, size, no_confirm, buttons, callback_after_loaded) {
|
||||
var status = 0;
|
||||
var dialog = bootbox.dialog({
|
||||
title: title,
|
||||
message: '<p><i class="fa fa-spin fa-spinner"></i> {{ __('loading') }} ...</p>',
|
||||
size: size ? size : 'large',
|
||||
scrollable: true,
|
||||
buttons: buildModalButtons(form_id, no_confirm, buttons)
|
||||
});
|
||||
|
||||
dialog.init(function() {
|
||||
$.get(url_open, function(data) {
|
||||
dialog.find('.bootbox-body').html(data);
|
||||
if (callback_after_loaded) {
|
||||
eval(callback_after_loaded);
|
||||
}
|
||||
if (typeof(url_save) !== 'undefined') {
|
||||
handlePostModal(form_id,url_save, callback);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
// bootbox.setLocale('{{ App::getLocale() }}');
|
||||
|
||||
function changeModalContent(dialog, url, callback) {
|
||||
dialog.init(function() {
|
||||
$.get(url, function(data) {
|
||||
dialog.find('.bootbox-body').html(data);
|
||||
if (callback) {
|
||||
eval(callback);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
function openModal(title, form_id, url_open, url_save, callback, size, no_confirm, options) {
|
||||
var status = 0;
|
||||
|
||||
function viewModal(url, size, title) {
|
||||
var dialog = bootbox.dialog({
|
||||
title: title ? title : 'Web viewer',
|
||||
message: '<iframe style="border:0;" src="' + url + '" height="400" width="100%"></iframe>',
|
||||
size: size ? size : 'xl',
|
||||
scrollable: true,
|
||||
});
|
||||
}
|
||||
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'];
|
||||
}
|
||||
|
||||
function viewWindow(url, size, title) {
|
||||
var width = (size == 'sm') ? 400 : 600;
|
||||
var title = title ? title : 'Web viewer';
|
||||
window.open(url,title,"menubar=no, status=no, scrollbars=no, menubar=no, width=" + width + ", height=400");
|
||||
}
|
||||
var dialog = bootbox.dialog({
|
||||
title: title,
|
||||
message: '<p><i class="fa fa-spin fa-spinner"></i> {{ __('loading') }} ...</p>',
|
||||
size: size ? size : 'large',
|
||||
scrollable: true,
|
||||
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)
|
||||
});
|
||||
|
||||
function buildModalButtons(form_id, no_confirm, buttons) {
|
||||
if (!no_confirm) {
|
||||
var buttons = {
|
||||
cancel: {
|
||||
label: '{{ __('Annuler') }}',
|
||||
className: 'btn-secondary'
|
||||
},
|
||||
confirm: {
|
||||
label: '{{ __('Sauver') }}',
|
||||
className: 'btn-success',
|
||||
callback: function() {
|
||||
submitModal(form_id);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
return buttons;
|
||||
}
|
||||
changeModalContent(dialog, url_open);
|
||||
|
||||
function submitModal(form_id) {
|
||||
if (typeof(tinyMCE) != 'undefined') {
|
||||
tinyMCE.triggerSave();
|
||||
}
|
||||
$('form ' + form_id).submit();
|
||||
status = 1;
|
||||
}
|
||||
if (! no_confirm) {
|
||||
handlePostModal(form_id, url_save, callback, onPostModal);
|
||||
}
|
||||
return dialog;
|
||||
}
|
||||
|
||||
function handlePostModal(form_id, url_save, callback) {
|
||||
$('form ' + form_id).submit(function(e) {
|
||||
e.preventDefault();
|
||||
var formData = new FormData(this);
|
||||
$.ajax({
|
||||
url: url_save,
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
success: function (data) {
|
||||
if (callback) {
|
||||
eval(callback);
|
||||
}
|
||||
},
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
function changeModalContent(dialog, url, callback) {
|
||||
dialog.init(function() {
|
||||
$.get(url, function(data) {
|
||||
dialog.find('.bootbox-body').html(data);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function viewModal(url, size, title) {
|
||||
var dialog = bootbox.dialog({
|
||||
title: title ? title : 'Web viewer',
|
||||
message: '<iframe style="border:0;" src="' + url + '" height="400" width="100%"></iframe>',
|
||||
size: size ? size : 'xl',
|
||||
scrollable: true,
|
||||
});
|
||||
}
|
||||
|
||||
function viewWindow(url, size, title) {
|
||||
var width = (size == 'sm') ? 400 : 600;
|
||||
var title = title ? title : 'Web viewer';
|
||||
window.open(url, title, "menubar=no, status=no, scrollbars=no, menubar=no, width=" + width + ", height=400");
|
||||
}
|
||||
|
||||
function buildModalButtons(form_id, no_confirm, callback) {
|
||||
return no_confirm ? '' : {
|
||||
cancel: {
|
||||
label: '<i class="fa fa-ban"></i> {{ __("Core.cancel") }}',
|
||||
className: 'btn-secondary'
|
||||
},
|
||||
confirm: {
|
||||
label: '<i class="fa fa-save"></i> {{ __("Core.save") }}',
|
||||
className: 'btn-success',
|
||||
callback: function() {
|
||||
return submitModal(form_id, callback);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
function submitModal(form_id, callback) {
|
||||
if (typeof(tinyMCE) != 'undefined') {
|
||||
tinyMCE.triggerSave();
|
||||
}
|
||||
var $form = $(form_id);
|
||||
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, onPostModal) {
|
||||
// console.log('handlePostModal');
|
||||
// initValidator();
|
||||
var response = false;
|
||||
$(form_id).submit(function(e) {
|
||||
e.preventDefault();
|
||||
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({
|
||||
url: url_save,
|
||||
type: 'POST',
|
||||
data: new FormData(myForm),
|
||||
success: function (data) {
|
||||
if (callback) {
|
||||
eval(callback);
|
||||
}
|
||||
if (!data.error) {
|
||||
bootbox.hideAll();
|
||||
}
|
||||
},
|
||||
crossDomain: true,
|
||||
headers: {
|
||||
"accept": "application/json",
|
||||
"Access-Control-Allow-Origin":"*"
|
||||
},
|
||||
cache: false,
|
||||
contentType: 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>
|
||||
@endcomponent
|
||||
@endpush
|
||||
|
||||
@php(define('LOAD_MODAL', true))
|
||||
@endif
|
||||
@endif
|
||||
|
||||
Reference in New Issue
Block a user