mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-10 07:16:06 -06:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b6b3b578d4
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Anomaly\Streams\Platform\Database\Migration\Migration;
|
||||||
|
|
||||||
|
class VisiosoftModuleAdvsAddCustomOptionValue extends Migration
|
||||||
|
{
|
||||||
|
protected $stream = [
|
||||||
|
'slug' => 'option_configuration',
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $fields = [
|
||||||
|
'custom_option' => [
|
||||||
|
'type' => 'anomaly.field_type.text',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $assignments = [
|
||||||
|
'custom_option'
|
||||||
|
];
|
||||||
|
}
|
||||||
@ -6,21 +6,6 @@ return [
|
|||||||
'write',
|
'write',
|
||||||
'delete',
|
'delete',
|
||||||
],
|
],
|
||||||
'categories' => [
|
|
||||||
'read',
|
|
||||||
'write',
|
|
||||||
'delete',
|
|
||||||
],
|
|
||||||
'village' => [
|
|
||||||
'read',
|
|
||||||
'write',
|
|
||||||
'delete',
|
|
||||||
],
|
|
||||||
'options' => [
|
|
||||||
'read',
|
|
||||||
'write',
|
|
||||||
'delete',
|
|
||||||
],
|
|
||||||
'productoptions' => [
|
'productoptions' => [
|
||||||
'read',
|
'read',
|
||||||
'write',
|
'write',
|
||||||
@ -31,16 +16,6 @@ return [
|
|||||||
'write',
|
'write',
|
||||||
'delete',
|
'delete',
|
||||||
],
|
],
|
||||||
'options_configuration' => [
|
|
||||||
'read',
|
|
||||||
'write',
|
|
||||||
'delete',
|
|
||||||
],
|
|
||||||
'option_configuration' => [
|
|
||||||
'read',
|
|
||||||
'write',
|
|
||||||
'delete',
|
|
||||||
],
|
|
||||||
'option_configuration' => [
|
'option_configuration' => [
|
||||||
'read',
|
'read',
|
||||||
'write',
|
'write',
|
||||||
|
|||||||
@ -64,3 +64,7 @@
|
|||||||
.input-group-addon input[type=checkbox] {
|
.input-group-addon input[type=checkbox] {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ads-box-image:hover {
|
||||||
|
cursor: move;
|
||||||
|
}
|
||||||
|
|||||||
@ -350,4 +350,33 @@ $(document).ready(function () {
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Add classified image sorting
|
||||||
|
function getIdsOfImages() {
|
||||||
|
var values = [];
|
||||||
|
$('.imageList .ads-box-image').each(function (index) {
|
||||||
|
values.push($(this).attr("data-id"));
|
||||||
|
});
|
||||||
|
|
||||||
|
$('[name=files]').val(values.join(','));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Listen for the event.
|
||||||
|
document.querySelector('#mediaSelectedWrapper').addEventListener('dropzone.changed', function (e) {
|
||||||
|
setTimeout(function () {
|
||||||
|
const imageList = $('.imageList');
|
||||||
|
imageList.unbind();
|
||||||
|
|
||||||
|
imageList.sortable({
|
||||||
|
update: function(event, ui) {
|
||||||
|
getIdsOfImages();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 500)
|
||||||
|
}, false);
|
||||||
|
|
||||||
|
$( ".imageList" ).sortable({
|
||||||
|
update: function(event, ui) {
|
||||||
|
getIdsOfImages();
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -396,4 +396,5 @@ return [
|
|||||||
'page' => 'Page',
|
'page' => 'Page',
|
||||||
'undefined_page' => 'Undefined Page',
|
'undefined_page' => 'Undefined Page',
|
||||||
'id' => 'ID',
|
'id' => 'ID',
|
||||||
|
'custom_field' => 'Custom Field',
|
||||||
];
|
];
|
||||||
|
|||||||
@ -8,6 +8,7 @@
|
|||||||
<style>
|
<style>
|
||||||
{{ asset_inline("visiosoft.module.advs::css/new-create.css") }}
|
{{ asset_inline("visiosoft.module.advs::css/new-create.css") }}
|
||||||
{{ asset_inline("visiosoft.module.advs::css/new-create-new.scss") }}
|
{{ asset_inline("visiosoft.module.advs::css/new-create-new.scss") }}
|
||||||
|
{{ asset_inline("visiosoft.theme.base::css/jquery-ui.min.css") }}
|
||||||
</style>
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
@ -344,5 +345,6 @@
|
|||||||
{{ asset_add("scripts.js", "visiosoft.module.advs::js/new-create.js") }}
|
{{ asset_add("scripts.js", "visiosoft.module.advs::js/new-create.js") }}
|
||||||
{{ asset_add("scripts.js", "streams::js/form/form.js") }}
|
{{ asset_add("scripts.js", "streams::js/form/form.js") }}
|
||||||
{{ asset_add("scripts.js", "streams::js/form/translations.js") }}
|
{{ asset_add("scripts.js", "streams::js/form/translations.js") }}
|
||||||
|
{{ asset_add("scripts.js", "visiosoft.theme.base::js/vendor/jquery-ui.min.js") }}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@ -11,10 +11,10 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="">
|
<div class="flex-row">
|
||||||
{% set configurationForm = form('configuration_form').entry(adv.id).get() %}
|
{% set configurationForm = form('configuration_form').entry(adv.id).get() %}
|
||||||
|
|
||||||
{{ form_open({id: 'configurationForm',class: 'd-flex justify-content-between'})|raw }}
|
{{ form_open({id: 'configurationForm',class: 'd-flex justify-content-between flex-column flex-lg-row'})|raw }}
|
||||||
<input type="text" name="parent_adv_id" value="{{ adv.id }}" hidden>
|
<input type="text" name="parent_adv_id" value="{{ adv.id }}" hidden>
|
||||||
{{ configurationForm.fields|raw }}
|
{{ configurationForm.fields|raw }}
|
||||||
<button type="submit" class="btn btn-primary btn-configuration my-auto form-control w-auto">
|
<button type="submit" class="btn btn-primary btn-configuration my-auto form-control w-auto">
|
||||||
|
|||||||
@ -74,7 +74,10 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
|||||||
$query = $query->where('city', $city->id);
|
$query = $query->where('city', $city->id);
|
||||||
} elseif (isset($param['city']) and !empty(array_filter($param['city']))) {
|
} elseif (isset($param['city']) and !empty(array_filter($param['city']))) {
|
||||||
$query = $query->whereIn('city', explode(',', array_first($param['city'])));
|
$query = $query->whereIn('city', explode(',', array_first($param['city'])));
|
||||||
}
|
} elseif ($selectedCity = request()->cookie('selectedCity')) {
|
||||||
|
$selectedCity = json_decode($selectedCity);
|
||||||
|
$query = $query->where('city', $selectedCity->id);
|
||||||
|
}
|
||||||
if (isset($param['district']) and !empty(array_filter($param['district']))) {
|
if (isset($param['district']) and !empty(array_filter($param['district']))) {
|
||||||
$query = $query->whereIn('district', explode(',', array_first($param['district'])));
|
$query = $query->whereIn('district', explode(',', array_first($param['district'])));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,7 @@ class OptionConfigurationFormFields
|
|||||||
|
|
||||||
foreach ($options as $option)
|
foreach ($options as $option)
|
||||||
{
|
{
|
||||||
if($optionValue = $productoptionsValueRepository->getWithOptionsId([$option->id]))
|
if($productoptionsValueRepository->getWithOptionsId([$option->id]))
|
||||||
{
|
{
|
||||||
$options_fields['option-'.$option->getId()] = [
|
$options_fields['option-'.$option->getId()] = [
|
||||||
'type' => 'anomaly.field_type.select',
|
'type' => 'anomaly.field_type.select',
|
||||||
@ -35,14 +35,18 @@ class OptionConfigurationFormFields
|
|||||||
'attributes' => [
|
'attributes' => [
|
||||||
'data-id' => $option->getId(),
|
'data-id' => $option->getId(),
|
||||||
],
|
],
|
||||||
'config' => [
|
|
||||||
'options' => $optionValue->pluck('title','id')->all(),
|
|
||||||
]
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$options_fields['custom_option'] = [
|
||||||
|
'type' => 'anomaly.field_type.text',
|
||||||
|
'class' => 'form-control product-custom-fields',
|
||||||
|
'required' => false,
|
||||||
|
'label' => trans('visiosoft.module.advs::field.custom_field'),
|
||||||
|
];
|
||||||
|
|
||||||
$fields = array_merge($options_fields, ['price', 'currency', 'stock']);
|
$fields = array_merge($options_fields, ['price', 'currency', 'stock']);
|
||||||
|
|
||||||
$builder->setFields($fields);
|
$builder->setFields($fields);
|
||||||
|
|||||||
@ -19,7 +19,7 @@ class OptionConfigurationFormHandler
|
|||||||
$option_json = array();
|
$option_json = array();
|
||||||
|
|
||||||
foreach ($parameters as $key => $parameter_value) {
|
foreach ($parameters as $key => $parameter_value) {
|
||||||
if (substr($key, 0, 7) === "option-") {
|
if (strpos($key, "option-") === 0) {
|
||||||
$option_id = substr($key, 7);
|
$option_id = substr($key, 7);
|
||||||
$option_json[$option_id] = $parameter_value;
|
$option_json[$option_id] = $parameter_value;
|
||||||
unset($parameters[$key]);
|
unset($parameters[$key]);
|
||||||
|
|||||||
@ -29,6 +29,8 @@ class OptionConfigurationModel extends AdvsOptionConfigurationEntryModel impleme
|
|||||||
|
|
||||||
$name = trim($option_group_value, ' ');
|
$name = trim($option_group_value, ' ');
|
||||||
|
|
||||||
|
$name .= ' ' . $this->custom_option;
|
||||||
|
|
||||||
return ($add_name) ? $adv->name . ' | ' . $name : $name;
|
return ($add_name) ? $adv->name . ' | ' . $name : $name;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@ -62,6 +62,8 @@ class OptionConfigurationRepository extends EntryRepository implements OptionCon
|
|||||||
$value_entry = $this->productOptionsValueRepository->find($value);
|
$value_entry = $this->productOptionsValueRepository->find($value);
|
||||||
$option_group_value .= " " . $value_entry->getName();
|
$option_group_value .= " " . $value_entry->getName();
|
||||||
}
|
}
|
||||||
|
$option_group_value .= " " . $product_configuration->custom_option;
|
||||||
|
|
||||||
$configurations[$product_configuration->getId()] = [
|
$configurations[$product_configuration->getId()] = [
|
||||||
'name' => $option_group_value,
|
'name' => $option_group_value,
|
||||||
'price' => $product_configuration->price,
|
'price' => $product_configuration->price,
|
||||||
|
|||||||
7
addons/default/visiosoft/base-theme/resources/css/jquery-ui.min.css
vendored
Normal file
7
addons/default/visiosoft/base-theme/resources/css/jquery-ui.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
6
addons/default/visiosoft/base-theme/resources/js/vendor/jquery-ui.min.js
vendored
Normal file
6
addons/default/visiosoft/base-theme/resources/js/vendor/jquery-ui.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -5,7 +5,7 @@
|
|||||||
<div class="logo-container">
|
<div class="logo-container">
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
{% if setting_value('visiosoft.theme.defaultadmin::login_icon') %}
|
{% if setting_value('visiosoft.theme.defaultadmin::login_icon') %}
|
||||||
<img src="{{ file(setting_value('visiosoft.theme.defaultadmin::login_icon')).url }}" alt="site icon">
|
<img src="{{ file(setting_value('visiosoft.theme.defaultadmin::login_icon')).make.path }}" alt="site icon">
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ img('theme::img/login-icon.svg').data|raw }}
|
{{ img('theme::img/login-icon.svg').data|raw }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
{% if setting_value('visiosoft.theme.defaultadmin::login_icon') %}
|
{% if setting_value('visiosoft.theme.defaultadmin::login_icon') %}
|
||||||
<img src="{{ file(setting_value('visiosoft.theme.defaultadmin::login_icon')).url }}" alt="site icon">
|
<img src="{{ file(setting_value('visiosoft.theme.defaultadmin::login_icon')).make.path }}" alt="site icon">
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ img('theme::img/login-icon.svg').data|raw }}
|
{{ img('theme::img/login-icon.svg').data|raw }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@ -1,6 +1,26 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
'countries' => [
|
||||||
|
'read',
|
||||||
|
'write',
|
||||||
|
'delete',
|
||||||
|
],
|
||||||
|
'cities' => [
|
||||||
|
'read',
|
||||||
|
'write',
|
||||||
|
'delete',
|
||||||
|
],
|
||||||
|
'districts' => [
|
||||||
|
'read',
|
||||||
|
'write',
|
||||||
|
'delete',
|
||||||
|
],
|
||||||
|
'neighborhoods' => [
|
||||||
|
'read',
|
||||||
|
'write',
|
||||||
|
'delete',
|
||||||
|
],
|
||||||
'village' => [
|
'village' => [
|
||||||
'read',
|
'read',
|
||||||
'write',
|
'write',
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
|
// Add dropzone change event
|
||||||
|
const event = new Event('dropzone.changed');
|
||||||
|
|
||||||
// Disabling autoDiscover, otherwise Dropzone will try to attach twice.
|
// Disabling autoDiscover, otherwise Dropzone will try to attach twice.
|
||||||
Dropzone.autoDiscover = false;
|
Dropzone.autoDiscover = false;
|
||||||
$("div#myDrop").dropzone({url: "/file/post"});
|
$("div#myDrop").dropzone({url: "/file/post"});
|
||||||
|
|
||||||
var doc_input = $('input[name="doc_files"]');
|
var doc_input = $('input[name="doc_files"]');
|
||||||
|
|
||||||
|
const getUploaded = () => $('input[name="files"]').val().split(',').map(Number);
|
||||||
var uploaded = $('input[name="files"]').val().split(',').map(Number);
|
|
||||||
|
|
||||||
if (doc_input.length) {
|
if (doc_input.length) {
|
||||||
var docsUploaded = doc_input.val().split(',').map(Number);
|
var docsUploaded = doc_input.val().split(',').map(Number);
|
||||||
@ -72,6 +74,7 @@ $(function () {
|
|||||||
var response = JSON.parse(file.xhr.response);
|
var response = JSON.parse(file.xhr.response);
|
||||||
var mimeType = response.mime_type.split('/')
|
var mimeType = response.mime_type.split('/')
|
||||||
if (mimeType[0] === 'image') {
|
if (mimeType[0] === 'image') {
|
||||||
|
let uploaded = getUploaded();
|
||||||
uploaded.push(response.id);
|
uploaded.push(response.id);
|
||||||
|
|
||||||
$('.media-selected-wrapper').load(
|
$('.media-selected-wrapper').load(
|
||||||
@ -84,9 +87,11 @@ $(function () {
|
|||||||
file.previewElement.querySelector('[data-dz-uploadprogress]').setAttribute('class', 'progress progress-success');
|
file.previewElement.querySelector('[data-dz-uploadprogress]').setAttribute('class', 'progress progress-success');
|
||||||
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
|
|
||||||
addAppendByData(uploaded[0])
|
addAppendByData(uploaded[0])
|
||||||
file.previewElement.remove();
|
file.previewElement.remove();
|
||||||
|
|
||||||
|
// Dispatch the event.
|
||||||
|
document.querySelector('#mediaSelectedWrapper').dispatchEvent(event);
|
||||||
}, 500);
|
}, 500);
|
||||||
} else {
|
} else {
|
||||||
if (doc_input.length) {
|
if (doc_input.length) {
|
||||||
@ -126,6 +131,7 @@ function addAppendByData(data_id) {
|
|||||||
function deleteImage(e, id) {
|
function deleteImage(e, id) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
||||||
|
let uploaded = getUploaded();
|
||||||
var key_item = $.inArray(id, uploaded);
|
var key_item = $.inArray(id, uploaded);
|
||||||
uploaded.splice(key_item, 1);
|
uploaded.splice(key_item, 1);
|
||||||
$('input[name="files"]').val(uploaded.join(','))
|
$('input[name="files"]').val(uploaded.join(','))
|
||||||
@ -163,6 +169,8 @@ function rotateImage(e, id) {
|
|||||||
function setMain(e, id) {
|
function setMain(e, id) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
||||||
|
let uploaded = getUploaded();
|
||||||
|
|
||||||
$('.main-image').remove();
|
$('.main-image').remove();
|
||||||
var key_item = $.inArray(id, uploaded);
|
var key_item = $.inArray(id, uploaded);
|
||||||
uploaded.splice(key_item, 1);
|
uploaded.splice(key_item, 1);
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
<input type="hidden" name="{{ field_type.input_name }}"
|
<input type="hidden" name="{{ field_type.input_name }}"
|
||||||
value="{{ field_type.ids|join(',') }}" {{ html_attributes(field_type.attributes) }} {{ field_type.disabled ? 'disabled' }} {{ field_type.readonly ? 'readonly' }}>
|
value="{{ field_type.ids|join(',') }}" {{ html_attributes(field_type.attributes) }} {{ field_type.disabled ? 'disabled' }} {{ field_type.readonly ? 'readonly' }}>
|
||||||
|
|
||||||
<div class="selected media-selected-wrapper">
|
<div class="selected media-selected-wrapper" id="mediaSelectedWrapper">
|
||||||
{{ field_type.value_table|raw }}
|
{{ field_type.value_table|raw }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user