mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-24 22:11:01 -06:00
Merge branch 'bulkprice' of https://github.com/openclassify/openclassify
This commit is contained in:
commit
197ff72e2f
@ -0,0 +1,22 @@
|
|||||||
|
var getUrlParameter = function getUrlParameter(sParam) {
|
||||||
|
var sPageURL = window.location.search.substring(1),
|
||||||
|
sURLVariables = sPageURL.split('&'),
|
||||||
|
sParameterName,
|
||||||
|
i;
|
||||||
|
|
||||||
|
for (i = 0; i < sURLVariables.length; i++) {
|
||||||
|
sParameterName = sURLVariables[i].split('=');
|
||||||
|
|
||||||
|
if (sParameterName[0] === sParam) {
|
||||||
|
return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
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);
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -2,4 +2,5 @@
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
'unfinished' => 'Unfinished',
|
'unfinished' => 'Unfinished',
|
||||||
|
'advanced' => 'Advanced',
|
||||||
];
|
];
|
||||||
|
|||||||
@ -2,4 +2,5 @@
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
'unfinished' => 'Bitmemiş',
|
'unfinished' => 'Bitmemiş',
|
||||||
|
'advanced' => 'Gelişmiş',
|
||||||
];
|
];
|
||||||
|
|||||||
@ -0,0 +1,87 @@
|
|||||||
|
{{ asset_add("scripts.js", "streams::js/table/table.js") }}
|
||||||
|
|
||||||
|
{% if not actions.empty() %}
|
||||||
|
{{ asset_add("scripts.js", "streams::js/table/actions.js") }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if table.options.sortable %}
|
||||||
|
{{ asset_add("scripts.js", "streams::js/table/sortable.js") }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<div class="{{ table.options.container_class ?: 'container-fluid' }}">
|
||||||
|
|
||||||
|
{{ view("streams::table/partials/filters", {'table': table}) }}
|
||||||
|
{{ view("streams::table/partials/views", {'table': table}) }}
|
||||||
|
|
||||||
|
{{ view(table.options.heading ?: "streams::table/partials/heading", {'table': table}) }}
|
||||||
|
|
||||||
|
{% if not table.rows.empty() %}
|
||||||
|
{% block card %}
|
||||||
|
<div class="card">
|
||||||
|
|
||||||
|
{{ form_open({ 'url': url_full() }) }}
|
||||||
|
<div class="table-stack">
|
||||||
|
<table
|
||||||
|
class="
|
||||||
|
{{ table.options.class ?: 'table' }}
|
||||||
|
{{ table.options.sortable ? 'table--sortable' }}
|
||||||
|
"
|
||||||
|
{{ table.options.sortable ? 'data-sortable' }}
|
||||||
|
{{ html_attributes(table.options.attributes) }}>
|
||||||
|
|
||||||
|
{{ view("streams::table/partials/header", {'table': table}) }}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<tbody>
|
||||||
|
{% for row in table.rows %}
|
||||||
|
<tr id="{{ loop.index }}" class="{{ row.class }}">
|
||||||
|
|
||||||
|
{% if table.options.sortable %}
|
||||||
|
<td>
|
||||||
|
{{ icon('fa fa-arrows handle') }}
|
||||||
|
<input type="hidden" name="{{ row.table.options.prefix }}order[]" value="{{ row.key }}"/>
|
||||||
|
</td>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if not table.actions.empty() %}
|
||||||
|
<td>
|
||||||
|
<input type="checkbox" data-toggle="action" name="{{ row.table.options.prefix }}id[]" value="{{ row.key }}"/>
|
||||||
|
</td>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% for column in row.columns %}
|
||||||
|
<td data-title="{{ trans(column.heading) }}"
|
||||||
|
class="{{ column.class }}" {{ html_attributes(column.attributes) }}>
|
||||||
|
{{ (column.attributes.html) ? column.attributes.html|raw : column.value|raw }}
|
||||||
|
</td>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
<td class="text-lg-right">
|
||||||
|
<nobr>{{ buttons(row.buttons)|raw }}</nobr>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{{ view("streams::table/partials/footer", {'table': table}) }}
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
{{ form_close() }}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
{% block no_results %}
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-block card-body">
|
||||||
|
{{ trans(table.options.get('no_results_message', 'streams::message.no_results')) }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
@ -19,6 +19,11 @@ class AdvTableBuilder extends TableBuilder
|
|||||||
'slug' => 'all',
|
'slug' => 'all',
|
||||||
'text' => 'streams::view.all',
|
'text' => 'streams::view.all',
|
||||||
],
|
],
|
||||||
|
'advanced' => [
|
||||||
|
'view' => All::class,
|
||||||
|
'slug' => 'advanced',
|
||||||
|
'text' => 'module::view.advanced',
|
||||||
|
],
|
||||||
'trash',
|
'trash',
|
||||||
'unfinished' => [
|
'unfinished' => [
|
||||||
'view' => unfinished::class
|
'view' => unfinished::class
|
||||||
@ -74,6 +79,7 @@ class AdvTableBuilder extends TableBuilder
|
|||||||
'order_by' => [
|
'order_by' => [
|
||||||
'id' => 'DESC',
|
'id' => 'DESC',
|
||||||
],
|
],
|
||||||
|
'table_view' => 'visiosoft.module.advs::admin/table/table'
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -81,6 +87,10 @@ class AdvTableBuilder extends TableBuilder
|
|||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $assets = [];
|
protected $assets = [
|
||||||
|
'scripts.js' => [
|
||||||
|
'visiosoft.module.advs::js/admin/advanced.js'
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<?php namespace Visiosoft\AdvsModule\Adv\Table;
|
<?php namespace Visiosoft\AdvsModule\Adv\Table;
|
||||||
|
|
||||||
use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
|
use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
|
||||||
|
use Anomaly\Streams\Platform\Entry\EntryModel;
|
||||||
use Visiosoft\CatsModule\Category\CategoryModel;
|
use Visiosoft\CatsModule\Category\CategoryModel;
|
||||||
|
|
||||||
class AdvTableColumns
|
class AdvTableColumns
|
||||||
@ -8,11 +9,11 @@ class AdvTableColumns
|
|||||||
|
|
||||||
public function handle(AdvTableBuilder $builder)
|
public function handle(AdvTableBuilder $builder)
|
||||||
{
|
{
|
||||||
$builder->setColumns([
|
$columns = [
|
||||||
'cover_photo' => [
|
'cover_photo' => [
|
||||||
'value' => function (EntryInterface $entry) {
|
'value' => function (EntryInterface $entry) {
|
||||||
return "<img width='80px' src='" . $entry->AddAdsDefaultCoverImage($entry)->cover_photo . "' >";
|
return "<img width='80px' src='" . $entry->AddAdsDefaultCoverImage($entry)->cover_photo . "' >";
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
'name' => [
|
'name' => [
|
||||||
@ -59,7 +60,18 @@ class AdvTableColumns
|
|||||||
'created_by' => [
|
'created_by' => [
|
||||||
'value' => 'entry.created_by.name',
|
'value' => 'entry.created_by.name',
|
||||||
],
|
],
|
||||||
]);
|
];
|
||||||
|
|
||||||
|
if ($builder->isActiveView('advanced')) {
|
||||||
|
|
||||||
|
$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() . '">';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$builder->setColumns($columns);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,21 @@
|
|||||||
|
<?php namespace Visiosoft\AdvsModule\Adv\Table\Views;
|
||||||
|
|
||||||
|
use Anomaly\Streams\Platform\Ui\Table\Component\View\Query\AllQuery;
|
||||||
|
use Anomaly\Streams\Platform\Ui\Table\Component\View\View;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
|
||||||
|
class Advanced extends View
|
||||||
|
{
|
||||||
|
|
||||||
|
protected $slug = 'advanced';
|
||||||
|
|
||||||
|
protected $text = 'visiosoft.module.advs::view.advanced';
|
||||||
|
|
||||||
|
protected $query = AllQuery::class;
|
||||||
|
|
||||||
|
public function onQuerying(Builder $query)
|
||||||
|
{
|
||||||
|
$query->where('slug', "");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -204,4 +204,19 @@ class AdvsController extends AdminController
|
|||||||
{
|
{
|
||||||
return Excel::download(new AdvsExport(), 'advs-' . time() . '.xlsx');
|
return Excel::download(new AdvsExport(), 'advs-' . time() . '.xlsx');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function advancedEdit()
|
||||||
|
{
|
||||||
|
$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');
|
||||||
|
$value = $this->request->get('advanced_value');
|
||||||
|
if ($entry = $this->advRepository->find($entry_id)) {
|
||||||
|
$entry->setAttribute($column, $value);
|
||||||
|
$entry->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user