2 Commits

Author SHA1 Message Date
Valentin Lab
6fee40c55c new: make all forms have a cancel/save button on the top also 2025-12-13 21:17:07 +01:00
Valentin Lab
f5d21fe083 fix: prevent error 500 upon displaying empty 'Rayons' 2025-12-13 21:05:08 +01:00
4 changed files with 49 additions and 8 deletions

View File

@@ -178,10 +178,18 @@ class Articles
$articles = self::getArticlesWithOffers($options);
$searchOrder = $options['ids'] ?? false ? array_flip($options['ids']->toArray()) : false;
foreach ($articles as $article) {
// Skip articles without an offer/tariff/price list for the resolved sale channel
if (!isset($article->offers[0]) || ! $article->offers[0]->tariff) {
continue;
}
$price_lists = $article->offers[0]->tariff->price_lists->toArray();
if (! count($price_lists)) {
continue;
}
if (empty($price_lists[0]['price_list_values'][0] ?? null)) {
continue;
}
if (! is_array($data[$article->name] ?? false)) {
$data[$article->name] = self::getDataForSale($article);
if ($searchOrder) {

View File

@@ -112,3 +112,17 @@ body {
.bg-darker {
background-color: rgba(0,0,0,0.05)!important;
}
/* Header action buttons aligned with page title */
.content-header .form-buttons {
margin-left: 12px;
}
.content-header .form-buttons .btn {
height: 32px;
display: inline-flex;
align-items: center;
padding-top: 4px;
padding-bottom: 4px;
line-height: 1.1;
}

View File

@@ -1,7 +1,23 @@
@php
$cancelUrl = $cancel_url ?? $cancelUrl ?? null;
@endphp
@push('header-actions')
<div class="form-buttons d-flex align-items-center ml-3">
@include('components.form.buttons.button-cancel', [
'class' => 'btn-sm mr-2',
'url' => $cancelUrl,
])
@include('components.form.buttons.button-save', [
'class' => 'btn-sm',
])
</div>
@endpush
<div class="row pt-0 pb-3">
<div class="col-12">
<div class="text-right form-buttons">
@include('components.form.buttons.button-cancel')
@include('components.form.buttons.button-cancel', ['url' => $cancelUrl])
@include('components.form.buttons.button-save')
</div>
</div>

View File

@@ -1,13 +1,16 @@
<div class="content-header pt-2 pb-1">
<div class="container-fluid">
<div class="row mb-2 align-items-end">
<div class="row mb-2 align-items-center">
<div class="col-sm-6">
<h1 class="m-0 text-dark">
{{ $title ?? null}}
@isset($subtitle)
<small class="font-weight-light ml-1 text-md">{{ $subtitle }}</small>
@endisset
</h1>
<div class="d-flex align-items-center flex-wrap">
<h1 class="m-0 text-dark d-flex align-items-center">
{{ $title ?? null}}
@isset($subtitle)
<small class="font-weight-light ml-1 text-md">{{ $subtitle }}</small>
@endisset
</h1>
@stack('header-actions')
</div>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right text-sm">