Fixes on unities, remove old code
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\DataTables;
|
namespace App\Datatables;
|
||||||
|
|
||||||
use Yajra\DataTables\Html\Button;
|
use Yajra\DataTables\Html\Button;
|
||||||
use Yajra\DataTables\Html\Column;
|
use Yajra\DataTables\Html\Column;
|
||||||
@@ -10,172 +10,195 @@ use Yajra\DataTables\Services\DataTable;
|
|||||||
|
|
||||||
class ParentDataTable extends DataTable
|
class ParentDataTable extends DataTable
|
||||||
{
|
{
|
||||||
public $rowReorder; // ['selector' => 'tr']
|
public $rowReorder = true;
|
||||||
public $colReorder = true;
|
public $rowReorderSelector; // ['selector' => 'tr']
|
||||||
public $fixedColumns = false;
|
public $colReorder = false;
|
||||||
|
public $fixedColumns = false;
|
||||||
|
public $scrollX = false;
|
||||||
|
public $scrollCollapse = true;
|
||||||
|
public $sortedColumn = 0;
|
||||||
|
public $sortedOrder = 'asc';
|
||||||
|
public $stateSave = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build DataTable class.
|
* Build DataTable class.
|
||||||
*
|
*
|
||||||
* @param mixed $query Results from query() method.
|
* @param mixed $query Results from query() method.
|
||||||
* @return \Yajra\DataTables\DataTableAbstract
|
* @return \Yajra\DataTables\DataTableAbstract
|
||||||
*/
|
*/
|
||||||
public function dataTable($query)
|
public function dataTable($query)
|
||||||
{
|
{
|
||||||
return $this->modifier(datatables()->eloquent($query));
|
return $this->modifier(datatables()->eloquent($query));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function modifier($datatables)
|
public function modifier($datatables)
|
||||||
{
|
{
|
||||||
return $this->addButtons($datatables->setRowId('{{$id}}'));
|
return $this->addButtons($datatables->setRowId('{{$id}}'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add buttons DataTable class.
|
* Add buttons DataTable class.
|
||||||
*
|
*
|
||||||
* @param mixed $query Results from query() method.
|
* @param mixed $query Results from query() method.
|
||||||
* @return \Yajra\DataTables\DataTableAbstract
|
* @return \Yajra\DataTables\DataTableAbstract
|
||||||
*/
|
*/
|
||||||
public function addButtons($datatables)
|
public function addButtons($datatables)
|
||||||
{
|
{
|
||||||
return $datatables->addColumn('action', $this->getHtmlButtons());
|
return $datatables->addColumn('action', $this->getHtmlButtons());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getHtmlButtons()
|
public function getHtmlButtons()
|
||||||
{
|
{
|
||||||
$buttons = '';
|
$buttons = '';
|
||||||
|
|
||||||
// $buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-secondary btn-show mr-2"><i class="fa fa-fw fa-eye"></i></button>';
|
// $buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-secondary btn-show mr-2"><i class="fa fa-fw fa-eye"></i></button>';
|
||||||
// $buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-primary btn-edit mr-2"><i class="fa fa-fw fa-leaf-alt"></i></button>';
|
// $buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-primary btn-edit mr-2"><i class="fa fa-fw fa-leaf-alt"></i></button>';
|
||||||
$buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-primary btn-edit mr-2"><i class="fa fa-fw fa-pencil-alt"></i></button>';
|
$buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-primary btn-edit mr-2"><i class="fa fa-fw fa-pencil-alt"></i></button>';
|
||||||
$buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-danger btn-del"><i class="fa fa-fw fa-trash"></i></button>';
|
$buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-danger btn-del"><i class="fa fa-fw fa-trash"></i></button>';
|
||||||
return $buttons;
|
return $buttons;
|
||||||
// return view('components.datatables.buttons.row_action');
|
// return view('components.datatables.buttons.row_action');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function makeColumnButtons()
|
public function makeColumnButtons()
|
||||||
{
|
{
|
||||||
return Column::computed('action')
|
return Column::computed('action')
|
||||||
->title('')
|
->title('')
|
||||||
->exportable(false)
|
->exportable(false)
|
||||||
->printable(false)
|
->printable(false)
|
||||||
->searchable(false)
|
->searchable(false)
|
||||||
->addClass('text-center text-nowrap');
|
->width("74")
|
||||||
}
|
->addClass('text-center text-nowrap');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
public static function isFilteredByField($field)
|
||||||
* Get query source of dataTable.
|
{
|
||||||
*
|
return (request()->has('filters.' . $field)) ? request()->input('filters.'. $field) : (request()->has($field) ? request()->input($field) : false);
|
||||||
* @param \App\Family $model
|
}
|
||||||
* @return \Illuminate\Database\Eloquent\Builder
|
|
||||||
*/
|
|
||||||
public function buildQuery($model)
|
|
||||||
{
|
|
||||||
return $model->newQuery();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optional method if you want to use html builder.
|
|
||||||
*
|
|
||||||
* @return \Yajra\DataTables\Html\Builder
|
|
||||||
*/
|
|
||||||
public function html()
|
|
||||||
{
|
|
||||||
return $this->buildHtml(strtolower($this->model_name) . '-table');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Optional method if you want to use html builder.
|
* Get query source of dataTable.
|
||||||
*
|
*
|
||||||
* @return \Yajra\DataTables\Html\Builder
|
* @param \App\Family $model
|
||||||
*/
|
* @return \Illuminate\Database\Eloquent\Builder
|
||||||
public function buildHtml($id)
|
*/
|
||||||
{
|
public function buildQuery($model)
|
||||||
return $this->builder()
|
{
|
||||||
->setTableId($id)
|
return $model->newQuery();
|
||||||
->parameters($this->getParameters())
|
}
|
||||||
->columns($this->getColumns())
|
|
||||||
->ajax(['data' => "function(d) { d.filters = $('#filters').serializeJSON(); }"])
|
/**
|
||||||
->dom($this->getDom())
|
* Optional method if you want to use html builder.
|
||||||
->orderBy(0,'asc')
|
*
|
||||||
->buttons($this->getButtons());
|
* @return \Yajra\DataTables\Html\Builder
|
||||||
}
|
*/
|
||||||
|
public function html()
|
||||||
|
{
|
||||||
|
return $this->buildHtml(strtolower($this->model_name) . '-table');
|
||||||
|
}
|
||||||
|
|
||||||
public function getButtons() {
|
/**
|
||||||
return [
|
* Optional method if you want to use html builder.
|
||||||
Button::make('export'),
|
*
|
||||||
Button::make('print'),
|
* @return \Yajra\DataTables\Html\Builder
|
||||||
Button::make('colvis'),
|
*/
|
||||||
Button::make('columnsToggle')
|
public function buildHtml($table_id = false, $selector = false)
|
||||||
];
|
{
|
||||||
}
|
$table_id = $table_id ? $table_id : strtolower($this->model_name) . '-table';
|
||||||
|
$selector = $selector ? $selector : '#' . $this->model_name . '-filters';
|
||||||
|
return $this->builder()
|
||||||
|
->setTableId($table_id)
|
||||||
|
->parameters($this->getParameters())
|
||||||
|
->columns($this->getColumns())
|
||||||
|
->ajax([
|
||||||
|
'data' => 'function(d) { d.filters = $("' . $selector . '").serializeJSON(); }',
|
||||||
|
'url' => isset($this->url) ? $this->url : ''
|
||||||
|
])
|
||||||
|
->dom($this->getDom())
|
||||||
|
->orderBy($this->sortedColumn,$this->sortedOrder)
|
||||||
|
->buttons($this->getButtons());
|
||||||
|
}
|
||||||
|
|
||||||
public function getParameters()
|
public function getButtons() {
|
||||||
{
|
return [
|
||||||
return [
|
Button::make('export'),
|
||||||
'pageLength' => 5,
|
Button::make('print'),
|
||||||
'scrollX' => true,
|
Button::make('colvis'),
|
||||||
'scrollCollapse' => true,
|
Button::make('columnsToggle')
|
||||||
'colReorder' => $this->colReorder,
|
];
|
||||||
'rowReorder' => $this->rowReorder,
|
}
|
||||||
'fixedColumns' => $this->fixedColumns,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDom()
|
public function getParameters()
|
||||||
{
|
{
|
||||||
$dom = '';
|
$data = [
|
||||||
// $dom .= $this->getDatatablesHeaderDefault();
|
'pageLength' => 5,
|
||||||
$dom .= "rt";
|
'scrollX' => $this->scrollX,
|
||||||
$dom .= $this->getDatatablesFooterDefault();
|
'scrollCollapse' => $this->scrollCollapse,
|
||||||
return $dom;
|
'searchDelay' => 500,
|
||||||
}
|
'colReorder' => $this->colReorder,
|
||||||
|
'fixedColumns' => $this->fixedColumns,
|
||||||
|
// 'autoWidth' => false,
|
||||||
|
'stateSave' => $this->stateSave
|
||||||
|
];
|
||||||
|
if ($this->rowReorder) {
|
||||||
|
$data['rowReorder'] = ['selector' => $this->rowReorderSelector];
|
||||||
|
}
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDatatablesHeader() {
|
public function getDom()
|
||||||
return view('components.datatables.header');
|
{
|
||||||
}
|
$dom = '';
|
||||||
|
// $dom .= $this->getDatatablesHeaderDefault();
|
||||||
|
$dom .= "rt";
|
||||||
|
$dom .= $this->getDatatablesFooterDefault();
|
||||||
|
return $dom;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDatatablesHeaderDefault() {
|
public function getDatatablesHeader() {
|
||||||
// return "<div class'row'><div class='col'></div></div>";
|
return view('components.datatables.header');
|
||||||
/*
|
}
|
||||||
|
|
||||||
$dom = 't<"row datatable-pager light"<"col-md-12"'
|
|
||||||
. '<"datatable-more-export-buttons filter-buttons pull-left">'
|
|
||||||
. '<"datatable-more-export-favorites-buttons filter-buttons pull-left">'
|
|
||||||
. '<"datatable-more-export-basket-buttons filter-buttons pull-left">'
|
|
||||||
. '<"datatable-download-buttons filter-buttons pull-left">'
|
|
||||||
. '>>'
|
|
||||||
. '<"dt-toolbar-footer"<"col"i><"col pull-right datatable-pager light nopadding-right"p>>';
|
|
||||||
|
|
||||||
*/
|
public function getDatatablesHeaderDefault() {
|
||||||
|
// return "<div class'row'><div class='col'></div></div>";
|
||||||
$dom = "<'row dt-toolbar-header'<'col-lg-4'l><'col-lg-4'B><'col-lg-4 text-right add'f>>";
|
/*
|
||||||
return $dom;
|
|
||||||
// return 't<"row datatable-pager light"<"col-md-12"<"datatable-more-export-buttons filter-buttons pull-left"><"datatable-more-export-favorites-buttons filter-buttons pull-left"><"datatable-more-export-basket-buttons filter-buttons pull-left"><"datatable-download-buttons filter-buttons pull-left">>><"dt-toolbar-footer"<"col-md-6"i><"col-md-6 pull-right datatable-pager light nopadding-right"p>>';
|
$dom = 't<"row datatable-pager light"<"col-md-12"'
|
||||||
|
. '<"datatable-more-export-buttons filter-buttons pull-left">'
|
||||||
|
. '<"datatable-more-export-favorites-buttons filter-buttons pull-left">'
|
||||||
|
. '<"datatable-more-export-basket-buttons filter-buttons pull-left">'
|
||||||
|
. '<"datatable-download-buttons filter-buttons pull-left">'
|
||||||
|
. '>>'
|
||||||
|
. '<"dt-toolbar-footer"<"col"i><"col pull-right datatable-pager light nopadding-right"p>>';
|
||||||
|
|
||||||
}
|
*/
|
||||||
|
|
||||||
|
$dom = "<'row dt-toolbar-header'<'col-lg-4'l><'col-lg-4'B><'col-lg-4 text-right add'f>>";
|
||||||
|
return $dom;
|
||||||
|
// return 't<"row datatable-pager light"<"col-md-12"<"datatable-more-export-buttons filter-buttons pull-left"><"datatable-more-export-favorites-buttons filter-buttons pull-left"><"datatable-more-export-basket-buttons filter-buttons pull-left"><"datatable-download-buttons filter-buttons pull-left">>><"dt-toolbar-footer"<"col-md-6"i><"col-md-6 pull-right datatable-pager light nopadding-right"p>>';
|
||||||
|
|
||||||
public function getDatatablesFooterDefault() {
|
}
|
||||||
return "<'row pt-3 dt-toolbar-footer'<'col-md-6'i><'col-md-6'p>>";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
public function getDatatablesFooterDefault() {
|
||||||
* Get filename for export.
|
return "<'row pt-3 dt-toolbar-footer'<'col-md-6'i><'col-md-6'p>>";
|
||||||
*
|
}
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function filename()
|
|
||||||
{
|
|
||||||
return self::buildFilename($this->model_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get filename for export.
|
* Get filename for export.
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function buildFilename($name)
|
protected function filename()
|
||||||
{
|
{
|
||||||
return $name . '_' . date('YmdHis');
|
return self::buildFilename($this->model_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get filename for export.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
protected function buildFilename($name)
|
||||||
|
{
|
||||||
|
return $name . '_' . date('YmdHis');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -13,9 +13,16 @@ class UnitiesDataTable extends DataTable
|
|||||||
public function query(Unity $model)
|
public function query(Unity $model)
|
||||||
{
|
{
|
||||||
$model = $model::with(['package.article_family'])->select('shop_unities.*');
|
$model = $model::with(['package.article_family'])->select('shop_unities.*');
|
||||||
|
$model = self::filterByFamily($model);
|
||||||
return self::buildQuery($model);
|
return self::buildQuery($model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function filterByFamily($model, $family_id = false)
|
||||||
|
{
|
||||||
|
$family_id = $family_id ? $family_id : self::isFilteredByField('family_id');
|
||||||
|
return $family_id ? $model->byArticleFamily($family_id) : $model;
|
||||||
|
}
|
||||||
|
|
||||||
protected function getColumns()
|
protected function getColumns()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ namespace App\Http\Controllers\Shop\Admin;
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
|
use App\Repositories\Shop\ArticleFamilies;
|
||||||
use App\Repositories\Shop\Packages;
|
use App\Repositories\Shop\Packages;
|
||||||
use App\Repositories\Shop\Unities;
|
use App\Repositories\Shop\Unities;
|
||||||
use App\DataTables\Shop\UnitiesDataTable;
|
use App\DataTables\Shop\UnitiesDataTable;
|
||||||
@@ -13,6 +14,7 @@ class UnityController extends Controller
|
|||||||
{
|
{
|
||||||
public function index(UnitiesDataTable $dataTable)
|
public function index(UnitiesDataTable $dataTable)
|
||||||
{
|
{
|
||||||
|
$data['families'] = ArticleFamilies::getOptions();
|
||||||
$data['packages'] = Packages::getOptions();
|
$data['packages'] = Packages::getOptions();
|
||||||
return $dataTable->render('Shop.Admin.Unities.list', $data);
|
return $dataTable->render('Shop.Admin.Unities.list', $data);
|
||||||
}
|
}
|
||||||
@@ -25,7 +27,7 @@ class UnityController extends Controller
|
|||||||
public function getOptionsByPackage(Request $request)
|
public function getOptionsByPackage(Request $request)
|
||||||
{
|
{
|
||||||
$id = $request->input('package_id');
|
$id = $request->input('package_id');
|
||||||
return response()->json(Unities::getSelectByPackage($id));
|
return response()->json(Unities::getOptionsByPackage($id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create()
|
public function create()
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class Package extends Model
|
|||||||
return $this->hasMany('App\Models\Shop\Unity');
|
return $this->hasMany('App\Models\Shop\Unity');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function scopeByFamily($query, $id)
|
public function scopeByArticleFamily($query, $id)
|
||||||
{
|
{
|
||||||
return $query->where('article_family_id', $id);
|
return $query->where('article_family_id', $id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,4 +28,19 @@ class Unity extends Model
|
|||||||
{
|
{
|
||||||
return $query->where('package_id', $id);
|
return $query->where('package_id', $id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function scopeByArticleFamily($query, $id)
|
||||||
|
{
|
||||||
|
return $query->whereHas('package', function ($query) use ($id) {
|
||||||
|
$query->byArticleFamily($id);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function scopeActive($query, $active = 1)
|
||||||
|
{
|
||||||
|
return $query->whereHas('third_party', function ($query) use ($active) {
|
||||||
|
$query->active($active);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class Packages
|
|||||||
|
|
||||||
public static function getSelectByFamily($family_id)
|
public static function getSelectByFamily($family_id)
|
||||||
{
|
{
|
||||||
return Package::orderBy('value','asc')->byFamily($family_id)->pluck('value','id')->toArray();
|
return Package::orderBy('value','asc')->byArticleFamily($family_id)->pluck('value','id')->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getAll()
|
public static function getAll()
|
||||||
|
|||||||
@@ -2,68 +2,51 @@
|
|||||||
|
|
||||||
namespace App\Repositories\Shop;
|
namespace App\Repositories\Shop;
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Storage;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
use Illuminate\Support\Str;
|
|
||||||
|
|
||||||
use Yajra\DataTables\DataTables;
|
|
||||||
|
|
||||||
use App\Models\Shop\Unity;
|
use App\Models\Shop\Unity;
|
||||||
|
|
||||||
class Unities
|
class Unities
|
||||||
{
|
{
|
||||||
|
|
||||||
public static function getDatatable()
|
public static function getOptions()
|
||||||
{
|
{
|
||||||
return Datatables::of($model)->make(true);
|
return Unity::orderBy('value','asc')->get()->pluck('value','id')->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getOptions()
|
public static function getOptionsByPackage($package_id)
|
||||||
{
|
{
|
||||||
return Unity::orderBy('value','asc')->get()->pluck('value','id')->toArray();
|
return Unity::byPackage($package_id)->orderBy('value','asc')->get()->pluck('value','id')->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getSelectByPackage($package_id)
|
public static function getAll()
|
||||||
{
|
{
|
||||||
$values = Unity::byPackage($package_id)->get();
|
return Unity::orderBy('value','asc')->get();
|
||||||
$data = [];
|
}
|
||||||
foreach ($values as $value)
|
|
||||||
{
|
|
||||||
$data[] = ['id' => $value->id, 'text' => $value->value];
|
|
||||||
}
|
|
||||||
return collect($data)->sortBy('text')->values()->all();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getAll()
|
public static function get($id)
|
||||||
{
|
{
|
||||||
return Unity::orderBy('value','asc')->get();
|
return Unity::find($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function get($id)
|
public static function store($data)
|
||||||
{
|
{
|
||||||
return Unity::find($id);
|
$id = isset($data['id']) ? $data['id'] : false;
|
||||||
}
|
$item = $id ? self::update($data) : self::create($data);
|
||||||
|
return $item->id;
|
||||||
|
}
|
||||||
|
|
||||||
public static function store($data)
|
public static function create($data)
|
||||||
{
|
{
|
||||||
$id = isset($data['id']) ? $data['id'] : false;
|
return Unity::create($data);
|
||||||
$item = $id ? self::update($data) : self::create($data);
|
}
|
||||||
return $item->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function create($data)
|
public static function update($data)
|
||||||
{
|
{
|
||||||
return Unity::create($data);
|
return Unity::find($id)->update($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function update($data)
|
public static function destroy($id)
|
||||||
{
|
{
|
||||||
return Unity::find($id)->update($data);
|
return Unity::destroy($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function destroy($id)
|
|
||||||
{
|
|
||||||
return Unity::destroy($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
{{ Form::label('categories', 'Catégories') }}<br>
|
{{ Form::label('categories', 'Rayons') }}<br>
|
||||||
@include('components.select', ['name' => 'categories[]', 'list' => $categories_options, 'values' => isset($categories) ? $categories : null, 'class' => 'select2 form-control', 'multiple' => true])
|
@include('components.select', ['name' => 'categories[]', 'list' => $categories_options, 'values' => isset($categories) ? $categories : null, 'class' => 'select2 form-control', 'multiple' => true])
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,10 +10,9 @@
|
|||||||
<script>
|
<script>
|
||||||
|
|
||||||
function append_price() {
|
function append_price() {
|
||||||
// handle_append_attribute();
|
|
||||||
$('.select2').select2();
|
$('.select2').select2();
|
||||||
handle_change_package();
|
handle_change_package();
|
||||||
load_unities($('.unities'), $('.package').val());
|
load_unities($('.unities'), $('.packages').val());
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#append_price").appender({
|
$("#append_price").appender({
|
||||||
@@ -30,7 +29,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
function handle_change_package() {
|
function handle_change_package() {
|
||||||
$('.package').change( function() {
|
$('.packages').change( function() {
|
||||||
var package_id = $(this).val();
|
var package_id = $(this).val();
|
||||||
var $package = $(this);
|
var $package = $(this);
|
||||||
var $parent = $package.parent().parent();
|
var $parent = $package.parent().parent();
|
||||||
@@ -40,7 +39,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function init_unities() {
|
function init_unities() {
|
||||||
$('.package').each( function() {
|
$('.packages').each( function() {
|
||||||
var package_id = $(this).val();
|
var package_id = $(this).val();
|
||||||
var $package = $(this);
|
var $package = $(this);
|
||||||
var $parent = $package.parent().parent();
|
var $parent = $package.parent().parent();
|
||||||
@@ -91,7 +90,9 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
handle_change_package();
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
@extends('layout.index', [
|
|
||||||
'title' => __('article_attributes.title'),
|
|
||||||
'subtitle' => __('article_attributes.create.title'),
|
|
||||||
'breadcrumb' => [__('article_attributes.title'), __('article_attributes.create.title')]
|
|
||||||
])
|
|
||||||
|
|
||||||
@include('boilerplate::load.fileinput')
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
|
|
||||||
{{ Form::open(['route' => 'Shop.Admin.ArticleAttributes.store', 'id' => 'article-attribute-form', 'autocomplete' => 'off', 'files' => true]) }}
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-12 mbl">
|
|
||||||
<a href="{{ route("Shop.Admin.ArticleAttributes.index") }}" class="btn btn-default">
|
|
||||||
{{ __('article_attributes.list.title') }}
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<span class="btn-group pull-right">
|
|
||||||
@include('components.button-save')
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@include('Shop.Admin.ArticleAttributeValues.form')
|
|
||||||
</form>
|
|
||||||
|
|
||||||
@endsection
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
@extends('layout.index', [
|
|
||||||
'title' => 'Attributs d\'articles',
|
|
||||||
'subtitle' => 'Edition d\'un attribut d\'article',
|
|
||||||
'breadcrumb' => ['Articles']
|
|
||||||
])
|
|
||||||
|
|
||||||
@include('boilerplate::load.fileinput')
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
|
|
||||||
{{ Form::open(['route' => 'Shop.Admin.ArticleAttributeValues.update', 'id' => 'article-attribute-form', 'autocomplete' => 'off', 'files' => true]) }}
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-12 mbl">
|
|
||||||
<a href="{{ route("Shop.Admin.ArticleAttributeValues.index") }}" class="btn btn-default">
|
|
||||||
{{ __('article_attributes.list.title') }}
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<span class="btn-group pull-right">
|
|
||||||
@include('components.button-save')
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<input type="hidden" name="id" value="{{ $id }}">
|
|
||||||
@include('Shop.Admin.ArticleAttributeValues.form')
|
|
||||||
</form>
|
|
||||||
|
|
||||||
@endsection
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
@include('boilerplate::load.tinymce')
|
|
||||||
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-8">
|
|
||||||
{{ Form::label('name', 'Nom') }}
|
|
||||||
@include('components.input', ['name' => 'name', 'value' => (isset($family['name'])) ? $family['name'] : null, 'required' => true])
|
|
||||||
|
|
||||||
{{ Form::label('description', 'Description') }}
|
|
||||||
@include('components.textarea', ['name' => 'description', 'value' => isset($description) ? $description : null, 'class' => 'editor', 'required' => false])
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-8">
|
|
||||||
<div class="float-right mt-3">
|
|
||||||
@include('components.button-save')
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@push('js')
|
|
||||||
<script>
|
|
||||||
$(function() {
|
|
||||||
$('.editor').tinymce({});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@endpush
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
@extends('layout.index', [
|
|
||||||
'title' => __('Shop.article_attribute_families.title'),
|
|
||||||
'subtitle' => __('Shop.article_attribute_families.list'),
|
|
||||||
'breadcrumb' => [__('Shop.article_attribute_families.title')]
|
|
||||||
])
|
|
||||||
|
|
||||||
@include('boilerplate::load.select2')
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
|
|
||||||
<nav>
|
|
||||||
<div class="nav nav-tabs">
|
|
||||||
<a href="#families" data-toggle="tab" class="nav-item nav-link" role="tab" aria-controls="families" aria-selected="true">
|
|
||||||
{{ __('Shop.article_attribute_families.title') }}
|
|
||||||
</a>
|
|
||||||
<a href="#values" data-toggle="tab" class="nav-item nav-link active" role="tab" aria-controls="values" aria-selected="false">
|
|
||||||
{{ __('Shop.article_attribute_values.title') }}
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="tab-content mb-0">
|
|
||||||
|
|
||||||
<div class="tab-pane fade" id="families">
|
|
||||||
@section('content')
|
|
||||||
@include('components.datatable', ['route' => route('Shop.Admin.ArticleAttributeFamilies.index'), 'model' => 'ArticleAttributefamilies'])
|
|
||||||
@endsection
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="tab-pane fade show active" id="values">
|
|
||||||
@section('content')
|
|
||||||
@component('components.card')
|
|
||||||
@include('components.datatable', ['route' => route('Shop.Admin.ArticleAttributeValues.index'), 'model' => 'articleattributevalues'])
|
|
||||||
@endcomponent
|
|
||||||
|
|
||||||
@component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-filters'])
|
|
||||||
@include('Shop.Admin.ArticleAttributeValues.partials.filters')
|
|
||||||
@endcomponent
|
|
||||||
@endsection
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@endsection
|
|
||||||
|
|
||||||
@push('scripts')
|
|
||||||
@include('components.js.datatable', ['route' => route('Shop.Admin.ArticleAttributeFamilies.index'), 'model' => 'ArticleAttributeFamilies'])
|
|
||||||
@include('components.js.datatable', ['route' => route('Shop.Admin.ArticleAttributeValues.index'), 'model' => 'ArticleAttributeValues'])
|
|
||||||
@endpush
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
@extends('layout.index', [
|
|
||||||
'title' => __('Shop.article_attribute_values.title'),
|
|
||||||
'subtitle' => __('Shop.article_attribute_values.list'),
|
|
||||||
'breadcrumb' => [__('Shop.article_attribute_values.title')]
|
|
||||||
])
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
@component('components.card')
|
|
||||||
@include('components.datatable', ['route' => route('Shop.Admin.ArticleAttributeValues.index'), 'model' => 'ArticleAttributeValues'])
|
|
||||||
@endcomponent
|
|
||||||
|
|
||||||
@component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-filters'])
|
|
||||||
@include('Shop.Admin.ArticleAttributeValues.partials.filters')
|
|
||||||
@endcomponent
|
|
||||||
|
|
||||||
@endsection
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<form id="filters">
|
|
||||||
<div class="row">
|
|
||||||
<label class="col-4">Familles d'attributs</label>
|
|
||||||
<div class="col-8">
|
|
||||||
@include('components.select', ['name' => 'article_attribute_family_id', 'list' => (isset($families)) ? $families : [], 'value' => (isset($filters['article_attribute_family_id'])) ? $filters['article_attribute_family_id'] : null, 'class' => 'form-control-sm select2', 'with_empty' => ' '])
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
@extends('layout.index', [
|
|
||||||
'title' => __('products.title'),
|
|
||||||
'subtitle' => __('products.title'),
|
|
||||||
'breadcrumb' => [__('products.title')]
|
|
||||||
])
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
<form action="{{ route('Shop.Products') }}" method="GET">
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
|
|
||||||
<div class="col-md-offset-2 col-md-8">
|
|
||||||
|
|
||||||
<div class="box box-info">
|
|
||||||
<div class="box-body">
|
|
||||||
<div class="col-md-6">
|
|
||||||
<h3>{{ name }}</h3>
|
|
||||||
<h4>
|
|
||||||
{{ $product.section.name }}<br>
|
|
||||||
</h4>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6 text-right">
|
|
||||||
<h2>{{ $prix_total }} €</h2>
|
|
||||||
<h4>{{ $residence['type_produit']['name'] }}</h4>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-md-12">
|
|
||||||
@include('Hestimmo.modules.Lot.partials.carousel')
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
@endsection
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
@extends('layout.index', [
|
|
||||||
'title' => __('article_attributes.title'),
|
|
||||||
'subtitle' => __('article_attributes.create.title'),
|
|
||||||
'breadcrumb' => [__('article_attributes.title'), __('article_attributes.create.title')]
|
|
||||||
])
|
|
||||||
|
|
||||||
@include('boilerplate::load.fileinput')
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
|
|
||||||
{{ Form::open(['route' => 'Shop.Admin.ArticleAttributes.store', 'id' => 'article-attribute-form', 'autocomplete' => 'off', 'files' => true]) }}
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-12 mbl">
|
|
||||||
<a href="{{ route("Shop.Admin.ArticleAttributes.index") }}" class="btn btn-default">
|
|
||||||
{{ __('article_attributes.list.title') }}
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<span class="btn-group pull-right">
|
|
||||||
@include('components.button-save')
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@include('Shop.Admin.ArticleAttributeValues.form')
|
|
||||||
</form>
|
|
||||||
|
|
||||||
@endsection
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
@extends('layout.index', [
|
|
||||||
'title' => 'Attributs d\'articles',
|
|
||||||
'subtitle' => 'Edition d\'un attribut d\'article',
|
|
||||||
'breadcrumb' => ['Articles']
|
|
||||||
])
|
|
||||||
|
|
||||||
@include('boilerplate::load.fileinput')
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
|
|
||||||
{{ Form::open(['route' => 'Shop.Admin.ArticleAttributeValues.update', 'id' => 'article-attribute-form', 'autocomplete' => 'off', 'files' => true]) }}
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-12 mbl">
|
|
||||||
<a href="{{ route("Shop.Admin.ArticleAttributeValues.index") }}" class="btn btn-default">
|
|
||||||
{{ __('article_attributes.list.title') }}
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<span class="btn-group pull-right">
|
|
||||||
@include('components.button-save')
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<input type="hidden" name="id" value="{{ $id }}">
|
|
||||||
@include('Shop.Admin.ArticleAttributeValues.form')
|
|
||||||
</form>
|
|
||||||
|
|
||||||
@endsection
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
@include('boilerplate::load.tinymce')
|
|
||||||
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-8">
|
|
||||||
{{ Form::label('name', 'Nom') }}
|
|
||||||
@include('components.input', ['name' => 'name', 'value' => (isset($family['name'])) ? $family['name'] : null, 'required' => true])
|
|
||||||
|
|
||||||
{{ Form::label('description', 'Description') }}
|
|
||||||
@include('components.textarea', ['name' => 'description', 'value' => isset($description) ? $description : null, 'class' => 'editor', 'required' => false])
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-8">
|
|
||||||
<div class="float-right mt-3">
|
|
||||||
@include('components.button-save')
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@push('js')
|
|
||||||
<script>
|
|
||||||
$(function() {
|
|
||||||
$('.editor').tinymce({});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@endpush
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
@extends('layout.index', [
|
|
||||||
'title' => __('Shop.article_attribute_families.title'),
|
|
||||||
'subtitle' => __('Shop.article_attribute_families.list'),
|
|
||||||
'breadcrumb' => [__('Shop.article_attribute_families.title')]
|
|
||||||
])
|
|
||||||
|
|
||||||
@include('boilerplate::load.select2')
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
|
|
||||||
<nav>
|
|
||||||
<div class="nav nav-tabs">
|
|
||||||
<a href="#families" data-toggle="tab" class="nav-item nav-link" role="tab" aria-controls="families" aria-selected="true">
|
|
||||||
{{ __('Shop.article_attribute_families.title') }}
|
|
||||||
</a>
|
|
||||||
<a href="#values" data-toggle="tab" class="nav-item nav-link active" role="tab" aria-controls="values" aria-selected="false">
|
|
||||||
{{ __('Shop.article_attribute_values.title') }}
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="tab-content mb-0">
|
|
||||||
|
|
||||||
<div class="tab-pane fade" id="families">
|
|
||||||
@section('content')
|
|
||||||
@include('components.datatable', ['route' => route('Shop.Admin.ArticleAttributeFamilies.index'), 'model' => 'ArticleAttributefamilies'])
|
|
||||||
@endsection
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="tab-pane fade show active" id="values">
|
|
||||||
@section('content')
|
|
||||||
@component('components.card')
|
|
||||||
@include('components.datatable', ['route' => route('Shop.Admin.ArticleAttributeValues.index'), 'model' => 'articleattributevalues'])
|
|
||||||
@endcomponent
|
|
||||||
|
|
||||||
@component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-filters'])
|
|
||||||
@include('Shop.Admin.ArticleAttributeValues.partials.filters')
|
|
||||||
@endcomponent
|
|
||||||
@endsection
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@endsection
|
|
||||||
|
|
||||||
@push('scripts')
|
|
||||||
@include('components.js.datatable', ['route' => route('Shop.Admin.ArticleAttributeFamilies.index'), 'model' => 'ArticleAttributeFamilies'])
|
|
||||||
@include('components.js.datatable', ['route' => route('Shop.Admin.ArticleAttributeValues.index'), 'model' => 'ArticleAttributeValues'])
|
|
||||||
@endpush
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
@extends('layout.index', [
|
|
||||||
'title' => __('Shop.article_attribute_values.title'),
|
|
||||||
'subtitle' => __('Shop.article_attribute_values.list'),
|
|
||||||
'breadcrumb' => [__('Shop.article_attribute_values.title')]
|
|
||||||
])
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
@component('components.card')
|
|
||||||
@include('components.datatable', ['route' => route('Shop.Admin.ArticleAttributeValues.index'), 'model' => 'ArticleAttributeValues'])
|
|
||||||
@endcomponent
|
|
||||||
|
|
||||||
@component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-filters'])
|
|
||||||
@include('Shop.Admin.ArticleAttributeValues.partials.filters')
|
|
||||||
@endcomponent
|
|
||||||
|
|
||||||
@endsection
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<form id="filters">
|
|
||||||
<div class="row">
|
|
||||||
<label class="col-4">Familles d'attributs</label>
|
|
||||||
<div class="col-8">
|
|
||||||
@include('components.select', ['name' => 'article_attribute_family_id', 'list' => (isset($families)) ? $families : [], 'value' => (isset($filters['article_attribute_family_id'])) ? $filters['article_attribute_family_id'] : null, 'class' => 'form-control-sm select2', 'with_empty' => ' '])
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
@extends('layout.index', [
|
|
||||||
'title' => __('products.title'),
|
|
||||||
'subtitle' => __('products.title'),
|
|
||||||
'breadcrumb' => [__('products.title')]
|
|
||||||
])
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
<form action="{{ route('Shop.Products') }}" method="GET">
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
|
|
||||||
<div class="col-md-offset-2 col-md-8">
|
|
||||||
|
|
||||||
<div class="box box-info">
|
|
||||||
<div class="box-body">
|
|
||||||
<div class="col-md-6">
|
|
||||||
<h3>{{ name }}</h3>
|
|
||||||
<h4>
|
|
||||||
{{ $product.section.name }}<br>
|
|
||||||
</h4>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6 text-right">
|
|
||||||
<h2>{{ $prix_total }} €</h2>
|
|
||||||
<h4>{{ $residence['type_produit']['name'] }}</h4>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-md-12">
|
|
||||||
@include('Hestimmo.modules.Lot.partials.carousel')
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
@endsection
|
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
<div class="tab-pane fade show active" id="values">
|
<div class="tab-pane fade show active" id="values">
|
||||||
@section('content')
|
@section('content')
|
||||||
@component('components.card')
|
@component('components.card')
|
||||||
@include('components.datatable', ['route' => route('Shop.Admin.ArticleAttributeValues.index'), 'model' => 'Unities'])
|
@include('components.datatable', ['route' => route('Shop.Admin.ArticleAttributeValues.index'), 'model' => 'Unities', 'with_filters' => true])
|
||||||
@endcomponent
|
@endcomponent
|
||||||
|
|
||||||
@component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-filters'])
|
@component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-filters'])
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
@component('components.card')
|
@component('components.card')
|
||||||
@include('components.datatable', ['route' => route('Shop.Admin.Unities.index'), 'model' => 'unities'])
|
@include('components.datatable', ['route' => route('Shop.Admin.Unities.index'), 'model' => 'unities','with_filters' => true])
|
||||||
@endcomponent
|
@endcomponent
|
||||||
|
|
||||||
@component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-unities-filters'])
|
@component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-unities-filters'])
|
||||||
|
|||||||
@@ -1,9 +1,14 @@
|
|||||||
<form id="filters">
|
<form id="unities-filters">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<label class="col-4">Familles d'attributs</label>
|
<label class="col-4">Familles d'articles</label>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
@include('components.select', ['name' => 'article_attribute_family_id', 'list' => (isset($families)) ? $families : [], 'value' => (isset($filters['article_attribute_family_id'])) ? $filters['article_attribute_family_id'] : null, 'class' => 'form-control-sm select2', 'with_empty' => ' '])
|
@include('components.select', ['name' => 'family_id', 'list' => (isset($families)) ? $families : [], 'value' => (isset($filters['family_id'])) ? $filters['family_id'] : null, 'class' => 'form-control-sm select2', 'with_empty' => ' '])
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mt-3">
|
||||||
|
<label class="col-4">Packages</label>
|
||||||
|
<div class="col-8">
|
||||||
|
@include('components.select', ['name' => 'package_id', 'list' => (isset($packages)) ? $packages : [], 'value' => (isset($filters['package_id'])) ? $filters['package_id'] : null, 'class' => 'form-control-sm select2', 'with_empty' => ' '])
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Reference in New Issue
Block a user