Fixed some requests from the provided excel document
This commit is contained in:
parent
97623ce240
commit
8a3058e7bc
28 changed files with 283 additions and 210 deletions
|
|
@ -312,20 +312,20 @@ class ProductController extends Controller
|
|||
public function checkGencode(Request $request)
|
||||
{
|
||||
if (
|
||||
isset($request->GENCODE) &&
|
||||
$request->GENCODE !== null &&
|
||||
ctype_digit($request->GENCODE) &&
|
||||
strlen($request->GENCODE) > 0
|
||||
isset($request->GENCOD) &&
|
||||
$request->GENCOD !== null &&
|
||||
ctype_digit($request->GENCOD) &&
|
||||
strlen($request->GENCOD) > 0
|
||||
) {
|
||||
if (
|
||||
isset($request->ID) &&
|
||||
$request->ID !== null &&
|
||||
intval($request->GENCODE) === Product::where('id', $request->ID)->firstOrFail()->gencod
|
||||
intval($request->GENCOD) === Product::where('id', $request->ID)->firstOrFail()->gencod
|
||||
) {
|
||||
$result = null;
|
||||
} else {
|
||||
$result = in_array(intval($request->GENCODE), Product::pluck('gencod')->toArray()) ?
|
||||
Product::orderBy('created_at', 'desc')->where('gencod', intval($request->GENCODE))->first() : null;
|
||||
$result = in_array(intval($request->GENCOD), Product::pluck('gencod')->toArray()) ?
|
||||
Product::orderBy('created_at', 'desc')->where('gencod', intval($request->GENCOD))->first() : null;
|
||||
}
|
||||
} else {
|
||||
$result = null;
|
||||
|
|
|
|||
|
|
@ -44,6 +44,9 @@ class StoreProductRequest extends FormRequest
|
|||
'is_tasted' => $this->is_tasted ? true : false,
|
||||
'origins' => $this->origins ? $this->origins : [],
|
||||
'claims' => $this->claims ? $this->claims : [],
|
||||
'picture_alt' => $this->name,
|
||||
'picture_title' => $this->name,
|
||||
'certification' => $this->certification == 0 ? null : $this->certification,
|
||||
]);
|
||||
$this->mergePicture('picture');
|
||||
$this->mergeDocuments('docs');
|
||||
|
|
@ -88,7 +91,7 @@ class StoreProductRequest extends FormRequest
|
|||
'product_range' => ['required', new Enum(RangeEnum::class)],
|
||||
'geo_area' => ['required', new Enum(GeoAreaEnum::class)],
|
||||
'weight' => 'nullable|integer',
|
||||
'pvc' => 'nullable|integer',
|
||||
'pvc' => 'nullable|decimal:0,2',
|
||||
'comment' => 'nullable|string|min:15',
|
||||
'is_tasted' => 'required|boolean',
|
||||
'tasters_number' => 'nullable|integer',
|
||||
|
|
|
|||
|
|
@ -170,6 +170,7 @@ class Product extends Model
|
|||
*/
|
||||
private static function updateSpecifiedClaim(Product $model)
|
||||
{
|
||||
$check = false;
|
||||
foreach ($model->claims as $claim) {
|
||||
$check = (intval($claim['id']) === \App\Enums\Products\ClaimEnum::others->value) ? true : false;
|
||||
}
|
||||
|
|
@ -212,14 +213,16 @@ class Product extends Model
|
|||
*/
|
||||
public static function deleteOldDocuments(self $model)
|
||||
{
|
||||
foreach ($model->getOriginal('docs') as $document) {
|
||||
$originalPath = \ltrim(\urldecode($document), '/');
|
||||
if (\strpos($originalPath, 'storage') !== 0) {
|
||||
return;
|
||||
}
|
||||
$originalPath = ToolboxHelper::mbReplace('storage/', '', $originalPath);
|
||||
if (Storage::disk('public')->exists($originalPath)) {
|
||||
Storage::disk('public')->delete($originalPath);
|
||||
if ($model->getOriginal('docs')) {
|
||||
foreach ($model->getOriginal('docs') as $document) {
|
||||
$originalPath = \ltrim(\urldecode($document), '/');
|
||||
if (\strpos($originalPath, 'storage') !== 0) {
|
||||
return;
|
||||
}
|
||||
$originalPath = ToolboxHelper::mbReplace('storage/', '', $originalPath);
|
||||
if (Storage::disk('public')->exists($originalPath)) {
|
||||
Storage::disk('public')->delete($originalPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$table->decimal('pvc', 12, 2)->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$table->integer('pvc')->change();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
return [
|
||||
'classes' => [
|
||||
'products' => 'Produits',
|
||||
'products_monitoring' => 'Veille produit|Veilles produit',
|
||||
'brands' => 'Marques',
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -3,7 +3,9 @@
|
|||
}
|
||||
|
||||
.bo-image-preview {
|
||||
max-height: 60px;
|
||||
// max-height: 60px;
|
||||
width: 180px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.text-ellipsis {
|
||||
|
|
|
|||
|
|
@ -13,17 +13,19 @@
|
|||
</template>
|
||||
<template v-else>
|
||||
<FontAwesomeIcon icon="fa-solid fa-plus" />
|
||||
|
||||
<FontAwesomeIcon icon="fa-solid fa-file-pdf" />
|
||||
</template>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
import trans from "./../modules/trans";
|
||||
import route from "./../modules/route";
|
||||
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
|
||||
import Tooltip from "bootstrap/js/dist/tooltip";
|
||||
import { defineComponent } from "vue";
|
||||
import route from "./../modules/route";
|
||||
import trans from "./../modules/trans";
|
||||
|
||||
export default defineComponent({
|
||||
mixins: [trans, route],
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@
|
|||
</label>
|
||||
<img
|
||||
v-if="intValue"
|
||||
class="img-fluid"
|
||||
class="img-fluid img-preview"
|
||||
:src="intValue"
|
||||
:alt="__('Image placeholder')"
|
||||
:aria-describedby="`PreviewHelp${intId}`"
|
||||
|
|
@ -400,10 +400,10 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
|
||||
import Cropper from "cropperjs";
|
||||
import { Tooltip } from "bootstrap";
|
||||
import Cropper from "cropperjs";
|
||||
import { defineComponent } from "vue";
|
||||
import trans from "./../modules/trans";
|
||||
|
||||
const UNITS = [
|
||||
|
|
@ -952,6 +952,10 @@ export default defineComponent({
|
|||
transform: translateX(-50%) translateY(-50%);
|
||||
}
|
||||
}
|
||||
.img-preview {
|
||||
width: 180px;
|
||||
height: auto;
|
||||
}
|
||||
.right-aligned {
|
||||
overflow: hidden !important;
|
||||
direction: ltr !important;
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
class="col-form-label"
|
||||
for="commentEvaluation"
|
||||
>
|
||||
<b>{{ __("Évaluation du produit") }} *</b>
|
||||
<b>{{ __("Appréciation globale") }} *</b>
|
||||
</label>
|
||||
<InputTextAutoComponent
|
||||
:id="'commentEvaluation' + commentIndex"
|
||||
|
|
@ -77,7 +77,7 @@
|
|||
>
|
||||
{{
|
||||
__(
|
||||
"Doit détailler l'évaluation du produit (3 caractères minimum, 255 maximum)."
|
||||
"Doit détailler l'appéciation globale (3 caractères minimum, 255 maximum)."
|
||||
)
|
||||
}}
|
||||
</small>
|
||||
|
|
@ -227,9 +227,9 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
import InputTextAutoComponent from "./InputTextAutoComponent.vue";
|
||||
import parseLaravelErrorMessages from "../modules/parseLaravelErrorMessages";
|
||||
import trans from "../modules/trans";
|
||||
import InputTextAutoComponent from "./InputTextAutoComponent.vue";
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
|
|
|
|||
|
|
@ -44,19 +44,6 @@
|
|||
:disabled="intValues.length >= intItemLimit[1]"
|
||||
readonly
|
||||
>
|
||||
<button
|
||||
class="btn btn-primary btn-collapse collapsed"
|
||||
type="button"
|
||||
:title="__('Rouler/Dérouler la liste des documents')"
|
||||
data-bs-tooltip="tooltip"
|
||||
data-bs-toggle="collapse"
|
||||
data-bs-target="#multiple-documents"
|
||||
aria-expanded="false"
|
||||
aria-controls="multiple-documents"
|
||||
:disabled="!intHasDocuments"
|
||||
>
|
||||
<i class="fa fa-arrow-down" />
|
||||
</button>
|
||||
<button
|
||||
v-if="intValues.length > intItemLimit[0]"
|
||||
@click.prevent="removeFiles"
|
||||
|
|
@ -72,9 +59,8 @@
|
|||
</div>
|
||||
</div>
|
||||
<!-- End main buttons -->
|
||||
<!-- Content collapse -->
|
||||
<!-- Documents list -->
|
||||
<div
|
||||
class="collapse"
|
||||
id="multiple-documents"
|
||||
>
|
||||
<div class="row w-100 mx-auto my-2">
|
||||
|
|
@ -211,7 +197,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End content collapse -->
|
||||
<!-- End documents list -->
|
||||
<small
|
||||
:id="`Help${intId}`"
|
||||
class="form-text text-muted"
|
||||
|
|
@ -222,8 +208,8 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
import { Tooltip } from "bootstrap";
|
||||
import { defineComponent } from "vue";
|
||||
import error from "./../modules/parseLaravelErrorMessages";
|
||||
import trans from "./../modules/trans";
|
||||
|
||||
|
|
@ -249,7 +235,6 @@ export default defineComponent({
|
|||
intValues: string[];
|
||||
intHelper: string;
|
||||
intTooltipList: HTMLButtonElement[];
|
||||
intBtnCollapse: HTMLButtonElement | null;
|
||||
intLoopLoadDocuments: number;
|
||||
intViewerLoadDocument: boolean;
|
||||
intInputDocuments: HTMLInputElement[];
|
||||
|
|
@ -265,7 +250,6 @@ export default defineComponent({
|
|||
intOriginalFileName: [],
|
||||
intValues: [],
|
||||
intHelper: "",
|
||||
intBtnCollapse: null,
|
||||
intTooltipList: [],
|
||||
intLoopLoadDocuments: 0,
|
||||
intViewerLoadDocument: false,
|
||||
|
|
@ -294,9 +278,6 @@ export default defineComponent({
|
|||
*/
|
||||
initComponent() {
|
||||
if (this.intValues.length > 0) {
|
||||
this.intBtnCollapse = document.querySelector(
|
||||
"[data-bs-target=\"#multiple-documents\"]"
|
||||
);
|
||||
this.intValues.forEach((element, index) => {
|
||||
element.charAt(0) != "/" ? "/".concat(element) : "";
|
||||
this.intValues.splice(index, 1, element.replace(/^\/|^/, "/"));
|
||||
|
|
@ -462,9 +443,6 @@ export default defineComponent({
|
|||
this.intLoopLoadDocuments = this.intValues.length;
|
||||
this.loadDocuments([].slice.call(el.files));
|
||||
this.intHasDocuments = true;
|
||||
if (this.intBtnCollapse?.classList.contains("collapsed")) {
|
||||
this.intBtnCollapse?.click();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Update inputs file.
|
||||
|
|
|
|||
|
|
@ -12,13 +12,17 @@
|
|||
class="form-select source-select"
|
||||
:name="intName"
|
||||
:aria-describedby="`${intId}Help`"
|
||||
@change="setSelectedValue()"
|
||||
@change="setSelectedValue(0)"
|
||||
>
|
||||
<option
|
||||
:value="null"
|
||||
:selected="intSelectedValue === 0"
|
||||
/>
|
||||
<option
|
||||
v-for="(itemEnum, indexEnum) in intSourceEnum"
|
||||
:key="indexEnum"
|
||||
:value="itemEnum.value"
|
||||
:selected="itemEnum.value === intModel?.source"
|
||||
:selected="itemEnum.value === intModel?.source || itemEnum.value === intSelectedValue "
|
||||
>
|
||||
{{ itemEnum.label }}
|
||||
</option>
|
||||
|
|
@ -40,9 +44,9 @@
|
|||
class="form-control"
|
||||
name="catalogue"
|
||||
type="text"
|
||||
placeholder="Nom du catalogue"
|
||||
placeholder=""
|
||||
list="productsCatalog"
|
||||
:value="intModel?.catalogue"
|
||||
:value="intModel?.catalogue ?? intOldDetails"
|
||||
>
|
||||
<datalist id="productsCatalog">
|
||||
<option
|
||||
|
|
@ -75,9 +79,9 @@
|
|||
class="form-control"
|
||||
name="shop"
|
||||
type="text"
|
||||
placeholder="Nom du magasin"
|
||||
placeholder=""
|
||||
list="productsShop"
|
||||
:value="intModel?.shop"
|
||||
:value="intModel?.shop ?? intOldDetails"
|
||||
>
|
||||
<datalist id="productsShop">
|
||||
<option
|
||||
|
|
@ -110,9 +114,9 @@
|
|||
class="form-control"
|
||||
name="fair"
|
||||
type="text"
|
||||
placeholder="Nom du salon"
|
||||
placeholder=""
|
||||
list="productsFair"
|
||||
:value="intModel?.fair"
|
||||
:value="intModel?.fair ?? intOldDetails"
|
||||
>
|
||||
<datalist id="productsFair">
|
||||
<option
|
||||
|
|
@ -151,7 +155,9 @@ export default defineComponent({
|
|||
this.intProductsCatalog = data.productsCatalog;
|
||||
this.intSourceEnum = data.sourceEnum;
|
||||
this.intHelper = data.helper;
|
||||
this.setSelectedValue();
|
||||
this.intSelectedValue = data.oldValue;
|
||||
this.intOldDetails = data.oldDetails;
|
||||
this.setSelectedValue(data.oldValue);
|
||||
},
|
||||
data(): {
|
||||
intId: string;
|
||||
|
|
@ -167,6 +173,7 @@ export default defineComponent({
|
|||
intSourceMagazin: boolean;
|
||||
intSourceShow: boolean;
|
||||
intHelper: string;
|
||||
intOldDetails: string;
|
||||
} {
|
||||
return {
|
||||
intId: "",
|
||||
|
|
@ -182,18 +189,20 @@ export default defineComponent({
|
|||
intSourceMagazin: false,
|
||||
intSourceShow: false,
|
||||
intHelper: "",
|
||||
intOldDetails: "",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* Set selected source variables.
|
||||
*/
|
||||
setSelectedValue() {
|
||||
setSelectedValue(oldValue: number) {
|
||||
this.$nextTick(() => {
|
||||
const select = document.querySelector(
|
||||
".source-select"
|
||||
) as HTMLSelectElement;
|
||||
this.intSelectedValue = Number(select.value);
|
||||
this.intSelectedValue = isNaN(Number(select.value)) ? Number(oldValue) : Number(select.value) ;
|
||||
console.log("là", this.intSelectedValue);
|
||||
this.updateVue();
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<b>{{ intLabel1 }} {{ intRequired1 ? "*" : "" }}</b>
|
||||
</label>
|
||||
<input
|
||||
@click="updateBoolean()"
|
||||
@click="updateBoolean(null)"
|
||||
class="form-check-input"
|
||||
:name="intName1"
|
||||
type="checkbox"
|
||||
|
|
@ -75,8 +75,8 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
import MultipleCommentsComponent from "./MultipleCommentsComponent.vue";
|
||||
import trans from "../modules/trans";
|
||||
import MultipleCommentsComponent from "./MultipleCommentsComponent.vue";
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
|
|
@ -149,7 +149,9 @@ export default defineComponent({
|
|||
? this.intOldModel[this.intName1]
|
||||
: false
|
||||
) {
|
||||
this.updateBoolean();
|
||||
this.updateBoolean(data.oldCheck);
|
||||
} else {
|
||||
this.intIsTasted = data.oldCheck;
|
||||
}
|
||||
this.intCommentModel =
|
||||
data.commentOldModel.length > 0
|
||||
|
|
@ -158,7 +160,8 @@ export default defineComponent({
|
|||
this.intAllErrors = data.errors;
|
||||
},
|
||||
methods: {
|
||||
updateBoolean() {
|
||||
updateBoolean(test:any) {
|
||||
console.log(test);
|
||||
this.intIsTasted = this.intIsTasted ? false : true;
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
:name="intName"
|
||||
type="text"
|
||||
:value="intValue"
|
||||
:placeholder="__('112233445566')"
|
||||
placeholder=""
|
||||
class="form-control input-gencode"
|
||||
:class="[
|
||||
intResult != undefined ? [intResult ? 'is-invalid' : 'is-valid'] : '',
|
||||
|
|
@ -43,9 +43,9 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
import { Tooltip } from "bootstrap";
|
||||
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
|
||||
import { Tooltip } from "bootstrap";
|
||||
import { defineComponent } from "vue";
|
||||
import route from "./../modules/route";
|
||||
import trans from "./../modules/trans";
|
||||
|
||||
|
|
@ -161,7 +161,7 @@ export default defineComponent({
|
|||
this.intCode = inputCode.value;
|
||||
window.axios
|
||||
.post(this.getRouteProductGencode(), {
|
||||
GENCODE: this.intCode,
|
||||
GENCOD: this.intCode,
|
||||
ID: this.intModel?.id,
|
||||
})
|
||||
.then((reponse) => {
|
||||
|
|
|
|||
|
|
@ -1,42 +1,43 @@
|
|||
import { dom, library, config } from "~/@fortawesome/fontawesome-svg-core";
|
||||
import { config, dom, library } from "~/@fortawesome/fontawesome-svg-core";
|
||||
import {
|
||||
faEraser,
|
||||
faArrowLeftLong,
|
||||
faPlus,
|
||||
faMinus,
|
||||
faTrash,
|
||||
faEye,
|
||||
faFolderOpen,
|
||||
faCrop,
|
||||
faQuestionCircle,
|
||||
faCheck,
|
||||
faUndoAlt,
|
||||
faRedoAlt,
|
||||
faSyncAlt,
|
||||
faSearchPlus,
|
||||
faSearchMinus,
|
||||
faArrowLeft,
|
||||
faArrowRight,
|
||||
faArrowUp,
|
||||
faArrowDown,
|
||||
faArrowsAltH,
|
||||
faArrowsAltV,
|
||||
faWandMagic,
|
||||
faPencil,
|
||||
faTimes,
|
||||
faBackspace,
|
||||
faSearch,
|
||||
faArrowRightFromBracket,
|
||||
faArrowAltCircleDown,
|
||||
faArrowAltCircleUp,
|
||||
faQuestion,
|
||||
faXmark,
|
||||
faArrowDown,
|
||||
faArrowLeft,
|
||||
faArrowLeftLong,
|
||||
faArrowRight,
|
||||
faArrowRightFromBracket,
|
||||
faArrowUp,
|
||||
faArrowsAltH,
|
||||
faArrowsAltV,
|
||||
faBackspace,
|
||||
faCheck,
|
||||
faCopy,
|
||||
faFile,
|
||||
faLink,
|
||||
faPrint,
|
||||
faImage,
|
||||
faCrop,
|
||||
faDownload,
|
||||
faEraser,
|
||||
faEye,
|
||||
faFile,
|
||||
faFilePdf,
|
||||
faFolderOpen,
|
||||
faImage,
|
||||
faLink,
|
||||
faMinus,
|
||||
faPencil,
|
||||
faPlus,
|
||||
faPrint,
|
||||
faQuestion,
|
||||
faQuestionCircle,
|
||||
faRedoAlt,
|
||||
faSearch,
|
||||
faSearchMinus,
|
||||
faSearchPlus,
|
||||
faSyncAlt,
|
||||
faTimes,
|
||||
faTrash,
|
||||
faUndoAlt,
|
||||
faWandMagic,
|
||||
faXmark,
|
||||
} from "~/@fortawesome/free-solid-svg-icons";
|
||||
|
||||
config.autoReplaceSvg = false;
|
||||
|
|
@ -77,5 +78,6 @@ library.add(faLink);
|
|||
library.add(faPrint);
|
||||
library.add(faImage);
|
||||
library.add(faDownload);
|
||||
library.add(faFilePdf);
|
||||
|
||||
dom.watch();
|
||||
|
|
|
|||
|
|
@ -5,12 +5,14 @@
|
|||
{{-- CONTENT --}}
|
||||
<table width="100%">
|
||||
<tr>
|
||||
@if (isset($product->picture) && !empty($product->picture))
|
||||
<td class="table-cell-text-center" width="30%">
|
||||
@if (isset($product->picture))
|
||||
<img src="{{ public_path($product->picture) }}" alt="{{ $product->picture_alt }}" alt="{{ $product->picture_title }}">
|
||||
@endif
|
||||
</td>
|
||||
<td width="70%">
|
||||
@else
|
||||
<td width="100%">
|
||||
@endif
|
||||
@if (isset($product->brand_id->name))
|
||||
<h2><strong>{{ __('Marque du produit : ') }}</strong><span>{{ $product->brand_id->name }}</span></h2>
|
||||
@endif
|
||||
|
|
@ -21,10 +23,10 @@
|
|||
<p><strong>{{ __('Certification : ') }}</strong>{{ $product->certification }}</p>
|
||||
@endif
|
||||
@if (isset($product->origins))
|
||||
<p><strong>{{ __('Origines : ') }}</strong>{{ $product->origins }}</p>
|
||||
<p><strong>{{ __('Origines : ') }}</strong>{{ Str::replaceLast(', ', '', $product->origins) }}</p>
|
||||
@endif
|
||||
@if (isset($product->claims))
|
||||
<p><strong>{{ __('Allégations : ') }}</strong>{{ $product->claims }}</p>
|
||||
<p><strong>{{ __('Allégations : ') }}</strong>{{ Str::replaceLast(', ', '', $product->claims) }}</p>
|
||||
@endif
|
||||
<table class="table" width="100%">
|
||||
<tr class="table-header">
|
||||
|
|
@ -49,11 +51,14 @@
|
|||
@if (isset($product->pvc))
|
||||
<td class="table-cell-text-center">{{ $product->pvc }}€</td>
|
||||
@endif
|
||||
<td class="table-cell-text-center">--,--€</td>
|
||||
@php
|
||||
$priceKg = 1000 * $product->pvc / $product->weight;
|
||||
@endphp
|
||||
<td class="table-cell-text-center">{{ number_format(round($priceKg, 2), 2, ',', ' ') }}€</td>
|
||||
</tr>
|
||||
</table>
|
||||
@if (isset($product->productKeywords))
|
||||
<p><strong>{{ __('Tendances identifiées : ') }}</strong>{{ $product->productKeywords }}</p>
|
||||
<p><strong>{{ __('Tendances identifiées : ') }}</strong>{{ Str::replaceLast(', ', '', $product->productKeywords) }}</p>
|
||||
@endif
|
||||
@if (isset($product->distribution_network))
|
||||
<p><strong>{{ __('Réseau de distribution : ') }}</strong>{{ $product->distribution_network }}</p>
|
||||
|
|
@ -103,7 +108,7 @@
|
|||
</td>
|
||||
@endif
|
||||
@if (isset($product->source))
|
||||
<td class="table-cell-text-center" width="50%">
|
||||
<td class="table-cell-text-start" width="50%">
|
||||
<p><strong>{{ __('Vu le : ') }}</strong>{{ $product->saw_at }}</p>
|
||||
<p><strong>{{ __('Lieu : ') }}</strong>{{ $product->source }}, {{ $product->fair }}{{ $product->shop }}{{ $product->catalogue }}</p>
|
||||
<p><strong>{{ __('Par : ') }}</strong>{{ $product->user_id->firstname }} {{ $product->user_id->lastname }}</p>
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@
|
|||
|
||||
h2 {
|
||||
font-weight: lighter;
|
||||
text-transform: uppercase;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
|
|
@ -61,11 +60,11 @@
|
|||
}
|
||||
|
||||
.table-header {
|
||||
background-color: black;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.table-header td {
|
||||
color: white;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.table-body td {
|
||||
|
|
@ -75,6 +74,10 @@
|
|||
.table-cell-text-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.table-cell-text-start {
|
||||
text-align: start;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
|
|
|||
|
|
@ -15,10 +15,10 @@
|
|||
<li>
|
||||
<a class="dropdown-item @if(request()->routeIs('products.*')) active @endif"
|
||||
href="{{ route('products.index') }}"
|
||||
title="{{ __('Administrer les :model', ['model' => __('models.classes.products')]) }}"
|
||||
title="{{ __('Administrer les :model', ['model' => trans_choice('models.classes.products_monitoring', 2)]) }}"
|
||||
data-bs="tooltip"
|
||||
data-bs-placement="right">
|
||||
{{ __('models.classes.products') }}
|
||||
{{ trans_choice('models.classes.products_monitoring', 2) }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ $ignore = (isset($ignore) and is_array($ignore)) ? $ignore : [];
|
|||
@endphp
|
||||
{{-- NO Sort for order column --}}
|
||||
@if($col === 'order' or in_array($col, $ignore))
|
||||
@if(!$noOrder or $rst)
|
||||
@if ($col === 'multi_pdf')
|
||||
<th scope="col" class="text-center @if(isset($mobileHide) and is_array($mobileHide) and in_array($col, $mobileHide)) d-none d-md-table-cell @endif">
|
||||
<span>{{ $colname }}</span>
|
||||
|
|
@ -35,7 +34,6 @@ $ignore = (isset($ignore) and is_array($ignore)) ? $ignore : [];
|
|||
<span>{{ $colname }}</span>
|
||||
</th>
|
||||
@endif
|
||||
@endif
|
||||
@continue
|
||||
@endif
|
||||
<th scope="col" class="text-center @if(isset($mobileHide) and is_array($mobileHide) and in_array($col, $mobileHide)) d-none d-md-table-cell @endif">
|
||||
|
|
|
|||
|
|
@ -16,14 +16,14 @@
|
|||
<div class="card-body">
|
||||
<div class="d-flex flex-column flex-lg-row justify-content-between align-items-center">
|
||||
<div class="text-center text-lg-start pb-2 p-lg-0">
|
||||
<h5 class="card-title">{{ __('models.classes.products') }}</h5>
|
||||
<h5 class="card-title">{{ trans_choice('models.classes.products_monitoring', 2) }}</h5>
|
||||
<p class="card-text text-muted fst-italic">{{ __('- accéder à l\'ensemble des produits enregistrés') }}</p>
|
||||
</div>
|
||||
<a href="{{ route('products.index') }}"
|
||||
class="btn btn-primary"
|
||||
title="{{ __('Accéder à la liste des :model', ['model' => __('models.classes.products')]) }}"
|
||||
title="{{ __('Accéder à la liste des :model', ['model' => trans_choice('models.classes.products_monitoring', 2)]) }}"
|
||||
data-bs="tooltip">
|
||||
{{ __('Voir la liste') }}
|
||||
{{ __('Consulter/Insérer une :model', ['model' => trans_choice('models.classes.products_monitoring', 1)]) }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
@extends('layout')
|
||||
|
||||
@section('title', sprintf('%s - %s', __('models.classes.products'), Str::ucfirst(__('création'))))
|
||||
@section('title', sprintf('%s - %s', trans_choice('models.classes.products_monitoring', 1), Str::ucfirst(__('création'))))
|
||||
@section('description', __('Création d\'un produit'))
|
||||
@section('breadcrumb', 'no')
|
||||
|
||||
|
|
@ -14,17 +14,17 @@
|
|||
class="btn btn-primary text-decoration-none m-0"
|
||||
data-bs="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ __('Retourner sur la liste des :model', ['model' => __('models.classes.products')]) }}"
|
||||
title="{{ __('Retourner sur la liste des :model', ['model' => trans_choice('models.classes.products_monitoring', 2)]) }}"
|
||||
data-bs="tooltip">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
<span class="fw-bold">{{ Str::singular(__('models.classes.products')) }}</span> <small class="text-muted">{{ Str::ucfirst(__('création')) }}</small>
|
||||
<span class="fw-bold">{{ trans_choice('models.classes.products_monitoring', 1) }}</span> <small class="text-muted">{{ Str::ucfirst(__('création')) }}</small>
|
||||
</h1>
|
||||
</div>
|
||||
<div class="col-12 col-md-4 d-flex justify-content-center justify-content-md-end align-items-center">
|
||||
<button id="formSubmitClone"
|
||||
class="btn btn-primary pull-end"
|
||||
title="{{ __('Sauvegarder ce :model', ['model' => Str::singular(__('models.classes.products'))]) }}"
|
||||
class="btn btn-success pull-end"
|
||||
title="{{ __('Sauvegarder cette :model', ['model' => trans_choice('models.classes.products_monitoring', 1)]) }}"
|
||||
data-bs="tooltip">
|
||||
{{ __('Sauvegarder') }}
|
||||
</button>
|
||||
|
|
@ -39,8 +39,8 @@
|
|||
<div class="col text-center">
|
||||
<button id="formSubmit"
|
||||
type="submit"
|
||||
class="btn btn-primary"
|
||||
title="{{ __('Sauvegarder ce :model', ['model' => Str::singular(__('models.classes.products'))]) }}"
|
||||
class="btn btn-success"
|
||||
title="{{ __('Sauvegarder cette :model', ['model' => trans_choice('models.classes.products_monitoring', 1)]) }}"
|
||||
data-bs="tooltip">{{ __('Sauvegarder') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
@extends('layout')
|
||||
|
||||
@section('title', sprintf('%s - %s', __('models.classes.products'), Str::ucfirst(__('édition'))))
|
||||
@section('title', sprintf('%s - %s', trans_choice('models.classes.products_monitoring', 1), Str::ucfirst(__('édition'))))
|
||||
@section('description', __('Édition d\'un produit'))
|
||||
@section('breadcrumb', 'no')
|
||||
|
||||
|
|
@ -14,11 +14,11 @@
|
|||
class="btn btn-primary text-decoration-none m-0"
|
||||
data-bs="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ __('Retourner sur la liste des :model', ['model' => __('models.classes.products')]) }}"
|
||||
title="{{ __('Retourner sur la liste des :model', ['model' => trans_choice('models.classes.products_monitoring', 2)]) }}"
|
||||
data-bs="tooltip">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
<span class="fw-bold">{{ Str::singular(__('models.classes.products')) }}</span> <small class="text-muted">{{ Str::ucfirst(__('édition')) }}</small>
|
||||
<span class="fw-bold">{{ trans_choice('models.classes.products_monitoring', 1) }}</span> <small class="text-muted">{{ Str::ucfirst(__('édition')) }}</small>
|
||||
</h1>
|
||||
</div>
|
||||
<div class="col-12 col-md-4 d-flex justify-content-center justify-content-md-end align-items-center">
|
||||
|
|
@ -28,13 +28,13 @@
|
|||
<div class="btn-group" role="group">
|
||||
<button id="formSubmitClone"
|
||||
type="button"
|
||||
class="btn btn-primary pull-end"
|
||||
title="{{ __('Sauvegarder ce :model', ['model' => Str::singular(__('models.classes.products'))]) }}"
|
||||
class="btn btn-success pull-end"
|
||||
title="{{ __('Sauvegarder cette :model', ['model' => trans_choice('models.classes.products_monitoring', 1)]) }}"
|
||||
data-bs="tooltip">
|
||||
{{ __('Sauvegarder') }}
|
||||
</button>
|
||||
<button class="btn btn-danger"
|
||||
title="{{ __('Supprimer ce :model', ['model' => Str::singular(__('models.classes.products'))]) }}"
|
||||
title="{{ __('Supprimer cette :model', ['model' => trans_choice('models.classes.products_monitoring', 1)]) }}"
|
||||
data-bs="tooltip">
|
||||
<i class="fa-solid fa-trash"></i>
|
||||
</button>
|
||||
|
|
@ -52,8 +52,8 @@
|
|||
<div class="col text-center">
|
||||
<button id="formSubmit"
|
||||
type="submit"
|
||||
class="btn btn-primary"
|
||||
title="{{ __('Sauvegarder ce :model', ['model' => Str::singular(__('models.classes.products'))]) }}"
|
||||
class="btn btn-success"
|
||||
title="{{ __('Sauvegarder cette :model', ['model' => trans_choice('models.classes.products_monitoring', 1)]) }}"
|
||||
data-bs="tooltip">
|
||||
{{ __('Sauvegarder') }}
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -2,16 +2,17 @@
|
|||
{{-- TITLE --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="border h-100 bg-white p-3">
|
||||
<legend>{{ __('Titre') }}</legend>
|
||||
<legend>{{ __('Nom') }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12 mb-3">
|
||||
@include('partials.inputs.varchar', [
|
||||
'id' => 'productName',
|
||||
'label' => __('Titre du :model', ['model' => Str::singular(__('models.classes.products'))]),
|
||||
'label' => __('Nom du :model', ['model' => Str::singular(__('models.classes.products'))]),
|
||||
'hasWordCounter' => true,
|
||||
'name' => 'name',
|
||||
'required' => true,
|
||||
'model' => $productModel ?? null,
|
||||
'placeholder' => '',
|
||||
'helper' => __('Doit décrire précisément le produit (3 caractères minimum, 255 maximum).'),
|
||||
])
|
||||
</div>
|
||||
|
|
@ -30,7 +31,7 @@
|
|||
'name' => 'brand_id',
|
||||
'model' => $productModel ?? null,
|
||||
'associatedModels' => $brands,
|
||||
'helper' => trans('Selectionnez un(e) :model parmis la liste.', ['model' => Str::singular(trans('models.classes.brands'))]),
|
||||
'helper' => trans('Selectionnez un(e) :model parmi la liste.', ['model' => Str::singular(trans('models.classes.brands'))]),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -43,24 +44,26 @@
|
|||
@php
|
||||
$data = [
|
||||
'id' => 'productSource',
|
||||
'label' => __('Source associé(e)'),
|
||||
'label' => __('Source'),
|
||||
'name' => 'source',
|
||||
'model' => $productModel ?? null,
|
||||
'sourceEnum' => \App\Enums\Products\SourceEnum::toArray(),
|
||||
'productsFair' => $productsFair,
|
||||
'productsShop' => $productsShop,
|
||||
'productsCatalog' => $productsCatalog,
|
||||
'helper' => __('Selectionnez un(e) Source maximum parmis la liste.')
|
||||
'oldValue' => old('source') ?? $productModel->source ?? 0,
|
||||
'oldDetails' => old('shop', old('fair', old('catalogue'))) ?? '',
|
||||
'helper' => __('Selectionnez un(e) Source maximum parmi la liste.')
|
||||
];
|
||||
@endphp
|
||||
<div class="source-inputs" data-json='@json($data)'></div>
|
||||
@include('modules.input-error', ['inputName' => 'source'])
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- GENCODE --}}
|
||||
{{-- GENCOD --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="border h-100 bg-white p-3">
|
||||
<legend>{{ __('GENCODE') }}</legend>
|
||||
<legend>{{ __('GENCOD') }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@php
|
||||
|
|
@ -94,7 +97,7 @@
|
|||
'name' => 'url',
|
||||
'required' => false,
|
||||
'model' => $productModel ?? null,
|
||||
'placeholder' => __('https://google.com'),
|
||||
'placeholder' => '',
|
||||
'helper' => __('Doit être une url valide.'),
|
||||
])
|
||||
</div>
|
||||
|
|
@ -104,32 +107,8 @@
|
|||
{{-- IMAGE --}}
|
||||
<div class="col-12 mb-3">
|
||||
<fieldset class="border h-100 bg-white p-3">
|
||||
<legend>{{ __('Image') }}</legend>
|
||||
<legend>{{ __('Visuel de référence') }}</legend>
|
||||
<div class="row">
|
||||
{{-- PICTURE_ALT --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
@include('partials.inputs.varchar', [
|
||||
'id' => 'homePart3PictureAlt',
|
||||
'label' => __('Texte alternatif de :model', ['model' => Str::singular(__('models.classes.products'))]),
|
||||
'hasWordCounter' => true,
|
||||
'name' => 'picture_alt',
|
||||
'required' => true,
|
||||
'model' => $productModel ?? null,
|
||||
'helper' => __('Doit décrire votre image pour les moteurs de recherches et les non voyants (5 à 6 mots, minimum 3 caractères).'),
|
||||
])
|
||||
</div>
|
||||
{{-- PICTURE_TITLE --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
@include('partials.inputs.varchar', [
|
||||
'id' => 'homePart3PictureTitle',
|
||||
'label' => __('Titre de :model', ['model' => Str::singular(__('models.classes.products'))]),
|
||||
'hasWordCounter' => true,
|
||||
'name' => 'picture_title',
|
||||
'required' => true,
|
||||
'model' => $productModel ?? null,
|
||||
'helper' => __('Utile pour les utilisateurs, s\'affiche en passant la souris sur l\'image (minimum 3 caractères).'),
|
||||
])
|
||||
</div>
|
||||
<div class="col-12">
|
||||
@include('partials.inputs.varchar-picture', [
|
||||
'id' => 'productImage',
|
||||
|
|
@ -148,7 +127,7 @@
|
|||
{{-- DOCUMENTS --}}
|
||||
<div class="col-12 mb-3">
|
||||
<fieldset class="border h-100 bg-white p-3">
|
||||
<legend>{{ __('Documents') }}</legend>
|
||||
<legend>{{ __('Documents complémentaires') }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@php
|
||||
|
|
@ -179,7 +158,7 @@
|
|||
'model' => $productModel ?? null,
|
||||
'require' => false,
|
||||
'associatedModels' => \App\Enums\Products\CertificationEnum::toArray(),
|
||||
'helper' => trans('Selectionnez une Certification parmis la liste.'),
|
||||
'helper' => trans('Selectionnez une Certification parmi la liste.'),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -188,17 +167,17 @@
|
|||
{{-- ORIGINS --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="border h-100 bg-white p-3">
|
||||
<legend>{{ __('Origines') }}</legend>
|
||||
<legend>{{ __('Origine') }}</legend>
|
||||
<div class="row">
|
||||
@include('partials.inputs.select-multiple-enum', [
|
||||
'id' => 'productOrigins',
|
||||
'label' => __('Origines associées'),
|
||||
'label' => __('Origine associée'),
|
||||
'name' => 'origins',
|
||||
'itemsSelected' => old('origins', $productModel->origins ?? []),
|
||||
'itemsList' => collect(\App\Enums\Products\OriginEnum::toArray())->values(),
|
||||
'itemLimit' => [0, count(\App\Enums\Products\OriginEnum::toArray())],
|
||||
'placeholder' => __('Recherchez une Origine a associer.'),
|
||||
'helper' => __('Les Origines associées au produit.'),
|
||||
'placeholder' => '',
|
||||
'helper' => __('L\'origine associée au produit.'),
|
||||
'require' => false,
|
||||
])
|
||||
</div>
|
||||
|
|
@ -219,13 +198,13 @@
|
|||
'showSpecificItem' => [
|
||||
'name' => 'specified_claim',
|
||||
'label' => 'Précision de l\'allégation',
|
||||
'placeholder' => 'Sans sucre ajouté',
|
||||
'value' => $productModel->specified_claim ?? null,
|
||||
'placeholder' => '',
|
||||
'value' => old('specified_claim', $productModel->claims ?? null),
|
||||
'showId' => 99,
|
||||
'helper' => __('Doit décrire précisément l\'allégation (3 caractères minimum, 255 maximum).')
|
||||
],
|
||||
'model' => $productModel ?? null,
|
||||
'placeholder' => __('Recherchez une Allégation a associer.'),
|
||||
'placeholder' => '',
|
||||
'require' => false,
|
||||
'helper' => __('Les Allégations associées au produit.'),
|
||||
])
|
||||
|
|
@ -245,7 +224,7 @@
|
|||
'model' => $productModel ?? null,
|
||||
'require' => true,
|
||||
'associatedModels' => \App\Enums\Products\DistributionNetworkEnum::toArray(),
|
||||
'helper' => trans('Selectionnez un Réseau de distribution parmis la liste.'),
|
||||
'helper' => trans('Selectionnez un Réseau de distribution parmi la liste.'),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -264,7 +243,7 @@
|
|||
'model' => $productModel ?? null,
|
||||
'require' => true,
|
||||
'associatedModels' => \App\Enums\Products\RayEnum::toArray(),
|
||||
'helper' => trans('Selectionnez un Rayon parmis la liste.'),
|
||||
'helper' => trans('Selectionnez un Rayon parmi la liste.'),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -283,7 +262,7 @@
|
|||
'model' => $productModel ?? null,
|
||||
'require' => true,
|
||||
'associatedModels' => \App\Enums\Products\RangeEnum::toArray(),
|
||||
'helper' => trans('Selectionnez une Famille de produit parmis la liste.'),
|
||||
'helper' => trans('Selectionnez une Famille de produit parmi la liste.'),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -302,7 +281,7 @@
|
|||
'model' => $productModel ?? null,
|
||||
'require' => true,
|
||||
'associatedModels' => \App\Enums\Products\GeoAreaEnum::toArray(),
|
||||
'helper' => trans('Selectionnez une Zone géographique parmis la liste.'),
|
||||
'helper' => trans('Selectionnez une Zone géographique parmi la liste.'),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -334,11 +313,12 @@
|
|||
<div class="row">
|
||||
<div class="col-12 mb-3">
|
||||
@include('partials.inputs.int-number', [
|
||||
'id' => 'productWeight',
|
||||
'id' => 'productPvc',
|
||||
'label' => __('PVC de l\'UVC'),
|
||||
'name' => 'pvc',
|
||||
'model' => $productModel ?? null,
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'required' => false,
|
||||
'helper' => trans('Le prix doit être en euro (€).'),
|
||||
])
|
||||
|
|
@ -346,6 +326,32 @@
|
|||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- Prix au kilo --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="border h-100 bg-white p-3">
|
||||
<legend>{{ __('Prix au kilo') }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12 mb-3">
|
||||
@php
|
||||
$priceKg = 0;
|
||||
if ($productModel && $productModel->weight != 0) {
|
||||
$priceKg = 1000 * $productModel->pvc / $productModel->weight;
|
||||
}
|
||||
@endphp
|
||||
@include('partials.inputs.int-number', [
|
||||
'id' => 'productPriceKg',
|
||||
'label' => __('Prix au kilo du produit'),
|
||||
'name' => 'priceKg',
|
||||
'model' => null,
|
||||
'required' => false,
|
||||
'disabled' => true,
|
||||
'value' => $priceKg,
|
||||
'helper' => trans('Le prix au kilo est calculé automatiquement.'),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- COMMENT --}}
|
||||
<div class="col-12 mb-3">
|
||||
<fieldset class="border h-100 bg-white p-3">
|
||||
|
|
@ -359,7 +365,7 @@
|
|||
'model' => $productModel ?? null,
|
||||
'required' => false,
|
||||
'helper' => __(' Doit décrire précisément le contenu du produit, requiert entre 50 et 160 caractères, balise <meta> description.'),
|
||||
'placeholder' => __('Une description du contenu du produit pour les moteurs de recherche.'),
|
||||
'placeholder' => '',
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -368,7 +374,7 @@
|
|||
{{-- KEYWORDS --}}
|
||||
<div class="col-12 mb-3">
|
||||
<fieldset class="border h-100 bg-white p-3">
|
||||
<legend>{{ __('Tendances') }}</legend>
|
||||
<legend>{{ __('Précisez la ou les tendances') }}</legend>
|
||||
<div class="row">
|
||||
@include('partials.inputs.pivot-taggable', [
|
||||
'name' => 'productKeywords',
|
||||
|
|
@ -376,7 +382,7 @@
|
|||
'itemLimit' => [0, count($keywords)],
|
||||
'itemsList' => $keywords,
|
||||
'helper' => __('Les Tendances associées au produit.'),
|
||||
'placeholder' => __('Recherchez une Tendance a associer.'),
|
||||
'placeholder' => '',
|
||||
])
|
||||
</div>
|
||||
</fieldset>
|
||||
|
|
@ -400,6 +406,7 @@
|
|||
'title1' => __("Dégustation"),
|
||||
'label1' => __('Produit dégusté ?'),
|
||||
'name1' => 'is_tasted',
|
||||
'oldCheck' => boolval(old('is_tasted', null)),
|
||||
'model' => $productModel ?? null,
|
||||
'oldModel' => session()->getOldInput(),
|
||||
'max' => 15,
|
||||
|
|
@ -429,5 +436,21 @@
|
|||
event.preventDefault();
|
||||
submit.click('');
|
||||
})
|
||||
|
||||
const priceKgInput = document.getElementById('productPriceKg');
|
||||
const priceInput = document.getElementById('productPvc');
|
||||
const weightInput = document.getElementById('productWeight');
|
||||
priceInput.addEventListener("change", updatePriceKg);
|
||||
weightInput.addEventListener("change", updatePriceKg);
|
||||
|
||||
function updatePriceKg() {
|
||||
if (weightInput.value != 0) {
|
||||
$priceKg = 1000 * priceInput.value / weightInput.value;
|
||||
priceKgInput.value = $priceKg.toFixed(2);
|
||||
} else {
|
||||
priceKgInput.value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
@extends('layout')
|
||||
|
||||
@section('title', sprintf('%s - %s', __('models.classes.products'), Str::ucfirst(__('liste'))))
|
||||
@section('title', sprintf('%s - %s', trans_choice('models.classes.products_monitoring', 2), Str::ucfirst(__('liste'))))
|
||||
@section('description', __('Liste des produits publiés'))
|
||||
@section('breadcrumb', 'no')
|
||||
|
||||
|
|
@ -10,14 +10,14 @@
|
|||
<div class="row">
|
||||
<div class="col">
|
||||
<h1 class="text-center text-md-start h2">
|
||||
<span class="fw-bold">{{ __('models.classes.products') }}</span> <span class="text-muted">{{ Str::ucfirst(__('liste')) }}</span>
|
||||
<span class="fw-bold">{{ trans_choice('models.classes.products_monitoring', 2) }}</span> <span class="text-muted">{{ Str::ucfirst(__('liste')) }}</span>
|
||||
</h1>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="input-group justify-content-end">
|
||||
<a href="{{ route('products.create') }}"
|
||||
class="btn btn-primary"
|
||||
title="{{ __('Ajouter un :model', ['model' => Str::singular(__('models.classes.products'))]) }}"
|
||||
class="btn btn-success"
|
||||
title="{{ __('Ajouter une :model', ['model' => trans_choice('models.classes.products_monitoring', 1)]) }}"
|
||||
data-bs="tooltip">
|
||||
<i class="fa-solid fa-plus"></i>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -6,8 +6,7 @@
|
|||
'name' => __('Nom'),
|
||||
'brand_id' => __('Marque'),
|
||||
'picture' => __('Image'),
|
||||
'updated_at' => __('Mis à jour le'),
|
||||
'multi_pdf' => __('Multi .pdf'),
|
||||
'multi_pdf' => __('Générer en pdf la sélection'),
|
||||
];
|
||||
$routeName = request()->route()->getName();
|
||||
$rst = !is_null(request()->rst) || !Session::has("$routeName.sorted");
|
||||
|
|
@ -37,12 +36,7 @@
|
|||
<p class="text-muted">{{ __('Aucune image enregistée') }}</p>
|
||||
@endif
|
||||
</td>
|
||||
<td class="align-middle text-center">
|
||||
<span class="badge bg-secondary text-wrap">
|
||||
{{ $productModel->updated_at->formatLocalized('%d/%m/%Y à %I:%M') }}
|
||||
</span>
|
||||
</td>
|
||||
@if(!$noOrder or $rst)
|
||||
{{-- @if(!$noOrder or $rst) --}}
|
||||
<td class="align-middle text-center">
|
||||
@php
|
||||
$data = [
|
||||
|
|
@ -53,7 +47,7 @@
|
|||
@endphp
|
||||
<div class="button-multi-pdf" data-json='@json($data)'></div>
|
||||
</td>
|
||||
@endif
|
||||
{{-- @endif --}}
|
||||
<td class="align-middle text-end">
|
||||
<form action="{{ route('products.destroy', $productModel->id) }}" method="POST" class="d-inline confirmDeleteJS">
|
||||
@method('DELETE')
|
||||
|
|
@ -62,38 +56,38 @@
|
|||
<a class="btn btn-sm btn-info glightbox" type="button"
|
||||
href="{{ asset($productModel->picture) }}" target="_blank"
|
||||
data-gallery="product{{ $productModel->id }}"
|
||||
data-bs-title="{{ __('Visionner l\'image du :model', ['model' => Str::singular(__('models.classes.products'))]) }}"
|
||||
data-bs-title="{{ __('Visionner l\'image de la :model', ['model' => trans_choice('models.classes.products_monitoring', 1)]) }}"
|
||||
data-bs="tooltip">
|
||||
<i class="fa-solid fa-image"></i>
|
||||
</a>
|
||||
<a class="btn btn-sm btn-warning" type="button"
|
||||
href="{{ route('products.download', $productModel) }}"
|
||||
title="{{ __('Télécharger les annexes du :model', ['model' => Str::singular(__('models.classes.products'))]) }}"
|
||||
title="{{ __('Télécharger les annexes de la :model', ['model' => trans_choice('models.classes.products_monitoring', 1)]) }}"
|
||||
data-bs="tooltip">
|
||||
<i class="fa-solid fa-download"></i>
|
||||
</a>
|
||||
<a class="btn btn-sm btn-secondary btn-printing" type="button"
|
||||
href="{{ route('products.pdf.show', $productModel) }}"
|
||||
target="blank"
|
||||
title="{{ __('Fichier .pdf du :model', ['model' => Str::singular(__('models.classes.products'))]) }}"
|
||||
title="{{ __('Fichier .pdf de la :model', ['model' => trans_choice('models.classes.products_monitoring', 1)]) }}"
|
||||
data-bs="tooltip"
|
||||
data-id="{{ $productModel->id }}">
|
||||
<i class="fa-solid fa-print"></i>
|
||||
</a>
|
||||
<a class="btn btn-sm btn-success"
|
||||
href="{{ route('products.duplicate', $productModel) }}"
|
||||
title="{{ __('Dupliquer ce :model', ['model' => Str::singular(__('models.classes.products'))]) }}"
|
||||
title="{{ __('Dupliquer cette :model', ['model' => trans_choice('models.classes.products_monitoring', 1)]) }}"
|
||||
data-bs="tooltip">
|
||||
<i class="fa-solid fa-copy"></i>
|
||||
</a>
|
||||
<a class="btn btn-sm btn-primary"
|
||||
href="{{ route('products.edit', $productModel) }}"
|
||||
title="{{ __('Modifier ce :model', ['model' => Str::singular(__('models.classes.products'))]) }}"
|
||||
title="{{ __('Modifier cette :model', ['model' => trans_choice('models.classes.products_monitoring', 1)]) }}"
|
||||
data-bs="tooltip">
|
||||
<i class="fa-solid fa-pencil"></i>
|
||||
</a>
|
||||
<button class="btn btn-sm btn-danger"
|
||||
title="{{ __('Supprimer ce :model', ['model' => Str::singular(__('models.classes.products'))]) }}"
|
||||
title="{{ __('Supprimer cette :model', ['model' => trans_choice('models.classes.products_monitoring', 1)]) }}"
|
||||
data-bs="tooltip">
|
||||
<i class="fa-solid fa-trash"></i>
|
||||
</button>
|
||||
|
|
@ -106,7 +100,7 @@
|
|||
<tr>
|
||||
<td colspan="{{ count($cols)+1 }}" class="text-center">
|
||||
<span
|
||||
class="h3">{{ __('Aucun résultat pour les :models', ['models' => __('models.classes.products')]) }}
|
||||
class="h3">{{ __('Aucun résultat pour les :models', ['models' => trans_choice('models.classes.products_monitoring', 2)]) }}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
</select>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 mt-1">
|
||||
<input name="gencod" type="text" class="form-control" placeholder="GENCODE" value="{{ $queryParameters['gencod'] ?? null }}">
|
||||
<input name="gencod" type="text" class="form-control" placeholder="GENCOD" value="{{ $queryParameters['gencod'] ?? null }}">
|
||||
</div>
|
||||
</div>
|
||||
<!-- SOURCE -->
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
@if(!empty($label))
|
||||
<label for="{{ $name }}" class="col-form-label"><b>{{ $label }} *</b></label>
|
||||
@endif
|
||||
{{-- @dd($model->{$name}) --}}
|
||||
<select id="{{ $name }}" class="form-select" name="{{ $name }}" aria-describedby="{{ $id }}Help" @if(!empty($label))required @endif>
|
||||
<option value="0" @if (!old($name, $model->{$name}->id ?? $value ?? null)) selected @endif>
|
||||
</option>
|
||||
@foreach ($associatedModels as $associatedModel)
|
||||
<option value="{{ $associatedModel->id }}" @if (old($name, $model->{$name} ?? 1) == $associatedModel->id) selected @endif>
|
||||
<option value="{{ $associatedModel->id }}" @if (old($name, $model->{$name} ?? $value ?? null) == $associatedModel->id) selected @endif>
|
||||
{{ $associatedModel->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -7,10 +7,14 @@
|
|||
id="{{ $id }}"
|
||||
name="{{ $name }}"
|
||||
type="number"
|
||||
value="{{ old($name, $model->{$name} ?? 0) }}"
|
||||
value="{{ old($name, $model->{$name} ?? $value ?? null) }}"
|
||||
class="form-control"
|
||||
aria-describedby="{{ $id }}Help"
|
||||
@if(!empty($step))
|
||||
step="{{ $step }}"
|
||||
@else
|
||||
step="1"
|
||||
@endif
|
||||
@if(!empty($max))
|
||||
max="{{ $max }}"
|
||||
@else
|
||||
|
|
@ -22,6 +26,8 @@
|
|||
min="{{ !empty($unsigned) ? '0' : '-2147483648' }}"
|
||||
@endif
|
||||
@if(!empty($required))required @endif
|
||||
@if(!empty($disabled))disabled @endif
|
||||
@if(!empty($readonly))readonly @endif
|
||||
>
|
||||
@include('modules.input-error', [
|
||||
'inputName' => $name,
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@
|
|||
<label for="{{ $name }}" class="col-form-label"><b>{{ $label }}@if(!empty($required)) * @endif</b></label>
|
||||
@endif
|
||||
<select id="{{ $name }}" class="form-select" name="{{ $name }}" aria-describedby="{{ $id }}Help" @if(!empty($require))required @endif>
|
||||
<option value="0" @if (!old($name, $model->{$name}->value ?? $value ?? null)) selected @endif>
|
||||
</option>
|
||||
@foreach ($associatedModels as $associatedModel)
|
||||
<option value="{{ $associatedModel->value}}" @if (old($name, $model->{$name}->value ?? $value ?? 1) == $associatedModel->value) selected @endif>
|
||||
<option value="{{ $associatedModel->value}}" @if (old($name, $model->{$name}->value ?? $value ?? null) == $associatedModel->value) selected @endif>
|
||||
{{ $associatedModel->label }}
|
||||
</option>
|
||||
@endforeach
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue