Merge branch 'update-mairet' into 'nettoyage'

Update mairet

See merge request ldc-web/projets/boutique-cnc!11
This commit is contained in:
Vincent BRIDIER 2023-07-12 10:30:31 +00:00
commit fcb9a15bd5
16 changed files with 34 additions and 169 deletions

View file

@ -6,6 +6,7 @@ use App\Enums\StaticPageType;
use App\Http\Controllers\Controller;
use App\Http\Requests\Fo\ContactFormRequest;
use App\Models\Customer\Contact;
use App\Models\Shop\Shop;
use App\Models\Site\StaticPage;
use Illuminate\Support\Facades\DB;
@ -20,7 +21,9 @@ class ContactController extends Controller
{
$content = StaticPage::getPageOfType(StaticPageType::contact());
return view('theme::pages.contact', compact('content'));
$firstShop = Shop::firstOrFail();
return view('theme::pages.contact', compact('content', 'firstShop'));
}
/**

View file

@ -31,7 +31,9 @@ class TagController extends Controller
*/
public function tag(Tag $tag)
{
$products = Product::query()->where('status', 1)
$products = Product::query()
->where('status', true)
->with(['discount'])
->whereHas('tags', function ($q) use ($tag) {
$q->where('id', $tag->id);
})->paginate(12);

View file

@ -142,6 +142,8 @@ class Product extends Model implements Buyable
});
static::created(function (self $model) {
$model->flashMessages();
// Tag cache need to be refreshed to display the correct number of related products.
Tag::removeCached();
});
static::updating(function (self $model) {
// * ASSERTIONS
@ -171,6 +173,8 @@ class Product extends Model implements Buyable
FileStorageHelper::removeOldModelFilesFromHtml($model->description, $model->getOriginal('description'));
$model->flashMessages();
$model->minicrudUpdated();
// Tag cache need to be refreshed to display the correct number of related products.
Tag::removeCached();
});
static::deleted(function (self $model) {
$model->oldSlugs()->delete();

View file

@ -77,8 +77,8 @@ return [
'trim' => true
],
'foBoutiqueLogo' => [
'height' => 100,
'width' => 100,
'height' => 350,
'width' => 350,
'format' => 'png',
'inCanvas' => true,
'resize' => true,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View file

@ -1,134 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="286.000000pt" height="286.000000pt" viewBox="0 0 286.000000 286.000000"
preserveAspectRatio="xMidYMid meet">
<metadata>
Created by potrace 1.14, written by Peter Selinger 2001-2017
</metadata>
<g transform="translate(0.000000,286.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M1235 2320 c-3 -5 -24 -10 -45 -10 -21 0 -42 -4 -45 -10 -3 -5 -33
-10 -65 -10 -32 0 -62 -4 -65 -10 -3 -5 -17 -10 -30 -10 -13 0 -27 -4 -30 -10
-3 -5 -19 -10 -35 -10 -16 0 -32 -4 -35 -10 -3 -5 -21 -10 -39 -10 -19 0 -39
-7 -46 -15 -7 -8 -16 -12 -21 -9 -5 3 -9 0 -9 -5 0 -6 -11 -11 -25 -11 -14 0
-25 -3 -25 -7 0 -5 -25 -19 -55 -33 -30 -14 -55 -28 -55 -32 0 -5 -9 -8 -20
-8 -12 0 -30 -9 -42 -20 -12 -11 -28 -20 -35 -20 -7 0 -13 -3 -13 -8 0 -4 -15
-13 -32 -21 -18 -8 -35 -17 -38 -20 -3 -3 -22 -19 -43 -34 -20 -16 -48 -39
-62 -53 -13 -13 -29 -24 -35 -24 -6 0 -14 -8 -17 -17 -9 -23 -29 -43 -42 -43
-6 0 -11 -4 -11 -10 0 -5 -16 -25 -35 -44 -19 -20 -35 -38 -35 -41 0 -3 -9
-14 -20 -25 -11 -11 -20 -31 -20 -44 0 -13 -10 -46 -22 -73 -32 -70 -33 -268
-1 -363 11 -36 27 -87 34 -115 29 -112 299 -332 514 -419 228 -92 310 -116
440 -126 55 -4 152 -13 215 -20 204 -20 442 6 670 76 47 14 103 31 125 37 42
12 138 52 215 90 24 12 61 39 82 59 22 21 43 38 49 38 6 0 32 23 59 50 27 28
52 50 56 50 8 0 40 34 74 80 14 18 31 39 38 46 6 7 12 17 12 23 0 6 5 11 10
11 6 0 10 7 10 15 0 8 4 15 8 15 5 0 14 16 22 35 8 19 17 35 21 35 10 0 25 50
33 110 2 19 7 42 10 50 3 8 2 22 -3 30 -17 25 -46 -14 -91 -121 -79 -185 -203
-300 -500 -461 -76 -41 -254 -102 -291 -100 -15 1 -42 -4 -61 -12 -43 -18
-238 -35 -343 -30 -44 2 -116 4 -160 5 -95 1 -317 39 -395 68 -30 10 -79 27
-109 36 -81 25 -231 91 -255 113 -11 11 -49 34 -82 51 -63 32 -184 147 -184
175 0 8 -7 16 -15 19 -18 7 -77 123 -105 207 -20 58 -20 71 -11 168 8 79 16
111 30 126 10 12 35 54 55 94 20 39 41 72 48 72 6 0 26 18 45 39 68 80 299
220 423 256 14 4 38 17 54 28 19 14 31 17 33 10 3 -7 23 2 49 23 56 42 72 44
44 4 -21 -29 -21 -30 -1 -30 34 0 50 11 43 28 -5 15 -4 16 13 2 17 -14 18 -13
13 2 -8 19 18 33 36 19 18 -15 115 10 122 31 6 21 25 23 71 6 26 -10 43 -9 81
1 71 20 358 12 462 -12 36 -8 92 -18 125 -22 33 -4 65 -11 70 -16 6 -4 30 -11
53 -15 38 -6 42 -5 42 15 0 20 -9 26 -38 22 -8 -1 -21 4 -30 12 -22 19 -76 29
-89 16 -5 -5 -17 -7 -27 -3 -14 5 -14 9 -4 22 11 13 10 14 -14 9 -15 -4 -30
-3 -33 3 -3 5 -17 10 -31 10 -13 0 -24 5 -24 10 0 6 -48 10 -124 10 -73 0
-127 4 -131 10 -4 6 -67 10 -155 10 -88 0 -151 -4 -155 -10z m555 -60 c0 -5
-2 -10 -4 -10 -3 0 -8 5 -11 10 -3 6 -1 10 4 10 6 0 11 -4 11 -10z"/>
<path d="M2155 2170 c-47 -6 -48 -7 -25 -17 14 -6 51 -22 83 -36 68 -31 110
-24 75 11 -16 16 -28 15 -28 -3 0 -18 -9 -19 -33 0 -13 9 -17 20 -12 34 3 12
3 20 -2 19 -4 0 -30 -4 -58 -8z"/>
<path d="M2346 2123 c-9 -9 -7 -33 3 -33 12 0 22 28 12 34 -5 3 -11 3 -15 -1z"/>
<path d="M2365 2050 c3 -5 8 -10 11 -10 2 0 4 5 4 10 0 6 -5 10 -11 10 -5 0
-7 -4 -4 -10z"/>
<path d="M707 2013 c-8 -10 -24 -40 -34 -68 -19 -50 -19 -50 -62 -48 -35 2
-42 -1 -39 -15 2 -12 15 -18 41 -20 43 -4 44 -11 18 -87 -16 -46 -20 -50 -56
-55 -49 -6 -74 -39 -50 -64 20 -19 32 -20 64 -2 20 11 28 10 59 -6 57 -29 112
-18 112 22 0 23 -4 24 -31 9 -14 -7 -30 -7 -54 1 -19 6 -35 13 -35 15 0 1 11
27 24 56 13 30 26 68 30 84 4 17 21 42 41 58 43 35 69 82 61 113 -5 19 -13 24
-40 24 -19 0 -40 -8 -49 -17z m53 -32 c0 -5 -9 -19 -20 -32 -21 -26 -27 -11
-10 22 11 19 30 26 30 10z"/>
<path d="M1178 2018 c-21 -17 -51 -102 -78 -223 -23 -106 -35 -130 -46 -100
-6 16 0 49 23 118 9 29 -16 19 -37 -15 -23 -37 -27 -127 -8 -146 7 -7 24 -12
39 -12 32 0 46 30 75 163 10 42 21 77 25 77 5 0 10 -39 11 -87 3 -82 5 -88 25
-91 18 -3 24 4 33 40 16 59 61 158 72 158 5 0 7 -8 4 -17 -3 -10 -11 -45 -19
-78 -36 -145 -32 -165 30 -165 l34 0 -21 28 c-20 26 -20 30 -6 107 8 44 22
112 30 150 21 92 20 105 -4 105 -29 0 -54 -33 -91 -118 -18 -42 -37 -81 -42
-87 -5 -6 -8 27 -7 85 3 119 3 120 -13 120 -7 0 -20 -6 -29 -12z"/>
<path d="M1972 2008 c-5 -7 -18 -51 -28 -98 -16 -75 -22 -90 -60 -127 -46 -47
-88 -57 -99 -24 -8 27 3 66 26 87 18 16 19 16 19 -4 0 -30 36 -30 43 0 7 26
-8 58 -28 58 -34 0 -66 -26 -86 -69 -12 -25 -31 -56 -42 -68 -37 -41 -64 -22
-32 21 20 27 20 76 -1 76 -9 0 -21 14 -27 30 -6 17 -16 30 -22 30 -19 0 -35
-23 -35 -49 0 -31 -44 -107 -71 -122 -27 -14 -31 -9 -19 32 15 52 12 84 -10
104 -18 16 -23 17 -47 4 -33 -18 -70 -74 -78 -121 -6 -30 -3 -38 12 -47 22
-11 64 -4 75 13 5 7 12 5 20 -7 10 -13 21 -16 46 -11 26 5 39 18 65 60 20 34
39 54 51 54 19 0 19 -7 -5 -66 -25 -63 22 -87 79 -39 l30 25 16 -25 c20 -30
50 -32 95 -4 l33 20 15 -21 c19 -27 28 -20 42 37 19 74 81 130 67 61 -17 -83
-17 -94 -3 -106 11 -10 22 -7 51 13 43 29 56 31 56 10 0 -9 11 -21 25 -27 34
-15 94 12 142 66 49 54 26 59 -33 7 -45 -40 -86 -52 -99 -31 -4 6 14 29 39 51
58 52 64 89 13 89 -37 0 -78 -35 -96 -81 -5 -15 -24 -37 -42 -50 l-32 -22 7
29 c4 16 10 49 13 73 l5 44 -41 -6 c-46 -6 -47 -5 -26 53 8 23 15 53 15 66 0
26 -21 32 -38 12z m-492 -187 c0 -28 -11 -47 -42 -70 -16 -12 -18 -10 -18 15
0 34 36 98 50 89 6 -3 10 -19 10 -34z m720 31 c0 -11 -22 -32 -32 -32 -5 0 -4
9 2 20 11 20 30 28 30 12z"/>
<path d="M2451 1984 c24 -29 46 -35 60 -17 12 15 12 16 -3 10 -10 -3 -20 -2
-23 2 -2 5 -14 11 -25 14 -18 5 -19 3 -9 -9z"/>
<path d="M2190 1950 c-32 -27 -33 -29 -13 -30 35 0 73 21 73 42 0 26 -20 22
-60 -12z"/>
<path d="M2535 1910 c10 -11 20 -20 23 -20 3 0 -3 9 -13 20 -10 11 -20 20 -23
20 -3 0 3 -9 13 -20z"/>
<path d="M2584 1919 c-10 -17 13 -36 27 -22 12 12 4 33 -11 33 -5 0 -12 -5
-16 -11z"/>
<path d="M834 1881 c-32 -20 -64 -74 -64 -110 0 -25 42 -71 65 -71 23 0 55 20
103 65 45 42 51 55 27 55 -8 0 -15 -4 -15 -9 0 -16 -83 -71 -107 -71 -31 0
-30 33 1 48 32 15 58 55 54 84 -4 30 -25 33 -64 9z m26 -30 c0 -6 -4 -13 -10
-16 -5 -3 -10 1 -10 9 0 9 5 16 10 16 6 0 10 -4 10 -9z"/>
<path d="M2620 1870 c0 -5 5 -10 11 -10 5 0 7 5 4 10 -3 6 -8 10 -11 10 -2 0
-4 -4 -4 -10z"/>
<path d="M2672 1760 c7 -10 14 -18 15 -16 6 6 -9 36 -18 36 -5 0 -4 -9 3 -20z"/>
<path d="M2701 1714 c0 -11 3 -14 6 -6 3 7 2 16 -1 19 -3 4 -6 -2 -5 -13z"/>
<path d="M2741 1584 c0 -11 3 -14 6 -6 3 7 2 16 -1 19 -3 4 -6 -2 -5 -13z"/>
<path d="M713 1575 c-60 -26 -98 -126 -53 -140 29 -9 40 2 40 39 0 19 9 45 21
60 17 21 29 26 65 26 40 0 49 -5 89 -46 25 -26 65 -85 91 -137 51 -103 51
-107 13 -262 -14 -53 -29 -89 -47 -107 l-26 -28 77 0 c45 0 77 4 77 10 0 6
-13 10 -29 10 -17 0 -32 4 -35 9 -7 11 36 171 45 171 7 0 79 -165 79 -181 0
-5 6 -9 13 -9 7 0 28 37 47 83 40 98 90 201 95 195 2 -2 -2 -40 -10 -83 -17
-96 -19 -150 -5 -176 14 -26 21 -24 74 15 l45 35 11 -35 c15 -44 39 -44 79 -1
l31 32 0 -27 c0 -43 19 -43 61 -2 44 42 57 84 14 44 l-25 -23 0 25 c0 15 7 62
15 105 19 99 20 93 -12 93 -59 0 -130 -68 -153 -145 -11 -37 -52 -75 -80 -75
-16 0 12 185 46 308 6 20 3 22 -27 22 -27 0 -38 -7 -55 -33 -38 -57 -66 -111
-99 -185 l-32 -72 -27 82 c-106 315 -264 468 -413 403z m797 -361 c0 -25 -34
-144 -41 -144 -13 0 -11 94 3 125 10 21 38 36 38 19z"/>
<path d="M1710 1424 c-17 -44 -13 -66 12 -62 35 5 46 88 12 88 -8 0 -19 -12
-24 -26z"/>
<path d="M815 1413 c-11 -2 -30 -6 -42 -9 -13 -2 -23 -12 -23 -20 0 -13 7 -15
34 -10 20 4 37 2 41 -4 3 -5 2 -10 -4 -10 -6 0 -36 -24 -67 -52 -56 -53 -132
-108 -147 -108 -5 0 -5 20 -2 44 5 32 2 54 -10 80 -15 32 -21 36 -55 36 -52 0
-90 -34 -124 -110 -26 -57 -27 -64 -14 -102 7 -23 19 -44 27 -46 10 -3 12 0 8
13 -14 36 -19 65 -10 65 5 0 14 -13 20 -30 13 -35 28 -39 36 -10 11 41 61 19
92 -40 8 -16 23 -31 33 -34 14 -5 17 -14 14 -46 -5 -49 13 -53 22 -5 4 19 11
37 17 41 7 4 8 -6 4 -30 -10 -50 2 -45 27 12 12 26 32 61 45 79 14 18 40 67
58 110 19 42 42 84 53 93 42 35 44 46 19 74 -13 14 -26 25 -28 25 -2 -1 -13
-3 -24 -6z"/>
<path d="M2192 1320 c-23 -32 -42 -69 -42 -82 0 -13 -7 -48 -15 -78 -8 -30
-15 -79 -15 -107 0 -48 2 -53 26 -59 73 -18 209 23 271 82 40 38 43 44 43 95
0 72 -28 119 -69 119 -44 0 -48 -19 -12 -47 120 -94 36 -203 -154 -203 -52 0
-51 -3 -29 106 19 91 29 114 49 114 23 0 18 17 -6 23 -12 3 -18 10 -14 17 13
21 23 70 16 74 -4 3 -26 -21 -49 -54z"/>
<path d="M2038 1261 c-19 -17 -49 -57 -67 -90 -27 -52 -32 -69 -29 -118 3 -54
5 -58 28 -61 42 -4 118 54 96 75 -3 3 -12 0 -21 -7 -19 -16 -45 -6 -45 19 0
10 23 43 50 72 45 48 50 58 48 93 -2 22 -8 41 -15 43 -6 2 -27 -10 -45 -26z
m-7 -84 c-17 -17 -24 -1 -10 25 12 21 14 21 17 4 2 -10 -1 -23 -7 -29z"/>
<path d="M1811 1239 c-24 -21 -41 -42 -38 -46 4 -3 13 0 22 7 9 7 17 11 20 9
4 -4 -28 -161 -41 -201 -4 -14 0 -18 21 -18 29 0 32 6 67 120 22 69 25 75 49
72 28 -3 49 28 49 73 0 35 -24 31 -52 -7 l-23 -33 -5 29 c-3 16 -9 31 -15 32
-5 2 -30 -15 -54 -37z"/>
<path d="M1653 1230 c-33 -31 -48 -65 -18 -40 23 19 30 5 17 -37 -13 -46 -18
-135 -8 -151 4 -7 12 -12 18 -12 15 0 92 79 85 87 -4 3 -13 0 -22 -7 -25 -21
-29 -4 -16 67 23 119 4 149 -56 93z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 8.6 KiB

View file

@ -1,19 +0,0 @@
{
"name": "Boutique Mairet",
"short_name": "Boutique Mairet",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-256x256.png",
"sizes": "256x256",
"type": "image/png"
}
],
"theme_color": "#f9ddc7",
"background_color": "#f9ddc7",
"display": "standalone"
}

View file

@ -8,14 +8,14 @@
<!-- Favicon -->
{{-- GENERER favicon avec un outil https://realfavicongenerator.net/ --}}
<link rel="apple-touch-icon" sizes="180x180" href="{{ asset('apple-touch-icon-bo.png') }}">
<link rel="icon" href="{{ asset('favicon-bo.ico') }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ asset('favicon-bo-32x32.png') }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('favicon-bo-16x16.png') }}">
<link rel="icon" href="{{ asset('favicon.ico') }}">
<link rel="apple-touch-icon" sizes="180x180" href="{{ asset('apple-touch-icon.png') }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ asset('favicon-32x32.png') }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('favicon-16x16.png') }}">
<link rel="manifest" href="{{ asset('site.webmanifest') }}">
<link rel="mask-icon" href="{{ asset('safari-pinned-tab.svg') }}" color="#6b3e14">
<meta name="msapplication-TileColor" content="#f9ddc7">
<meta name="theme-color" content="#f9ddc7">
<link rel="mask-icon" href="{{ asset('safari-pinned-tab.svg') }}" color="#5bbad5">
<meta name="msapplication-TileColor" content="#ea892d">
<meta name="theme-color" content="#ffffff">
@include('back::modules.breadcrumb.breadcrumb-head')

19
webpack.mix.js vendored
View file

@ -1,4 +1,6 @@
const path = require("path");
const fs = require("fs");
const glob = require("glob");
const mix = require("laravel-mix");
require("laravel-mix-artisan-publish");
@ -18,7 +20,6 @@ const polyfill = {
mix.setPublicPath(path.normalize('public/build'));
mix.setResourceRoot('/build');
mix.webpackConfig({
resolve: {
extensions: ["*",".js", ".vue", ".ts"],
@ -74,10 +75,10 @@ mix.clean({
// * COMMON
mix.vue({
runtimeOnly: true,
extractStyles: "css/v-extract.css",
globalStyles: false,
})
runtimeOnly: true,
extractStyles: "css/v-extract.css",
globalStyles: false,
})
.eslint({
fix: true,
extensions: ["js", "ts"],
@ -115,3 +116,11 @@ mix.copyDirectory("resources/assets/images", `public/build/assets/images`)
// * Copy FRONT resources
mix.copyDirectory("resources/theme/assets/images", `public/build/assets/images`)
.copyDirectory("resources/theme/assets/fonts", `public/build/assets/fonts`);
// * Copy FAVICON resources
mix.then(() => {
glob.sync(path.normalize('resources/theme/favicon/*')).forEach(filePath => {
if (fs.statSync(path.normalize(filePath)).isFile) {
fs.cpSync(path.normalize(filePath), path.resolve('public/' + path.basename(filePath)));
}
});
});