add datatbles for invoices, add pdf icon, refactor icons components, add autocomplete on search, adapt searching to meilisearch
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
@include('Shop.Orders.partials.list', ['dataTable' => $orders])
|
||||
|
||||
@if ($customer['orders'] ?? false)
|
||||
<table class="table table-striped gradient-green1 green-fluo">
|
||||
@foreach ($customer['orders'] as $order)
|
||||
<tr>
|
||||
<td>
|
||||
{{ Carbon\Carbon::parse($order['created_at'])->format('d-m-Y') }}
|
||||
</td>
|
||||
<td>
|
||||
Numero facture
|
||||
</td>
|
||||
<td class="text-right">
|
||||
{{ $order['total_shipped'] }} €
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<button class="btn btn-sm btn-secondary" data-id="{{ $order['id'] }}">
|
||||
<i class="fa fa-fw fa-print" title="Imprimer"></i>
|
||||
</button>
|
||||
|
||||
<button class="btn btn-sm btn-secondary" data-id="{{ $order['id'] }}">
|
||||
<i class="fa fa-fw fa-file-pdf" title="Télécharger"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@endif
|
||||
@@ -1,25 +1,35 @@
|
||||
<nav>
|
||||
<div class="nav nav-tabs pl-2">
|
||||
<a href="#deliveries" data-toggle="tab" class="nav-item nav-link active" role="tab" aria-controls="deliveries"
|
||||
aria-selected="true">
|
||||
<a href="#deliveriesTab" data-toggle="tab" class="nav-item nav-link active" role="tab" aria-selected="true">
|
||||
MON MODE D'ACHAT
|
||||
</a>
|
||||
<a href="#invoices" data-toggle="tab" class="nav-item nav-link" role="tab" aria-controls="invoices"
|
||||
aria-selected="false">
|
||||
FACTURES ET SUIVI DE COMMANDES
|
||||
<a href="#ordersTab" data-toggle="tab" class="nav-item nav-link" role="tab" aria-selected="false">
|
||||
SUIVI DE COMMANDES
|
||||
</a>
|
||||
<a href="#invoicesTab" data-toggle="tab" class="nav-item nav-link" role="tab" aria-selected="false">
|
||||
FACTURES
|
||||
</a>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade show active pt-0 pb-0" id="deliveries">
|
||||
<div class="tab-pane fade show active pt-0 pb-0" id="deliveriesTab">
|
||||
<x-card classBody="bg-light">
|
||||
@include('Shop.Customers.partials.deliveries')
|
||||
</x-card>
|
||||
</div>
|
||||
<div class="tab-pane fade show pt-0 pb-0" id="invoices">
|
||||
<div class="tab-pane fade show pt-0 pb-0" id="ordersTab">
|
||||
<x-card classBody="bg-light">
|
||||
@include('Shop.Customers.partials.invoices')
|
||||
@include('Shop.Orders.partials.list', [
|
||||
'dataTable' => $orders,
|
||||
])
|
||||
</x-card>
|
||||
</div>
|
||||
<div class="tab-pane fade show pt-0 pb-0" id="invoicesTab">
|
||||
<x-card classBody="bg-light">
|
||||
@include('Shop.Invoices.partials.list', [
|
||||
'dataTable' => $invoices,
|
||||
])
|
||||
</x-card>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
2
resources/views/Shop/Invoices/partials/filters.blade.php
Normal file
2
resources/views/Shop/Invoices/partials/filters.blade.php
Normal file
@@ -0,0 +1,2 @@
|
||||
<form id="{{ $model }}-filters">
|
||||
</form>
|
||||
26
resources/views/Shop/Invoices/partials/list.blade.php
Normal file
26
resources/views/Shop/Invoices/partials/list.blade.php
Normal file
@@ -0,0 +1,26 @@
|
||||
@include('components.datatable', [
|
||||
'route' => route('Shop.Invoices.index'),
|
||||
'model' => 'invoices',
|
||||
'with_add' => false,
|
||||
'with_filters' => true,
|
||||
'with_exports' => false,
|
||||
'with_print' => false,
|
||||
'show_callback' => 'InvoiceView(id);',
|
||||
])
|
||||
|
||||
@component('components.layout.modal-filters', ['title' => 'Filters', 'id' => 'modal-invoices-filters'])
|
||||
@include('Shop.Invoices.partials.filters', ['model' => 'invoices'])
|
||||
@endcomponent
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
function InvoiceView(id) {
|
||||
var url_open = "{{ route('Shop.Invoices.view') }}/" + id;
|
||||
openModal("Voir une facture", '#invoice-form', url_open, false, false, 'xl', {{ !($with_add ?? false) }});
|
||||
}
|
||||
|
||||
function InvoiceRefresh() {
|
||||
reloadDatatable("invoices");
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
60
resources/views/Shop/Invoices/view.blade.php
Normal file
60
resources/views/Shop/Invoices/view.blade.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<div class="row mb-3">
|
||||
<div class="col-6">
|
||||
<h3>
|
||||
@if ($invoice['customer']['company'])
|
||||
{{ $invoice['customer']['company'] }}<br />
|
||||
@endif
|
||||
{{ $invoice['customer']['last_name'] }} {{ $invoice['customer']['first_name'] }}
|
||||
</h3>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<x-card title="Adresse de facturation">
|
||||
@if ($invoice['address'])
|
||||
{{ $invoice['address']['address'] }}<br />
|
||||
@isset($invoice['address']['address2'])
|
||||
{{ $invoice['address']['address2'] }}<br />
|
||||
@endisset
|
||||
{{ $invoice['address']['zipcode'] }}
|
||||
{{ $invoice['address']['city'] }}<br />
|
||||
@endif
|
||||
</x-card>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<x-card title="Adresse de livraison">
|
||||
@if ($invoice['order']['delivery_address'])
|
||||
{{ $invoice['order']['delivery_address']['address'] }}<br />
|
||||
@isset($invoice['order']['delivery_address']['address2'])
|
||||
{{ $invoice['order']['delivery_address']['address2'] }}<br />
|
||||
@endisset
|
||||
{{ $invoice['order']['delivery_address']['zipcode'] }}
|
||||
{{ $invoice['order']['delivery_address']['city'] }}<br />
|
||||
@endif
|
||||
</x-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="row mb-3">
|
||||
<div class="col-6" style="font-size: 1.2em; font-weight: 500;">
|
||||
Facture N° {{ $invoice['ref'] }}<br />
|
||||
du {{ Carbon\Carbon::parse($invoice['created_at'])->isoFormat('LLLL') }}
|
||||
</div>
|
||||
<div class="col-6">
|
||||
Statut : {{ $invoice['status'] }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-6">
|
||||
Canal de vente : {{ $invoice['order']['sale_channel']['name'] }}
|
||||
</div>
|
||||
<div class="col-6">
|
||||
Règlement : {{ $invoice['payment_type'] }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('Admin.Shop.Orders.partials.detail', [
|
||||
'detail_type' => 'facture',
|
||||
'order' => $invoice['order'],
|
||||
])
|
||||
@@ -1,29 +1,26 @@
|
||||
@include('components.datatable', [
|
||||
'route' => route('Shop.Orders.index'),
|
||||
'model' => 'orders',
|
||||
'route' => route('Shop.Orders.index'),
|
||||
'model' => 'orders',
|
||||
'with_add' => false,
|
||||
'with_filters' => true,
|
||||
'with_exports' => false,
|
||||
'with_print' => false,
|
||||
'with_exports' => false,
|
||||
'with_print' => false,
|
||||
'show_callback' => 'OrderView(id);',
|
||||
])
|
||||
|
||||
@component('components.layout.modal-filters', ['title' => 'Filters', 'id' => 'modal-aml_risks-filters'])
|
||||
@include('Shop.Orders.partials.filters', ['model' => 'aml_risks'])
|
||||
@component('components.layout.modal-filters', ['title' => 'Filters', 'id' => 'modal-orders-filters'])
|
||||
@include('Shop.Orders.partials.filters', ['model' => 'orders'])
|
||||
@endcomponent
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
<script>
|
||||
function OrderView(id) {
|
||||
var url_open = "{{ route('Shop.Orders.view') }}/" + id;
|
||||
openModal("Voir une commande", '#order-form', url_open, false, false, 'xl', {{ !($with_add ?? false) }});
|
||||
}
|
||||
|
||||
function OrderView(id) {
|
||||
var url_open = "{{ route('Shop.Orders.view') }}/" + id;
|
||||
openModal("Voir une commande", '#model-form', url_open, false, false, 'xl', {{ !($with_add ?? false) }});
|
||||
}
|
||||
|
||||
function OrderRefresh()
|
||||
{
|
||||
reloadDatatable("orders");
|
||||
}
|
||||
|
||||
</script>
|
||||
function OrderRefresh() {
|
||||
reloadDatatable("orders");
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@@ -9,49 +9,53 @@
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
|
||||
<title>Jardin'enVie</title>
|
||||
<meta name="description" content="Vente de semences, variété anciennes">
|
||||
<meta name="keywords" content="">
|
||||
<title>Jardin'enVie</title>
|
||||
<meta name="description" content="Vente de semences, variété anciennes">
|
||||
<meta name="keywords" content="">
|
||||
|
||||
<link rel="icon" type="image/vnd.microsoft.icon" href="img/favicon.ico">
|
||||
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
|
||||
<link rel="stylesheet" href="/css/site.min.css?{{ date('Ymd') }}" type="text/css" media="all">
|
||||
<link rel="icon" type="image/vnd.microsoft.icon" href="img/favicon.ico">
|
||||
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
|
||||
<link rel="stylesheet" href="/css/site.min.css?{{ date('Ymd') }}" type="text/css" media="all">
|
||||
|
||||
@stack('css')
|
||||
@stack('css')
|
||||
|
||||
</head>
|
||||
|
||||
<body class="bg-green-dark">
|
||||
|
||||
<div class="container bg-light" style="min-height: 100vh;">
|
||||
<main>
|
||||
@include("Shop.layout.partials.header")
|
||||
<div class="content-wrapper">
|
||||
<section>
|
||||
<div class="container-fluid p-0">
|
||||
@yield('content')
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@include("Shop.layout.partials.footer")
|
||||
<div class="container bg-light" style="min-height: 100vh;">
|
||||
<main>
|
||||
@include('Shop.layout.partials.header')
|
||||
<div class="content-wrapper">
|
||||
<section>
|
||||
<div class="container-fluid p-0">
|
||||
@yield('content')
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@include('Shop.layout.partials.footer')
|
||||
@include('cookie-consent::index')
|
||||
</main>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="/js/site.min.js"></script>
|
||||
|
||||
<script type="text/javascript" src="/js/site.min.js" ></script>
|
||||
|
||||
@stack('scripts')
|
||||
|
||||
|
||||
<script>
|
||||
$.ajaxSetup({headers: {'X-CSRF-TOKEN': '{{ csrf_token() }}'}});
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@if(Session::has('growl'))
|
||||
@if (Session::has('growl'))
|
||||
<script>
|
||||
$(function() {
|
||||
@if(is_array(Session::get('growl')))
|
||||
@if (is_array(Session::get('growl')))
|
||||
growl("{!! Session::get('growl')[0] !!}", "{{ Session::get('growl')[1] }}");
|
||||
@else
|
||||
growl("{{Session::get('growl')}}");
|
||||
growl("{{ Session::get('growl') }}");
|
||||
@endif
|
||||
});
|
||||
</script>
|
||||
@@ -70,4 +74,4 @@
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
<span class="green ml-3">Variétés Paysannes de la Semence à l'Assiette</span>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-lg-3 pt-2">
|
||||
<div class="col-sm-12 col-lg-4 pt-2">
|
||||
@include('Shop.layout.partials.search')
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-lg-4 pt-2 text-right">
|
||||
<div class="col-sm-12 col-lg-3 pt-2 text-right">
|
||||
@include('Shop.layout.partials.header-catalog')
|
||||
@include('Shop.layout.partials.header-profile')
|
||||
@include('Shop.layout.partials.header-basket')
|
||||
|
||||
@@ -1,18 +1,26 @@
|
||||
<form method="method" action="{{ route('Shop.Searches.search') }}" id="search-general">
|
||||
<div class="input-group">
|
||||
<input type="text" name="search" value="{{ $search['search'] ?? null }}" class="form-control search-btn" aria-label="Chercher">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text"><i class="btn btn-sm fa fa-search"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
@include('components.form.autocomplete', [
|
||||
'name' => 'search',
|
||||
'url' => route('Admin.Shop.Articles.autocomplete'),
|
||||
'data' => [
|
||||
'name' => $search['search_name'] ?? '',
|
||||
],
|
||||
])
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text"><i class="btn btn-sm fa fa-search"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$(function() {
|
||||
$('#search-general .fa-search').click(function() {
|
||||
$('#search-general').submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
<script>
|
||||
$(function() {
|
||||
$('#search-general .fa-search').click(function() {
|
||||
$('#search-general').submit();
|
||||
});
|
||||
|
||||
initAutocomplete('#search_name');
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
@include('load.form.autocomplete')
|
||||
|
||||
<input type="hidden" name="{{ $name }}_id" id="{{ $name }}_id" value="{{ $data[$name . '_id'] ?? null }}">
|
||||
<input type="text" name="{{ $name }}_name" class="form-control autocomplete" value="{{ $data['name'] ?? ''}}" data-url="{{ $url ?? ''}}" data-field="{{ $name }}_id" autocomplete="off">
|
||||
<input type="text" name="{{ $name }}_name" id="{{ $name }}_name" class="form-control autocomplete"
|
||||
value="{{ $data['name'] ?? '' }}" data-url="{{ $url ?? '' }}" data-field="{{ $name }}_id"
|
||||
autocomplete="off">
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
<button type="{{ $type ?? 'button' }}" class="btn {{ $class ?? ''}}"
|
||||
@if ($url ?? false)
|
||||
<a href="{{ $url }}">
|
||||
@endif
|
||||
<button type="{{ $type ?? 'button' }}" class="btn {{ $class ?? '' }}"
|
||||
@isset($style) style="{{ $style }}" @endisset
|
||||
@isset($id) id="{{ $id }}" @endisset
|
||||
@isset($data_id) data-id="{{ $data_id }}" @endisset
|
||||
@isset($data_id) data-id="{{ $data_id }}" @endisset
|
||||
@isset($dataId) data-id="{{ $dataId }}" @endisset
|
||||
@isset($title) title="{{ $title }}" data-toggle="tooltip" @endisset
|
||||
@isset($loading_text) data-loading-text="{{ $loading_text }}" @endisset
|
||||
@isset($title) title="{{ $title }}" data-toggle="tooltip" @endisset
|
||||
@isset($loading_text) data-loading-text="{{ $loading_text }}" @endisset
|
||||
@isset($loadingText) data-loading-text="{{ $loadingText }}" @endisset
|
||||
@isset($tooltip) data-toggle="tooltip" data-tooltip="{{ $tooltip }}" @endisset
|
||||
@isset($popover) data-toggle="popover" data-content="{{ $popover }}" @endisset
|
||||
@@ -12,8 +15,10 @@
|
||||
@isset($trigger) data-trigger="{{ $trigger }}" @endisset
|
||||
@isset($container) data-container="{{ $container }}" @endisset
|
||||
@isset($html) data-html="true" @endisset
|
||||
@isset($metadata) {{ $metadata }} @endisset
|
||||
>
|
||||
<i class="fa fa-fw {{ $icon ?? '' }}"></i>
|
||||
{{ $txt ?? '' }}
|
||||
@isset($metadata) {{ $metadata }} @endisset>
|
||||
<i class="fa fa-fw {{ $icon ?? '' }}"></i>
|
||||
{{ $txt ?? '' }}
|
||||
</button>
|
||||
@if ($url ?? false)
|
||||
</a>
|
||||
@endif
|
||||
|
||||
5
resources/views/components/form/buttons/add.blade.php
Normal file
5
resources/views/components/form/buttons/add.blade.php
Normal file
@@ -0,0 +1,5 @@
|
||||
@include('components.form.button', [
|
||||
'class' => 'btn-primary ' . ($class ?? ''),
|
||||
'icon' => 'fa-plus',
|
||||
'title' => $title ?? 'Ajouter',
|
||||
])
|
||||
17
resources/views/components/form/buttons/cancel.blade.php
Normal file
17
resources/views/components/form/buttons/cancel.blade.php
Normal file
@@ -0,0 +1,17 @@
|
||||
@include('components.form.button', [
|
||||
'class' => 'btn-secondary cancel ' . ($class ?? ''),
|
||||
'icon' => 'fa-times',
|
||||
'txt' => $title ?? 'Annuler',
|
||||
])
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$('.form-buttons .cancel').click(function() {
|
||||
@if (isset($url))
|
||||
window.location = "{{ $url }}";
|
||||
@else
|
||||
window.history.back();
|
||||
@endif
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
6
resources/views/components/form/buttons/delete.blade.php
Normal file
6
resources/views/components/form/buttons/delete.blade.php
Normal file
@@ -0,0 +1,6 @@
|
||||
@include('components.form.button', [
|
||||
'class' => 'btn-danger btn-del ' . ($class ?? ''),
|
||||
'icon' => $icon ?? 'fa-trash-alt',
|
||||
'title' => $title ?? 'Effacer',
|
||||
'loading_text' => "<i class='fa fa-circle-o-notch fa-spin'></i>",
|
||||
])
|
||||
5
resources/views/components/form/buttons/edit.blade.php
Normal file
5
resources/views/components/form/buttons/edit.blade.php
Normal file
@@ -0,0 +1,5 @@
|
||||
@include('components.form.button', [
|
||||
'class' => 'btn-primary btn-edit ' . ($class ?? ''),
|
||||
'icon' => 'fa-pencil-alt',
|
||||
'title' => $title ?? 'Modifier',
|
||||
])
|
||||
6
resources/views/components/form/buttons/save.blade.php
Normal file
6
resources/views/components/form/buttons/save.blade.php
Normal file
@@ -0,0 +1,6 @@
|
||||
@include('components.form.button', [
|
||||
'class' => 'btn-success save ' . ($class ?? ''),
|
||||
'icon' => 'fa-save',
|
||||
'txt' => $title ?? 'Enregister',
|
||||
'loading_text' => "<i class='fa fa-spinner fa-spin'></i> En cours",
|
||||
])
|
||||
5
resources/views/components/form/buttons/show.blade.php
Normal file
5
resources/views/components/form/buttons/show.blade.php
Normal file
@@ -0,0 +1,5 @@
|
||||
@include('components.form.button', [
|
||||
'class' => 'btn-secondary btn-show ' . ($class ?? ''),
|
||||
'icon' => 'fa-eye',
|
||||
'title' => $title ?? 'Voir',
|
||||
])
|
||||
8
resources/views/components/form/buttons/submit.blade.php
Normal file
8
resources/views/components/form/buttons/submit.blade.php
Normal file
@@ -0,0 +1,8 @@
|
||||
@include('components.form.button', [
|
||||
'id' => $id_name ?? false,
|
||||
'type' => $type ?? 'submit',
|
||||
'class' => 'btn-success submit ' . ($class ?? ''),
|
||||
'icon' => 'fa-save',
|
||||
'txt' => __('submit'),
|
||||
'loading_text' => "<i class='fa fa-spinner fa-spin'></i> Processing",
|
||||
])
|
||||
@@ -1,23 +1,25 @@
|
||||
@if(!defined('LOAD_AUTOCOMPLETE'))
|
||||
@push('js')
|
||||
<script src="{{ asset('/assets/plugins/autocomplete/bootstrap-autocomplete.min.js') }}"></script>
|
||||
<script>
|
||||
function initAutocomplete(sel, callback) {
|
||||
var selector = (typeof(sel) == 'undefined') ? '.autocomplete' : sel;
|
||||
$(selector).autoComplete();
|
||||
|
||||
$(selector).on('autocomplete.select', function(evt, item) {
|
||||
var field = $(this).data('field');
|
||||
var id = item.value;
|
||||
$('#'+field).val(id);
|
||||
@if (!defined('LOAD_AUTOCOMPLETE'))
|
||||
@push('js')
|
||||
<script src="{{ asset('/assets/plugins/autocomplete/bootstrap-autocomplete.min.js') }}"></script>
|
||||
<script>
|
||||
function initAutocomplete(sel, callback) {
|
||||
var selector = (typeof(sel) == 'undefined') ? '.autocomplete' : sel;
|
||||
$(selector).autoComplete({
|
||||
noResultsText: ''
|
||||
});
|
||||
|
||||
if (typeof(callback) != 'undefined') {
|
||||
var c = callback + '(' + id + ')';
|
||||
eval(c);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
@php(define('LOAD_AUTOCOMPLETE', true))
|
||||
@endif
|
||||
$(selector).on('autocomplete.select', function(evt, item) {
|
||||
var field = $(this).data('field');
|
||||
var id = item.value;
|
||||
$('#' + field).val(id);
|
||||
|
||||
if (typeof(callback) != 'undefined') {
|
||||
var c = callback + '(' + id + ')';
|
||||
eval(c);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
@php(define('LOAD_AUTOCOMPLETE', true))
|
||||
@endif
|
||||
|
||||
Reference in New Issue
Block a user