mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -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',
|
||||
'delete',
|
||||
],
|
||||
'categories' => [
|
||||
'read',
|
||||
'write',
|
||||
'delete',
|
||||
],
|
||||
'village' => [
|
||||
'read',
|
||||
'write',
|
||||
'delete',
|
||||
],
|
||||
'options' => [
|
||||
'read',
|
||||
'write',
|
||||
'delete',
|
||||
],
|
||||
'productoptions' => [
|
||||
'read',
|
||||
'write',
|
||||
@ -31,16 +16,6 @@ return [
|
||||
'write',
|
||||
'delete',
|
||||
],
|
||||
'options_configuration' => [
|
||||
'read',
|
||||
'write',
|
||||
'delete',
|
||||
],
|
||||
'option_configuration' => [
|
||||
'read',
|
||||
'write',
|
||||
'delete',
|
||||
],
|
||||
'option_configuration' => [
|
||||
'read',
|
||||
'write',
|
||||
|
||||
@ -64,3 +64,7 @@
|
||||
.input-group-addon input[type=checkbox] {
|
||||
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',
|
||||
'undefined_page' => 'Undefined Page',
|
||||
'id' => 'ID',
|
||||
'custom_field' => 'Custom Field',
|
||||
];
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
<style>
|
||||
{{ asset_inline("visiosoft.module.advs::css/new-create.css") }}
|
||||
{{ asset_inline("visiosoft.module.advs::css/new-create-new.scss") }}
|
||||
{{ asset_inline("visiosoft.theme.base::css/jquery-ui.min.css") }}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
@ -344,5 +345,6 @@
|
||||
{{ 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/translations.js") }}
|
||||
{{ asset_add("scripts.js", "visiosoft.theme.base::js/vendor/jquery-ui.min.js") }}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@ -11,10 +11,10 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="">
|
||||
<div class="flex-row">
|
||||
{% 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>
|
||||
{{ configurationForm.fields|raw }}
|
||||
<button type="submit" class="btn btn-primary btn-configuration my-auto form-control w-auto">
|
||||
|
||||
@ -74,6 +74,9 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
||||
$query = $query->where('city', $city->id);
|
||||
} elseif (isset($param['city']) and !empty(array_filter($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']))) {
|
||||
$query = $query->whereIn('district', explode(',', array_first($param['district'])));
|
||||
|
||||
@ -25,7 +25,7 @@ class OptionConfigurationFormFields
|
||||
|
||||
foreach ($options as $option)
|
||||
{
|
||||
if($optionValue = $productoptionsValueRepository->getWithOptionsId([$option->id]))
|
||||
if($productoptionsValueRepository->getWithOptionsId([$option->id]))
|
||||
{
|
||||
$options_fields['option-'.$option->getId()] = [
|
||||
'type' => 'anomaly.field_type.select',
|
||||
@ -35,14 +35,18 @@ class OptionConfigurationFormFields
|
||||
'attributes' => [
|
||||
'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']);
|
||||
|
||||
$builder->setFields($fields);
|
||||
|
||||
@ -19,7 +19,7 @@ class OptionConfigurationFormHandler
|
||||
$option_json = array();
|
||||
|
||||
foreach ($parameters as $key => $parameter_value) {
|
||||
if (substr($key, 0, 7) === "option-") {
|
||||
if (strpos($key, "option-") === 0) {
|
||||
$option_id = substr($key, 7);
|
||||
$option_json[$option_id] = $parameter_value;
|
||||
unset($parameters[$key]);
|
||||
|
||||
@ -29,6 +29,8 @@ class OptionConfigurationModel extends AdvsOptionConfigurationEntryModel impleme
|
||||
|
||||
$name = trim($option_group_value, ' ');
|
||||
|
||||
$name .= ' ' . $this->custom_option;
|
||||
|
||||
return ($add_name) ? $adv->name . ' | ' . $name : $name;
|
||||
}
|
||||
return null;
|
||||
|
||||
@ -62,6 +62,8 @@ class OptionConfigurationRepository extends EntryRepository implements OptionCon
|
||||
$value_entry = $this->productOptionsValueRepository->find($value);
|
||||
$option_group_value .= " " . $value_entry->getName();
|
||||
}
|
||||
$option_group_value .= " " . $product_configuration->custom_option;
|
||||
|
||||
$configurations[$product_configuration->getId()] = [
|
||||
'name' => $option_group_value,
|
||||
'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">
|
||||
{% 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 %}
|
||||
{{ img('theme::img/login-icon.svg').data|raw }}
|
||||
{% endif %}
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
<div class="logo">
|
||||
{% 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 %}
|
||||
{{ img('theme::img/login-icon.svg').data|raw }}
|
||||
{% endif %}
|
||||
|
||||
@ -1,6 +1,26 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'countries' => [
|
||||
'read',
|
||||
'write',
|
||||
'delete',
|
||||
],
|
||||
'cities' => [
|
||||
'read',
|
||||
'write',
|
||||
'delete',
|
||||
],
|
||||
'districts' => [
|
||||
'read',
|
||||
'write',
|
||||
'delete',
|
||||
],
|
||||
'neighborhoods' => [
|
||||
'read',
|
||||
'write',
|
||||
'delete',
|
||||
],
|
||||
'village' => [
|
||||
'read',
|
||||
'write',
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
// Add dropzone change event
|
||||
const event = new Event('dropzone.changed');
|
||||
|
||||
// Disabling autoDiscover, otherwise Dropzone will try to attach twice.
|
||||
Dropzone.autoDiscover = false;
|
||||
$("div#myDrop").dropzone({url: "/file/post"});
|
||||
|
||||
var doc_input = $('input[name="doc_files"]');
|
||||
|
||||
|
||||
var uploaded = $('input[name="files"]').val().split(',').map(Number);
|
||||
const getUploaded = () => $('input[name="files"]').val().split(',').map(Number);
|
||||
|
||||
if (doc_input.length) {
|
||||
var docsUploaded = doc_input.val().split(',').map(Number);
|
||||
@ -72,6 +74,7 @@ $(function () {
|
||||
var response = JSON.parse(file.xhr.response);
|
||||
var mimeType = response.mime_type.split('/')
|
||||
if (mimeType[0] === 'image') {
|
||||
let uploaded = getUploaded();
|
||||
uploaded.push(response.id);
|
||||
|
||||
$('.media-selected-wrapper').load(
|
||||
@ -84,9 +87,11 @@ $(function () {
|
||||
file.previewElement.querySelector('[data-dz-uploadprogress]').setAttribute('class', 'progress progress-success');
|
||||
|
||||
setTimeout(function () {
|
||||
|
||||
addAppendByData(uploaded[0])
|
||||
file.previewElement.remove();
|
||||
|
||||
// Dispatch the event.
|
||||
document.querySelector('#mediaSelectedWrapper').dispatchEvent(event);
|
||||
}, 500);
|
||||
} else {
|
||||
if (doc_input.length) {
|
||||
@ -126,6 +131,7 @@ function addAppendByData(data_id) {
|
||||
function deleteImage(e, id) {
|
||||
e.preventDefault()
|
||||
|
||||
let uploaded = getUploaded();
|
||||
var key_item = $.inArray(id, uploaded);
|
||||
uploaded.splice(key_item, 1);
|
||||
$('input[name="files"]').val(uploaded.join(','))
|
||||
@ -163,6 +169,8 @@ function rotateImage(e, id) {
|
||||
function setMain(e, id) {
|
||||
e.preventDefault()
|
||||
|
||||
let uploaded = getUploaded();
|
||||
|
||||
$('.main-image').remove();
|
||||
var key_item = $.inArray(id, uploaded);
|
||||
uploaded.splice(key_item, 1);
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<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' }}>
|
||||
|
||||
<div class="selected media-selected-wrapper">
|
||||
<div class="selected media-selected-wrapper" id="mediaSelectedWrapper">
|
||||
{{ field_type.value_table|raw }}
|
||||
</div>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user