¨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

@@ -3,7 +3,7 @@ export default class {
this.attributeId = 0;
this.valuesCount = 0;
this.addOldValues(FleetCart.data['attribute.values']);
this.addOldValues(FleetCart.data["attribute.values"]);
if (this.valuesCount === 0) {
this.addAttributeValue();
@@ -12,7 +12,7 @@ export default class {
this.eventListeners();
this.sortable();
window.admin.removeSubmitButtonOffsetOn('#values');
window.admin.removeSubmitButtonOffsetOn("#values");
}
addOldValues(values = {}) {
@@ -21,26 +21,26 @@ export default class {
}
}
addAttributeValue(value = { id: '', value: '' }) {
let template = _.template($('#attribute-value-template').html());
addAttributeValue(value = { id: "", value: "" }) {
let template = _.template($("#attribute-value-template").html());
let html = template({ valueId: this.valuesCount++, value });
$('#attribute-values').append(html);
$("#attribute-values").append(html);
window.admin.tooltip();
}
eventListeners() {
$('#add-new-value').on('click', () => this.addAttributeValue());
$("#add-new-value").on("click", () => this.addAttributeValue());
$('#attribute-values').on('click', '.delete-row', (e) => {
$(e.currentTarget).closest('tr').remove();
$("#attribute-values").on("click", ".delete-row", (e) => {
$(e.currentTarget).closest("tr").remove();
});
}
sortable() {
Sortable.create(document.getElementById('attribute-values'), {
handle: '.drag-icon',
Sortable.create(document.getElementById("attribute-values"), {
handle: ".drag-handle",
animation: 150,
});
}

View File

@@ -1,10 +1,5 @@
import AttributeValues from './AttributeValues';
import ProductAttributes from './ProductAttributes';
import AttributeValues from "./AttributeValues";
if ($('#attribute-values-wrapper').length !== 0) {
if ($("#attribute-values-wrapper").length !== 0) {
new AttributeValues();
}
if ($('#product-attributes-wrapper').length !== 0) {
new ProductAttributes();
}

View File

@@ -1,49 +1,23 @@
#product-attributes-wrapper,
#attribute-values-wrapper {
margin-bottom: 15px;
.table {
.form-group {
margin: 0;
}
thead th {
&:first-child {
width: 40px;
}
&:last-child {
width: 60px;
}
}
}
}
#product-attributes-wrapper {
.table-responsive {
overflow: visible;
}
.table {
> tbody > tr {
> td {
vertical-align: middle;
&:nth-child(2) {
width: 160px;
width: 190px;
min-width: 160px;
}
}
}
}
.options {
.drag-icon {
margin-top: 3px;
}
}
}
#attribute-values-wrapper {
margin-bottom: 15px;
.table-responsive {
margin-bottom: 15px;
}
.table {
> tbody > tr {
> td {
@@ -55,19 +29,55 @@
}
}
@media screen and (max-width: 767px) {
#product-attributes-wrapper {
.options {
.drag-icon {
margin-top: 0;
#product-attributes-wrapper,
#attribute-values-wrapper {
.table-responsive {
margin-bottom: 15px;
overflow: visible;
}
.table {
thead th {
&:first-child {
width: 35px;
}
&:last-child {
width: 60px;
}
}
.form-group {
margin: 0;
}
}
}
@media screen and (max-width: 991px) {
#product-attributes-wrapper {
.table {
> tbody > tr {
> td {
&:nth-child(2) {
min-width: 160px;
}
}
}
}
}
}
@media screen and (max-width: 767px) {
#product-attributes-wrapper {
.table {
> tbody > tr {
border-top: 1px solid #e9e9e9;
> td {
&:nth-child(2) {
padding-top: 15px;
}
&:nth-child(2),
&:nth-child(3),
&:nth-child(4) {
@@ -77,7 +87,6 @@
padding-left: 15px;
padding-right: 15px;
text-align: left;
vertical-align: initial;
}
&:nth-child(4) {

View File

@@ -3,6 +3,7 @@
return [
'attribute' => 'Attribute',
'attributes' => 'Attributes',
'table' => [
'name' => 'Name',
'attribute_set' => 'Attribute Set',
@@ -10,26 +11,20 @@ return [
'yes' => 'Yes',
'no' => 'No',
],
'tabs' => [
'group' => [
'attribute_information' => 'Attribute Information',
],
'general' => 'General',
'values' => 'Values',
'product' => [
'attributes' => 'Attributes',
],
],
'form' => [
'use_this_attribute_for_filtering_products' => 'Use this attribute for filtering products',
'value' => 'Value',
'add_new_value' => 'Add New Value',
'delete_value' => 'Delete Value',
'product' => [
'attribute' => 'Attribute',
'values' => 'Values',
'add_new_attribute' => 'Add New Attribute',
'delete_attribute' => 'Delete Attribute',
],
],
];

View File

@@ -25,7 +25,7 @@
@endcomponent
@push('scripts')
<script>
<script type="module">
new DataTable('#attribute_sets-table .table', {
columns: [
{ data: 'checkbox', orderable: false, searchable: false, width: '3%' },

View File

@@ -6,7 +6,7 @@
@endpush
@push('scripts')
<script>
<script type="module">
keypressAction([
{ key: 'b', route: "{{ route('admin.attribute_sets.index') }}" }
]);

View File

@@ -16,3 +16,10 @@
@endsection
@include('attribute::admin.attributes.partials.shortcuts')
@push('globals')
@vite([
'Modules/Attribute/Resources/assets/admin/sass/main.scss',
'Modules/Attribute/Resources/assets/admin/js/main.js',
])
@endpush

View File

@@ -18,3 +18,10 @@
@endsection
@include('attribute::admin.attributes.partials.shortcuts')
@push('globals')
@vite([
'Modules/Attribute/Resources/assets/admin/sass/main.scss',
'Modules/Attribute/Resources/assets/admin/js/main.js',
])
@endpush

View File

@@ -27,7 +27,7 @@
@endcomponent
@push('scripts')
<script>
<script type="module">
new DataTable('#attributes-table .table', {
columns: [
{ data: 'checkbox', orderable: false, searchable: false, width: '3%' },

View File

@@ -6,7 +6,7 @@
@endpush
@push('scripts')
<script>
<script type="module">
keypressAction([
{ key: 'b', route: "{{ route('admin.attributes.index') }}" }
]);

View File

@@ -1,7 +1,7 @@
<script type="text/html" id="attribute-value-template">
<tr>
<td class="text-center">
<span class="drag-icon">
<span class="drag-handle">
<i class="fa">&#xf142;</i>
<i class="fa">&#xf142;</i>
</span>