Merge branch 'develop' into trunk

This commit is contained in:
Jérémy Munsch 2026-10-28 11:53:30 +01:00
commit 35306547c9
No known key found for this signature in database
GPG key ID: 2AAECDA6B7330F91
24 changed files with 298 additions and 241 deletions

View file

@ -15,6 +15,7 @@ final readonly class DiscountProductDto implements \JsonSerializable, Arrayable
public function __construct(
public string $id,
public string $name,
public ?string $picture,
) {
}
@ -23,6 +24,7 @@ final readonly class DiscountProductDto implements \JsonSerializable, Arrayable
return new self(
id: (string) $product->id,
name: (string) $product->name,
picture: $product->picture,
);
}
@ -33,8 +35,9 @@ final readonly class DiscountProductDto implements \JsonSerializable, Arrayable
public function toArray(): array
{
return [
'id' => $this->id,
'name' => $this->name,
'id' => $this->id,
'name' => $this->name,
'picture' => $this->picture,
];
}

View file

@ -79,4 +79,13 @@ class ContactFormRequest extends FormRequest
file: $attachedFile,
);
}
/** @return array<string,string> */
#[\Override]
public function attributes(): array
{
return [
'subject' => trans('validation.custom.attributes.object'),
];
}
}

View file

@ -29,14 +29,14 @@ final readonly class GetDiscountFormDataQuery implements Query
if ($input->discount !== null) {
$selectedProds = Product::query()
->select(['id', 'name'])
->select(['id', 'name', 'picture'])
->where('discount_id', $input->discount->id)
->orderBy('name')
->get()
->map(fn (Product $p): DiscountProductDto => DiscountProductDto::fromModel($p));
$existingProds = Product::query()
->select(['id', 'name'])
->select(['id', 'name', 'picture'])
->whereNotIn('id', $selectedProds->pluck('id'))
->orderBy('name')
->get()
@ -46,7 +46,7 @@ final readonly class GetDiscountFormDataQuery implements Query
} else {
$selectedProds = collect();
$existingProds = Product::query()
->select(['id', 'name'])
->select(['id', 'name', 'picture'])
->orderBy('name')
->get()
->map(fn (Product $p): DiscountProductDto => DiscountProductDto::fromModel($p));

View file

@ -867,5 +867,6 @@
"Your password has been changed on :appname": "Your password has been changed on :appname",
"Your password has been changed. If you are not at the origin of this change, please contact us as soon as possible using the contact form or by contacting your manager.": "Your password has been changed. If you are not at the origin of this change, please contact us as soon as possible using the contact form or by contacting your manager.",
"your_message": "your_message",
"Zip code": "Zip code"
}
"Zip code": "Zip code",
"Your search": "Your search"
}

View file

@ -17,7 +17,7 @@
":title Pick up your order :/title :desc :/desc": ":title Retirez :/title :desc votre commande :/desc",
":title Save money :/title :desc Get even more out of our gourmet products by buying directly :/desc": ":title Des économies :/title :desc Profitez encore plus de nos produits gourmands en achetant en direct :/desc",
":title Select :/title :desc your products online :/desc": ":title Sélectionnez :/title :desc vos produits en ligne :/desc",
":title Select :/title :desc your time slot :/desc": ":title Choisissez :/title :desc votre créneau horaire :/desc",
":title Select :/title :desc your pickup day :/desc": ":title Choisissez :/title :desc votre jour de retrait :/desc",
"A confirmation has just been sent to your email address": "Une confirmation vient de vous être envoyée sur votre adresse e-mail",
"A decryption key is required.": "Une clé de déchiffrement est requise.",
"A fresh verification link has been sent to your email address.": "Un nouveau lien de vérification a été envoyé à votre adresse e-mail.",
@ -854,5 +854,6 @@
"Your password has been changed on :appname": "Votre mot de passe a été changé sur :appname",
"Your password has been changed. If you are not at the origin of this change, please contact us as soon as possible using the contact form or by contacting your manager.": "Votre mot de passe a été changé. Si vous n'êtes pas à l'origine de ceci, veuillez nous contacter au plus vite en utilisant le formulaire de contact ou en vous rapprochant de votre responsable.",
"your_message": "Votre message",
"Zip code": "Code postal"
}
"Zip code": "Code postal",
"Your search": "Votre recherche"
}

View file

@ -350,6 +350,7 @@ return [
'nv_serving_size_g' => 'Taille d\'une portion (g)',
'nv_serving_sugar_g' => 'Sucres par portion (g)',
'nv_sugar_g' => 'Sucres (g)',
'object' => 'objet',
'ok_cgv' => 'conditions générales de vente',
'optin' => 'inscription à la newsletter',
'order' => 'ordre',

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 47 KiB

View file

@ -21,3 +21,16 @@
.stretched-link::after {
cursor: pointer;
}
.btn-tertiary {
border-color: var(--bs-dark) !important;
}
.focus-ring-dark {
--bs-focus-ring-color: rgb(var(--bs-dark-rgb), 0.25) !important;
}
.btn-tertiary:hover {
background-color: rgb(var(--bs-light-rgb), 0.85) !important;
}

View file

@ -2,6 +2,7 @@
$primary: $color-primary;
$secondary: $color-secondary;
$tertiary: $color-tertiary;
$success: $color-success;
$info: $color-info;
$warning: $color-warning;
@ -11,6 +12,7 @@ $dark: $color-dark;
$custom-theme-colors: (
primary: $primary,
secondary: $secondary,
tertiary: $tertiary,
success: $success,
info: $info,
warning: $warning,

View file

@ -10,6 +10,7 @@ $color-secondary: #5c636a;
$color-info: #045487;
$color-warning: #ffc454;
$color-primary: $color-cocotte;
$color-tertiary: #f8f6ed;
// * BODY
$body-bg: #f8f9fa;

View file

@ -1,58 +1,61 @@
<template>
<div class="product-drag-drop">
<div class="mb-4">
<div class="d-flex justify-content-between align-items-center mb-3">
<h5 class="mb-0">
<fieldset class="border border-secondary-subtle rounded p-2">
<legend class="mb-3 h5">
{{ __('Available products') }}
</h5>
<div
class="input-group input-group-sm w-auto"
style="max-width: 250px;"
>
<input
v-model="searchQuery"
type="text"
class="form-control"
:placeholder="__('Search...')"
</legend>
<div class="d-flex justify-content-between align-items-center mb-3">
<div
class="input-group input-group-sm w-auto"
style="max-width: 250px;"
>
<button
v-if="searchQuery"
class="btn btn-outline-secondary"
type="button"
:title="__('Clear')"
@click="searchQuery = ''"
>
<i class="fa-solid fa-xmark" />
</button>
</div>
</div>
<draggable
v-model="filteredAvailable"
group="products"
item-key="id"
class="drag-container"
ghost-class="ghost-card"
animation="200"
>
<template #item="{ element }">
<div class="card product-card">
<img
v-if="element.picture"
:src="`/${element.picture}`"
:alt="element.name"
class="card-img-top product-img"
<input
v-model="searchQuery"
type="text"
class="form-control"
:placeholder="__('Search...')"
:aria-label="__('Search...')"
>
<div class="card-body p-2 text-center">
<p
class="card-title m-0 product-name"
:title="element.name"
>
{{ element.name }}
</p>
</div>
<button
v-if="searchQuery"
class="btn btn-outline-secondary"
type="button"
:title="__('Clear')"
@click="searchQuery = ''"
>
<i class="fa-solid fa-xmark" />
</button>
</div>
</template>
</draggable>
</div>
<draggable
v-model="filteredAvailable"
group="products"
item-key="id"
class="drag-container"
ghost-class="ghost-card"
animation="200"
>
<template #item="{ element }">
<div class="card product-card">
<img
v-if="element.picture"
:src="`/${element.picture}`"
:alt="element.name"
class="card-img-top product-img"
>
<div class="card-body p-2 text-center">
<p
class="card-title m-0 product-name"
:title="element.name"
>
{{ element.name }}
</p>
</div>
</div>
</template>
</draggable>
</fieldset>
<p
v-if="filteredAvailable.length === 0"
@ -63,10 +66,10 @@
</p>
</div>
<div>
<h5 class="mb-3">
<fieldset class="border border-primary-subtle rounded p-2">
<legend class="mb-3 h5">
{{ __('Selected products') }}
</h5>
</legend>
<draggable
v-model="selected"
group="products"
@ -95,13 +98,13 @@
</template>
</draggable>
<p
<small
v-if="selected.length === 0"
class="text-muted small mt-2"
class="text-muted small fst-italic text-center d-block"
>
{{ __('Drag products here to select them.') }}
</p>
</div>
</small>
</fieldset>
<input
v-for="(sel, selIdx) of selected"

View file

@ -135,13 +135,13 @@
<div class="d-flex flex-column-reverse flex-md-row gap-2">
<button
type="button"
class="btn btn-outline-secondary btn-sm text-uppercase rounded-pill w-100"
class="btn btn-outline-secondary fw-bold btn-sm text-uppercase rounded-pill w-100"
@click="onEmptyBasket()"
>
{{ __('Empty Basket') }}
</button>
<a
class="btn btn-primary text-uppercase fw-semibold rounded-pill w-100"
class="btn btn-primary fw-bold text-uppercase fw-semibold rounded-pill w-100"
:href="route('ORDER_RECAP')"
>
{{ __('Order') }}

View file

@ -1,7 +1,7 @@
<template>
<button
ref="navBasketButton"
class="btn btn-outline-dark border-0 btn-lg text-decoration-none d-flex align-items-center gap-2"
class="btn btn-tertiary border-dark focus-ring focus-ring-dark btn-lg text-decoration-none d-flex align-items-center gap-2"
:title="__('Show basket')"
data-bs-toggle="tooltip"
aria-label="Ouvrir le panier"
@ -12,10 +12,10 @@
<span
v-show="count > 0"
class="position-absolute top-0 start-100 translate-middle badge rounded-pill text-bg-primary"
class="position-absolute top-0 start-100 translate-middle ms-2 badge rounded-pill text-bg-info"
>
{{ count }}
<span class="visually-hidden">articles dans le panier</span>
<span class="visually-hidden">{{ __('articles dans le panier') }}</span>
</span>
</div>

View file

@ -1,7 +1,7 @@
<template>
<div>
<div class="h1 sticky-md-top sticky-top-offset bg-body py-2 z-3 text-uppercase">
{{ __('All aisles') }}
{{ pageTitle }}
</div>
<div
@ -53,7 +53,7 @@
<script lang="ts" setup>
import { storeToRefs } from "pinia";
import { onMounted, onUnmounted, ref } from "vue";
import { computed, onMounted, onUnmounted, ref } from "vue";
import { useProductViewerStore } from "@fo/stores";
import { __, trans_choice } from "@modules/trans";
@ -62,14 +62,22 @@ import ProductCard from "./ProductCard.vue";
defineOptions({ name: "AilesViewer" });
const store = useProductViewerStore();
const { loading, filteredProductList } = storeToRefs(store);
const {
loading, filteredProductList, activeBrands, activeRanges, activeTags, isDiscounted, currentSearchValue
} = storeToRefs(store);
const scrollSentinel = ref<HTMLElement | null>(null);
let observer: IntersectionObserver | null = null;
const anyBrandChecked = computed<boolean>(() => activeBrands.value.length > 0);
const anyRangeChecked = computed<boolean>(() => activeRanges.value.length > 0);
const anyTagChecked = computed<boolean>(() => activeTags.value.length > 0);
const hascheckedAnOption = computed<boolean>(() => currentSearchValue.value.length > 0 || anyBrandChecked.value
|| anyRangeChecked.value || anyTagChecked.value|| anyBrandChecked.value || isDiscounted.value
);
const pageTitle = computed<string>(() => hascheckedAnOption.value ? __("Your search") : __("All aisles"));
onMounted(() => {
observer = new IntersectionObserver((entries) => {
const firstEntry = entries[0];

View file

@ -143,28 +143,32 @@ export class ProductFilterViewModel {
const urlParams = new URL(document.location.href).searchParams;
const urlSearch = urlParams.get("search")?.trim() ?? "";
if (urlSearch) {
this.store.setSearchValue(urlSearch);
}
this.searchValue.value = this.store.currentSearchValue;
const urlRanges = urlParams
.getAll("ranges[]")
.map(v => Number.parseInt(v.trim(), 10))
.filter(v => !Number.isNaN(v)) as RangeId[];
this.store.setActiveRanges(urlRanges);
const urlTags = urlParams
.getAll("tags[]")
.map(v => Number.parseInt(v.trim(), 10))
.filter(v => !Number.isNaN(v)) as TagId[];
this.store.setActiveTags(urlTags);
const urlBrands = urlParams
.getAll("brands[]")
.map(v => v.trim())
.filter(v => v.length) as BrandValue[];
if (urlSearch.length) {
this.store.setSearchValue(urlSearch);
}
this.store.setActiveRanges(urlRanges);
this.store.setActiveTags(urlTags);
this.store.setActiveBrands(urlBrands);
this.searchValue.value = this.store.currentSearchValue;
if (urlSearch.length || urlRanges.length || urlTags.length || urlBrands.length) {
this.store.setLoading(true);
this.refreshList();
}
watch(this.searchValue, (newValue) => {
const cleanText = String(newValue || "");

View file

@ -3,6 +3,7 @@ import {
faArrowLeft,
faArrowRight,
faBasketShopping,
faCashRegister,
faChevronLeft,
faChevronRight,
faCircleCheck,
@ -54,4 +55,6 @@ library.add(faArrowRight);
library.add(faChevronRight);
library.add(faChevronLeft);
library.add(faCashRegister);
dom.watch();

View file

@ -27,7 +27,7 @@
<img class="card-img-top object-fit-contain" src="{{ Vite::asset('resources/assets/images/icons/step_2.png') }}"
alt="{{ __('Step :number', ['number' => 2]) }}">
<div class="card-body m-2 text-center">
{!! __(':title Select :/title :desc your time slot :/desc', [
{!! __(':title Select :/title :desc your pickup day :/desc', [
'title' => '<h3 class=" fw-bold h4 m-0">',
'/title' => '</h3>',
'desc' => '<p class="text-muted small m-0 fs-5">',

View file

@ -5,8 +5,8 @@
<div class="d-flex align-items-center justify-content-between w-100 d-md-none">
<div class="d-flex align-items-center gap-2">
<button class="navbar-toggler border-0 p-1" data-bs-toggle="collapse" data-bs-target="#navbar-nav-alt-markup" type="button"
aria-controls="navbar-nav-alt-markup" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
<button class="btn btn-tertiary focus-ring focus-ring-dark" data-bs-toggle="collapse" data-bs-target="#navbar-nav-alt-markup"
type="button" aria-controls="navbar-nav-alt-markup" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand d-none m-0 p-0" href="{{ route('fo.pages.home') }}">
@ -16,7 +16,7 @@
<div class="d-flex align-items-center gap-1">
@if (!Route::is('fo.products.index'))
<a class="btn btn-outline-dark btn-lg border-0" id="btn-search-icon" href="{{ route('fo.products.index') }}"
<a class="btn btn-tertiary focus-ring focus-ring-dark btn-lg" id="btn-search-icon" href="{{ route('fo.products.index') }}"
aria-label="{{ __('Search') }}">
<i class="fa-solid fa-magnifying-glass"></i>
</a>
@ -24,15 +24,15 @@
<div class="position-relative nav-basket-button p-0"></div>
<a class="btn btn-outline-dark btn-lg border-0" data-bs-toggle="tooltip" href="{{ route('fo.account.dashboard') }}"
<a class="btn btn-tertiary focus-ring focus-ring-dark btn-lg" data-bs-toggle="tooltip" href="{{ route('fo.account.dashboard') }}"
title="{{ __('Go to page :page', ['page' => __('Dashboard')]) }}" aria-label="{{ __('Dashboard') }}">
<i class="fa-solid fa-user-lock"></i>
</a>
@auth('frontend')
<form class="d-inline m-0 p-0" action="{{ route('fo.auth.deconnexion') }}" method="POST">
@csrf
<button class="btn btn-outline-dark btn-lg border-0" data-bs-toggle="tooltip" type="submit" title="{{ __('Logout') }}"
aria-label="{{ __('Logout') }}">
<button class="btn btn-tertiary focus-ring focus-ring-dark btn-lg" data-bs-toggle="tooltip" type="submit"
title="{{ __('Logout') }}" aria-label="{{ __('Logout') }}">
<i class="fa-solid fa-right-from-bracket"></i>
</button>
</form>
@ -90,7 +90,8 @@
<div class="input-group">
<input class="form-control border-dark w-fit" id="search" name="search" type="text" value="{{ $search ?? '' }}"
aria-label="{{ __('Search') }}" placeholder="{{ __('Search') }}...">
<button class="btn btn-dark" data-bs-toggle="tooltip" data-bs-placement="bottom" type="submit" title="{{ __('Search') }}">
<button class="btn btn-tertiary focus-ring focus-ring-dark" data-bs-toggle="tooltip" data-bs-placement="bottom" type="submit"
title="{{ __('Search') }}">
<i class="fa-solid fa-magnifying-glass"></i>
</button>
</div>
@ -100,15 +101,15 @@
{{-- HIDDEN ON MOBILE --}}
<div class="align-items-center d-none d-md-flex order-4 ms-auto flex-col gap-1">
<div class="position-relative nav-basket-button p-0"></div>
<a class="btn btn-outline-dark btn-lg border-0" data-bs-toggle="tooltip" href="{{ route('fo.account.dashboard') }}"
<a class="btn btn-tertiary focus-ring focus-ring-dark btn-lg" data-bs-toggle="tooltip" href="{{ route('fo.account.dashboard') }}"
title="{{ __('Go to page :page', ['page' => __('Dashboard')]) }}">
<i class="fa-solid fa-user-lock fa-lg"></i>
</a>
@auth('frontend')
<form class="d-inline m-0 p-0" action="{{ route('fo.auth.deconnexion') }}" method="POST">
@csrf
<button class="btn btn-outline-dark btn-lg border-0" data-bs-toggle="tooltip" type="submit" title="{{ __('Logout') }}"
aria-label="{{ __('Logout') }}">
<button class="btn btn-tertiary focus-ring focus-ring-dark btn-lg" data-bs-toggle="tooltip" type="submit"
title="{{ __('Logout') }}" aria-label="{{ __('Logout') }}">
<i class="fa-solid fa-right-from-bracket fa-lg"></i>
</button>
</form>

View file

@ -1,100 +1,98 @@
@if (!empty($productWithPricing->product->inco->nv_kj))
<div class="accordion rounded-4 overflow-hidden shadow-sm" id="accordion-product-details">
<div class="accordion rounded-4 overflow-hidden shadow-sm" id="accordion-product-details">
@if (!empty($productWithPricing->product->inco->ingredients))
<div class="accordion-item border-0">
<h2 class="accordion-header">
<button class="accordion-button collapsed fw-semibold text-dark bg-primary py-3" data-bs-toggle="collapse"
data-bs-target="#ingredientsList" type="button" aria-expanded="false" aria-controls="ingredientsList"
aria-label="{{ __('See the list of ingredients') }}">
<img class="text-success wh-20px me-2" src="{{ Vite::asset('resources/assets/images/icons/icon_check.png') }}" alt=""
aria-hidden="true">
{{ __('Ingredients') }}
</button>
</h2>
<div class="accordion-collapse collapse" id="ingredientsList" data-bs-parent="#accordion-product-details">
<div class="accordion-body bg-light text-secondary lh-lg mh-250px-scroll">
{!! clean($productWithPricing->product->inco->ingredients ?? '') !!}
@if (!empty($productWithPricing->product->inco->allergens))
<div class="border-top border-secondary-subtle mt-3 pt-3">
<strong class="text-dark small text-uppercase d-block mb-1">{{ __('Allergens') }} :</strong>
<span class="text-danger small fw-medium">{{ $productWithPricing->product->inco->allergens }}</span>
</div>
@endif
</div>
</div>
</div>
@endif
<div class="accordion-item border-top border-0">
@if (!empty($productWithPricing->product->inco->ingredients))
<div class="accordion-item border-0">
<h2 class="accordion-header">
<button class="accordion-button collapsed fw-semibold text-dark bg-primary py-3" data-bs-toggle="collapse"
data-bs-target="#nutritionalValues" type="button" aria-expanded="false" aria-controls="nutritionalValues"
aria-label="{{ __('See nutritional values') }}">
<img class="wh-20px me-2" src="{{ Vite::asset('resources/assets/images/icons/icon_search.png') }}" alt=""
data-bs-target="#ingredientsList" type="button" aria-expanded="false" aria-controls="ingredientsList"
aria-label="{{ __('See the list of ingredients') }}">
<img class="text-success wh-20px me-2" src="{{ Vite::asset('resources/assets/images/icons/icon_check.png') }}" alt=""
aria-hidden="true">
{{ __('Nutritional values') }}
{{ __('Ingredients') }}
</button>
</h2>
<div class="accordion-collapse collapse" id="nutritionalValues" data-bs-parent="#accordion-product-details">
<div class="accordion-body bg-light mh-350px-scroll p-0">
<table class="table-sm table-striped table-hover small m-0 table align-middle">
<caption class="visually-hidden">{{ __('Average nutritional values') }}</caption>
<thead class="table-dark sticky-top z-1">
<tr>
<th class="py-2 ps-3" scope="col">{{ __('Nutrient') }}</th>
<th class="py-2 text-center" scope="col">{{ __('Per') }} {{ $productWithPricing->product->inco->nv_ref_weight_g }}g
</th>
</tr>
</thead>
<tbody>
<tr>
<th class="fw-semibold text-dark ps-3" scope="row">{{ __('Energy') }}</th>
<td class="fw-bold text-primary text-center">
{{ $productWithPricing->product->inco->nv_kj }} {{ __('Kj') }}<br>
<span class="small text-muted">{{ $productWithPricing->product->inco->nv_kcal }} {{ __('Kcal') }}</span>
</td>
</tr>
<tr>
<th class="text-dark ps-3" scope="row">
{{ __('Fat') }}<br>
<span class="fw-normal text-muted small ps-2">&bull; {{ __('Of which saturated fatty acids') }}</span>
</th>
<td class="text-center">
{{ $productWithPricing->product->inco->nv_fat_g }} g<br>
<span class="text-muted small">{{ $productWithPricing->product->inco->nv_sat_fat_g }} g</span>
</td>
</tr>
<tr>
<th class="text-dark ps-3" scope="row">
{{ __('Carbohydrates') }}<br>
<span class="fw-normal text-muted small ps-2">&bull; {{ __('of which sugars') }}</span>
</th>
<td class="text-center">
{{ $productWithPricing->product->inco->nv_carb_g }} g<br>
<span class="text-muted small">{{ $productWithPricing->product->inco->nv_sugar_g }} g</span>
</td>
</tr>
<tr>
<th class="text-dark ps-3" scope="row">{{ __('Dietary fiber') }}</th>
<td class="text-center">{{ $productWithPricing->product->inco->nv_fiber_g }} g</td>
</tr>
<tr>
<th class="text-dark ps-3" scope="row">{{ __('Proteins') }}</th>
<td class="fw-semibold text-center">{{ $productWithPricing->product->inco->nv_protein_g }} g</td>
</tr>
<tr>
<th class="text-dark ps-3" scope="row">{{ __('Salt') }}</th>
<td class="fw-bold text-danger text-center">{{ $productWithPricing->product->inco->nv_salt_g }} g</td>
</tr>
</tbody>
</table>
<div class="border-top p-3">
<p class="fst-italic text-muted small m-0">
*{{ __('Reference Daily Intakes for an adult (8400kj/2000kcal).') }}
</p>
</div>
<div class="accordion-collapse collapse" id="ingredientsList" data-bs-parent="#accordion-product-details">
<div class="accordion-body bg-light text-secondary lh-lg mh-250px-scroll">
{!! clean($productWithPricing->product->inco->ingredients ?? '') !!}
@if (!empty($productWithPricing->product->inco->allergens))
<div class="border-top border-secondary-subtle mt-3 pt-3">
<strong class="text-dark small text-uppercase d-block mb-1">{{ __('Allergens') }} :</strong>
<span class="text-danger small fw-medium">{{ $productWithPricing->product->inco->allergens }}</span>
</div>
@endif
</div>
</div>
</div>
@endif
<div class="accordion-item border-top border-0">
<h2 class="accordion-header">
<button class="accordion-button collapsed fw-semibold text-dark bg-primary py-3" data-bs-toggle="collapse"
data-bs-target="#nutritionalValues" type="button" aria-expanded="false" aria-controls="nutritionalValues"
aria-label="{{ __('See nutritional values') }}">
<img class="wh-20px me-2" src="{{ Vite::asset('resources/assets/images/icons/icon_search.png') }}" alt=""
aria-hidden="true">
{{ __('Nutritional values') }}
</button>
</h2>
<div class="accordion-collapse collapse" id="nutritionalValues" data-bs-parent="#accordion-product-details">
<div class="accordion-body bg-light mh-350px-scroll p-0">
<table class="table-sm table-striped table-hover small m-0 table align-middle">
<caption class="visually-hidden">{{ __('Average nutritional values') }}</caption>
<thead class="table-dark sticky-top z-1">
<tr>
<th class="py-2 ps-3" scope="col">{{ __('Nutrient') }}</th>
<th class="py-2 text-center" scope="col">{{ __('Per') }} {{ $productWithPricing->product->inco->nv_ref_weight_g }}g
</th>
</tr>
</thead>
<tbody>
<tr>
<th class="fw-semibold text-dark ps-3" scope="row">{{ __('Energy') }}</th>
<td class="fw-bold text-primary text-center">
{{ $productWithPricing->product->inco->nv_kj }} {{ __('Kj') }}<br>
<span class="small text-muted">{{ $productWithPricing->product->inco->nv_kcal }} {{ __('Kcal') }}</span>
</td>
</tr>
<tr>
<th class="text-dark ps-3" scope="row">
{{ __('Fat') }}<br>
<span class="fw-normal text-muted small ps-2">&bull; {{ __('Of which saturated fatty acids') }}</span>
</th>
<td class="text-center">
{{ $productWithPricing->product->inco->nv_fat_g }} g<br>
<span class="text-muted small">{{ $productWithPricing->product->inco->nv_sat_fat_g }} g</span>
</td>
</tr>
<tr>
<th class="text-dark ps-3" scope="row">
{{ __('Carbohydrates') }}<br>
<span class="fw-normal text-muted small ps-2">&bull; {{ __('of which sugars') }}</span>
</th>
<td class="text-center">
{{ $productWithPricing->product->inco->nv_carb_g }} g<br>
<span class="text-muted small">{{ $productWithPricing->product->inco->nv_sugar_g }} g</span>
</td>
</tr>
<tr>
<th class="text-dark ps-3" scope="row">{{ __('Dietary fiber') }}</th>
<td class="text-center">{{ $productWithPricing->product->inco->nv_fiber_g }} g</td>
</tr>
<tr>
<th class="text-dark ps-3" scope="row">{{ __('Proteins') }}</th>
<td class="fw-semibold text-center">{{ $productWithPricing->product->inco->nv_protein_g }} g</td>
</tr>
<tr>
<th class="text-dark ps-3" scope="row">{{ __('Salt') }}</th>
<td class="fw-bold text-danger text-center">{{ $productWithPricing->product->inco->nv_salt_g }} g</td>
</tr>
</tbody>
</table>
<div class="border-top p-3">
<p class="fst-italic text-muted small m-0">
*{{ __('Reference Daily Intakes for an adult (8400kj/2000kcal).') }}
</p>
</div>
</div>
</div>
</div>
@endif
</div>

View file

@ -33,51 +33,4 @@
alt="{{ __('Nutriscore') }} {{ Str::upper($productWithPricing->product->inco->nutriscore->label()) }}">
</div>
@endif
<div
class="bg-light rounded-4 d-flex justify-content-between align-items-center mb-md-3 ps-md-3 fixed-bottom position-md-relative z-4 z-md-0 border-1 border-top-primary border p-3 ps-5 shadow-sm">
<div class="ms-md-0 ms-3">
<p class="text-muted small m-0">
@if ($productWithPricing->product->weight_variable)
{{ __('About') }}*
@endif
</p>
<p class="m-0">
<span class="@if ($productWithPricing->product->validDiscount?->is_old_price_displayed) text-danger @else text-dark @endif fw-bold h3 align-middle">
<span class="visually-hidden">{{ __('Current price') }}&nbsp;:&nbsp;</span>
@include('fo.modules.guarded-currency', [
'money' => $productWithPricing->pricing->hasDiscount ?
$productWithPricing->pricing->discountedPriceTtc() : $productWithPricing->pricing->basePriceTtc(),
'product' => $productWithPricing->product,
])
</span>
@if ($productWithPricing->product->validDiscount?->is_old_price_displayed)
<span class="text-muted text-decoration-line-through small ms-2 align-middle">
<span class="visually-hidden">{{ __('Original price') }}&nbsp;:&nbsp;</span>
@include('fo.modules.guarded-currency', [
'money' => $productWithPricing->pricing->basePriceTtc(),
'product' => $productWithPricing->product,
])
</span>
@endif
<span class="text-lowercase text-muted small align-middle">/{{ $productWithPricing->product->sell_unit->label() }}</span>
</p>
<p class="small fst-italic text-muted">
<span>{{ $productWithPricing->product->weight_variable ? __('Product sold by the kilo') : __('Price per kilo') }}</span> :
@include('fo.modules.guarded-currency', [
'money' => $productWithPricing->pricing->priceKgTtc(),
'product' => $productWithPricing->product
])
<span>/kg</span>
</p>
</div>
<div>
@can('addToBasket', $productWithPricing->product)
<div class="basket-buttons" data-json='@json(['id' => $productWithPricing->product->id])'></div>
@endcan
</div>
</div>
</div>

View file

@ -0,0 +1,47 @@
<div
class="bg-light rounded-4 d-flex justify-content-between align-items-center mb-md-3 ps-md-3 fixed-bottom position-md-relative z-4 z-md-0 border-1 border-top-primary border p-3 ps-5 shadow-sm">
<div class="ms-md-0 ms-3">
<p class="text-muted small m-0">
@if ($productWithPricing->product->weight_variable)
{{ __('About') }}*
@endif
</p>
<p class="m-0">
<span class="@if ($productWithPricing->product->validDiscount?->is_old_price_displayed) text-danger @else text-dark @endif fw-bold h3 align-middle">
<span class="visually-hidden">{{ __('Current price') }}&nbsp;:&nbsp;</span>
@include('fo.modules.guarded-currency', [
'money' => $productWithPricing->pricing->hasDiscount
? $productWithPricing->pricing->discountedPriceTtc()
: $productWithPricing->pricing->basePriceTtc(),
'product' => $productWithPricing->product,
])
</span>
@if ($productWithPricing->product->validDiscount?->is_old_price_displayed)
<span class="text-muted text-decoration-line-through small ms-2 align-middle">
<span class="visually-hidden">{{ __('Original price') }}&nbsp;:&nbsp;</span>
@include('fo.modules.guarded-currency', [
'money' => $productWithPricing->pricing->basePriceTtc(),
'product' => $productWithPricing->product,
])
</span>
@endif
<span class="text-lowercase text-muted small align-middle">/{{ $productWithPricing->product->sell_unit->label() }}</span>
</p>
<p class="small fst-italic text-muted">
<span>{{ $productWithPricing->product->weight_variable ? __('Product sold by the kilo') : __('Price per kilo') }}</span> :
@include('fo.modules.guarded-currency', [
'money' => $productWithPricing->pricing->priceKgTtc(),
'product' => $productWithPricing->product,
])
<span>/kg</span>
</p>
</div>
@can('addToBasket', $productWithPricing->product)
<div>
<div class="basket-buttons" data-json='@json(['id' => $productWithPricing->product->id])'></div>
</div>
@endcan
</div>

View file

@ -17,14 +17,21 @@
@include('fo.pages.products.show-info', compact('productWithPricing'))
</section>
<aside class="col-12 col-lg-3 align-self-start sticky-lg-top-navbar @unlessorderable($productWithPricing->product) opacity-75 @endorderable" aria-label="{{ __('Product details') }}">
@include('fo.pages.products.show-details', compact('productWithPricing'))
</aside>
<div class="col-12 col-lg-3 align-self-start sticky-lg-top-navbar">
@include('fo.pages.products.show-price-info', compact('productWithPricing'))
@if (!empty($productWithPricing->product->inco->nv_kj))
<aside class="@unlessorderable($productWithPricing->product) opacity-75 @endorderable" aria-label="{{ __('Product details') }}">
@include('fo.pages.products.show-details', compact('productWithPricing'))
</aside>
@endif
</div>
</article>
@if (!empty($associatedProducts))
<div class="col-12 position-relative mt-5">
<div class="associated-products" data-json='@json($associatedProducts)'></div>
</div> @endif
</main>
</div>
@endif
</main>
@endsection

View file

@ -60,11 +60,12 @@
</div>
<div class="d-flex justify-content-between mt-5">
<a class="btn btn-outline-secondary rounded-5 text-uppercase fw-bold px-4" href="{{ route('fo.sales.pick-time-slot') }}">
{{ __('Back') }}
<a class="btn btn-outline-secondary rounded-5 text-uppercase fw-bold me-3 ms-auto px-4"
href="{{ route('fo.sales.pick-time-slot') }}">
<i class="fas fa-chevron-left me-2"></i> {{ __('Back') }}
</a>
<button class="btn btn-primary rounded-5 text-uppercase fw-bold px-4" type="submit">
{{ __('Confirm order') }}
<i class="fas fa-cash-register me-2"></i> {{ __('Confirm order') }}
</button>
</div>
</form>

View file

@ -83,7 +83,8 @@
</div>
<div class="d-flex justify-content-between align-items-center w-100 flex-column flex-md-row mt-4 gap-3">
<a class="btn btn-outline-secondary w-100 w-md-auto text-uppercase fw-bold rounded-4" href="{{ route('fo.sales.summary') }}">
<a class="btn btn-outline-secondary w-100 w-md-auto text-uppercase fw-bold rounded-4 me-3 ms-auto"
href="{{ route('fo.sales.summary') }}">
<i class="fas fa-chevron-left me-2"></i> {{ __('Back to basket') }}
</a>