mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
completed advanced update for ads
This commit is contained in:
parent
197ff72e2f
commit
fefa061e4e
@ -16,7 +16,17 @@ var getUrlParameter = function getUrlParameter(sParam) {
|
||||
|
||||
if (getUrlParameter('view') === "advanced") {
|
||||
$('.fast-update').on('change', function () {
|
||||
var value = $(this).val(), entry_id = $(this).data('entry_id'), column = $(this).data('column');
|
||||
alert(value,entry_id,column);
|
||||
var advanced_value = $(this).val(), advanced_entry_id = $(this).data('entry_id'),
|
||||
advanced_column = $(this).data('column'), advanced_type = $(this).attr('type');
|
||||
|
||||
if (advanced_type === "checkbox") {
|
||||
advanced_value = ($(this).prop('checked')) ? 1 : 0;
|
||||
}
|
||||
|
||||
crudAjax({
|
||||
'advanced_column': advanced_column,
|
||||
'advanced_entry_id': advanced_entry_id,
|
||||
'advanced_value': advanced_value
|
||||
}, advanced_update_url, 'POST')
|
||||
})
|
||||
}
|
||||
@ -85,3 +85,6 @@
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<script>
|
||||
var advanced_update_url = "{{ url_route('visiosoft.module.advs::ajax_advanced_update') }}";
|
||||
</script>
|
||||
|
||||
@ -64,9 +64,27 @@ class AdvTableColumns
|
||||
|
||||
if ($builder->isActiveView('advanced')) {
|
||||
|
||||
unset($columns['created_by'], $columns['country']);
|
||||
$columns['is_get_adv'] = [
|
||||
'attributes' => [
|
||||
'html' => function (EntryModel $entry) {
|
||||
$checked = ($entry->is_get_adv) ? 'checked' : '';
|
||||
return '<input style="min-width:120px" type="checkbox" class="form-control fast-update" ' . $checked . ' data-column="is_get_adv" data-entry_id="' . $entry->getId() . '">';
|
||||
}
|
||||
],
|
||||
'class' => 'advs-price',
|
||||
];
|
||||
$columns['standard_price'] = [
|
||||
'attributes' => [
|
||||
'html' => function (EntryModel $entry) {
|
||||
return '<input style="min-width:120px" type="number" min="0" class="form-control fast-update" value="' . $entry->standard_price . '" data-column="standard_price" data-entry_id="' . $entry->getId() . '">';
|
||||
}
|
||||
],
|
||||
'class' => 'advs-price',
|
||||
];
|
||||
$columns['price']['attributes'] = [
|
||||
'html' => function (EntryModel $entry) {
|
||||
return '<input style="min-width:120px" type="text" class="form-control fast-update" value="' . $entry->price . '" data-column="price" data-entry_id="' . $entry->getId() . '">';
|
||||
return '<input style="min-width:120px" type="number" min="0" class="form-control fast-update" value="' . $entry->price . '" data-column="price" data-entry_id="' . $entry->getId() . '">';
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
@ -46,6 +46,10 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
|
||||
'uses' => 'Visiosoft\AdvsModule\Http\Controller\Admin\AdvsController@assetsClear',
|
||||
],
|
||||
'admin/advs-users/choose/{advId}' => 'Visiosoft\AdvsModule\Http\Controller\Admin\AdvsController@choose',
|
||||
'admin/advs/ajax/advanced/advanced-update' => [
|
||||
'as' => 'visiosoft.module.advs::ajax_advanced_update',
|
||||
'uses' => 'Visiosoft\AdvsModule\Http\Controller\Admin\AdvsController@advancedUpdate',
|
||||
],
|
||||
'admin/class/actions/{id}/{type}' => 'Visiosoft\AdvsModule\Http\Controller\Admin\AdvsController@actions',
|
||||
|
||||
|
||||
|
||||
@ -205,10 +205,8 @@ class AdvsController extends AdminController
|
||||
return Excel::download(new AdvsExport(), 'advs-' . time() . '.xlsx');
|
||||
}
|
||||
|
||||
public function advancedEdit()
|
||||
public function advancedUpdate()
|
||||
{
|
||||
$available_colmuns
|
||||
if()
|
||||
if ($this->request->has('advanced_column') and $this->request->has('advanced_entry_id') and $this->request->has('advanced_value')) {
|
||||
$entry_id = $this->request->get('advanced_entry_id');
|
||||
$column = $this->request->get('advanced_column');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user