¨4.0.1¨

This commit is contained in:
¨NW¨
2023-12-03 14:07:47 +00:00
parent c08b36d1b6
commit f35052522d
1112 changed files with 43019 additions and 24987 deletions

View File

@@ -0,0 +1,57 @@
<div class="row" :class="{ 'has-variation-type': !isEmptyVariationType }">
<div class="col-lg-2 col-sm-2">
<h5>{{ trans('variation::variations.group.general') }}</h5>
</div>
<div class="col-lg-7 col-sm-10">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label for="name">
{{ trans('variation::attributes.name') }}
<span class="text-red">*</span>
</label>
<input type="text" name="name" id="name" class="form-control" v-model="form.name">
<span class="help-block text-red" v-if="errors.has('name')" v-text="errors.get('name')"></span>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="type">
{{ trans('variation::attributes.type') }}
<span class="text-red">*</span>
</label>
<select
name="type"
id="type"
class="form-control custom-select-black"
@change="changeVariationType($event.target.value)"
v-model="form.type"
>
<option value="">
{{ trans('variation::variations.form.variation_types.please_select') }}
</option>
<option value="text">
{{ trans('variation::variations.form.variation_types.text') }}
</option>
<option value="color">
{{ trans('variation::variations.form.variation_types.color') }}
</option>
<option value="image">
{{ trans('variation::variations.form.variation_types.image') }}
</option>
</select>
<span class="help-block text-red" v-if="errors.has('type')" v-text="errors.get('type')"></span>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,15 @@
@push('shortcuts')
<dl class="dl-horizontal">
<dt><code>b</code></dt>
<dd>{{ trans('admin::admin.shortcuts.back_to_index', ['name' => trans('variation::variations.variation')]) }}</dd>
</dl>
@endpush
@push('scripts')
<script type="module">
keypressAction([{
key: 'b',
route: "{{ route('admin.variations.index') }}"
}, ]);
</script>
@endpush

View File

@@ -0,0 +1,15 @@
<div class="row">
<div class="col-lg-7 col-lg-offset-2 col-md-12 text-right">
<button
type="button"
class="btn btn-primary"
:class="{
'btn-loading': formSubmitting
}"
:disabled="formSubmitting"
@click="submit"
>
{{ trans('admin::admin.buttons.save') }}
</button>
</div>
</div>

View File

@@ -0,0 +1,123 @@
<div v-cloak class="row" v-if="!isEmptyVariationType">
<div class="col-lg-2 col-sm-2">
<h5>{{ trans('variation::variations.group.values') }}</h5>
</div>
<div class="col-lg-7 col-sm-10">
<div class="variation-values clearfix">
<div class="table-responsive">
<table
class="options table table-bordered table-striped"
:class="form.type !== '' ? `type-${form.type}` : ''"
>
<thead>
<tr>
<th></th>
<th>
{{ trans('variation::variations.form.label') }}
<span class="text-red">*</span>
</th>
<th v-if="form.type === 'color'">
{{ trans('variation::variations.form.color') }}
<span class="text-red">*</span>
</th>
<th v-else-if="form.type === 'image'">
{{ trans('variation::variations.form.image') }}
<span class="text-red">*</span>
</th>
<th></th>
</tr>
</thead>
<tbody
is="draggable"
tag="tbody"
handle=".drag-handle"
animation="150"
:list="form.values"
@end="updateColorThumbnails"
>
<tr v-for="(value, index) in form.values" class="option-row" :key="index">
<td class="text-center">
<span class="drag-handle">
<i class="fa">&#xf142;</i>
<i class="fa">&#xf142;</i>
</span>
</td>
<td>
<input
type="text"
:name="`values.${value.uid}.label`"
:id="`values-${value.uid}-label`"
class="form-control"
@keyup.enter="addRowOnPressEnter($event, index)"
v-model="value.label"
>
<span
class="help-block text-red"
v-if="errors.has(`values.${value.uid}.label`)"
v-text="errors.get(`values.${value.uid}.label`)"
>
</span>
</td>
<td v-if="form.type === 'color'">
<div>
<input
type="text"
:name="`values.${value.uid}.color`"
:id="`values-${value.uid}-color`"
class="form-control color-picker"
v-model="value.color"
>
</div>
<span
class="help-block text-red"
v-if="errors.has(`values.${value.uid}.color`)"
v-text="errors.get(`values.${value.uid}.color`)"
>
</span>
</td>
<td v-else-if="form.type === 'image'">
<div class="d-flex">
<div
class="image-holder"
@click="chooseImage(index, value.uid)"
>
<template v-if="value.image.id">
<img :src="value.image.path" alt="variation image">
</template>
<img v-else src="{{ asset('build/assets/placeholder_image.png') }}" class="placeholder-image" alt="Placeholder image">
</div>
</div>
<span
class="help-block text-red"
v-if="errors.has(`values.${value.uid}.image`)"
v-text="errors.get(`values.${value.uid}.image`)"
>
</span>
</td>
<td class="text-center">
<button
type="button"
tabindex="-1"
class="btn btn-default delete-row"
@click="deleteRow(index, value.uid)"
>
<i class="fa fa-trash"></i>
</button>
</td>
</tr>
</tbody>
</table>
</div>
<button type="button" class="btn btn-default" @click="addRow">
{{ trans('variation::variations.form.add_row') }}
</button>
</div>
</div>
</div>