|
|
@ -236,6 +236,7 @@ return [
|
|||
'Validator' => Illuminate\Support\Facades\Validator::class,
|
||||
'View' => Illuminate\Support\Facades\View::class,
|
||||
'Datagrid' => Webkul\Ui\DataGrid\Facades\DataGrid::class,
|
||||
'ProductGrid' => Webkul\Ui\DataGrid\Facades\ProductGrid::class,
|
||||
'Image' => Intervention\Image\Facades\Image::class
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
/node_modules
|
||||
/package-lock.json
|
||||
/package-lock.json
|
||||
npm-debug.log
|
||||
|
|
@ -0,0 +1,191 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Admin\DataGrids;
|
||||
|
||||
use Illuminate\View\View;
|
||||
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||
|
||||
|
||||
/**
|
||||
* Attributes DataGrid
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
class AttributeDataGrid
|
||||
{
|
||||
/**
|
||||
* The Data Grid implementation.
|
||||
*
|
||||
* @var AttributeDataGrid
|
||||
* for countries
|
||||
*/
|
||||
|
||||
public function createAttributeDataGrid()
|
||||
{
|
||||
|
||||
return DataGrid::make([
|
||||
'name' => 'Attributes',
|
||||
'table' => 'attributes',
|
||||
'select' => 'id',
|
||||
'perpage' => 10,
|
||||
'aliased' => false, //use this with false as default and true in case of joins
|
||||
|
||||
'massoperations' =>[
|
||||
[
|
||||
'route' => route('admin.datagrid.delete'),
|
||||
'method' => 'DELETE',
|
||||
'label' => 'Delete',
|
||||
'type' => 'button',
|
||||
],
|
||||
],
|
||||
|
||||
'actions' => [
|
||||
[
|
||||
'type' => 'Edit',
|
||||
'route' => route('admin.datagrid.delete'),
|
||||
'confirm_text' => 'Do you really want to do this?',
|
||||
'icon' => 'icon pencil-lg-icon',
|
||||
], [
|
||||
'type' => 'Delete',
|
||||
'route' => route('admin.datagrid.delete'),
|
||||
'confirm_text' => 'Do you really want to do this?',
|
||||
'icon' => 'icon trash-icon',
|
||||
],
|
||||
],
|
||||
|
||||
'join' => [
|
||||
// [
|
||||
// 'join' => 'leftjoin',
|
||||
// 'table' => 'roles as r',
|
||||
// 'primaryKey' => 'u.role_id',
|
||||
// 'condition' => '=',
|
||||
// 'secondaryKey' => 'r.id',
|
||||
// ]
|
||||
],
|
||||
|
||||
//use aliasing on secodary columns if join is performed
|
||||
|
||||
'columns' => [
|
||||
|
||||
[
|
||||
'name' => 'id',
|
||||
'alias' => 'attributeId',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'code',
|
||||
'alias' => 'attributeCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'admin_name',
|
||||
'alias' => 'attributeAdminName',
|
||||
'type' => 'string',
|
||||
'label' => 'AdminName',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'type',
|
||||
'alias' => 'attributeType',
|
||||
'type' => 'string',
|
||||
'label' => 'Type',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'is_required',
|
||||
'alias' => 'attributeIsRequired',
|
||||
'type' => 'string',
|
||||
'label' => 'Required',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'is_unique',
|
||||
'alias' => 'attributeIsUnique',
|
||||
'type' => 'string',
|
||||
'label' => 'Unique',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'value_per_locale',
|
||||
'alias' => 'attributeValuePerLocale',
|
||||
'type' => 'string',
|
||||
'label' => 'ValuePerLocale',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'value_per_channel',
|
||||
'alias' => 'attributeValuePerChannel',
|
||||
'type' => 'string',
|
||||
'label' => 'ValuePerChannel',
|
||||
'sortable' => true,
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
'filterable' => [
|
||||
// [
|
||||
// 'column' => 'id',
|
||||
// 'alias' => 'attribute_family_id',
|
||||
// 'type' => 'number',
|
||||
// 'label' => 'ID',
|
||||
// ],
|
||||
// [
|
||||
// 'column' => 'code',
|
||||
// 'alias' => 'attribute_family_code',
|
||||
// 'type' => 'string',
|
||||
// 'label' => 'Code',
|
||||
// ],
|
||||
// [
|
||||
// 'column' => 'name',
|
||||
// 'alias' => 'attribute_family_name',
|
||||
// 'type' => 'string',
|
||||
// 'label' => 'Name',
|
||||
// ],
|
||||
],
|
||||
|
||||
//don't use aliasing in case of searchables
|
||||
|
||||
'searchable' => [
|
||||
// [
|
||||
// 'column' => 'name',
|
||||
// 'type' => 'string',
|
||||
// 'label' => 'Name',
|
||||
// ],
|
||||
// [
|
||||
// 'column' => 'code',
|
||||
// 'type' => 'string',
|
||||
// 'label' => 'Code',
|
||||
// ],
|
||||
],
|
||||
|
||||
//list of viable operators that will be used
|
||||
'operators' => [
|
||||
'eq' => "=",
|
||||
'lt' => "<",
|
||||
'gt' => ">",
|
||||
'lte' => "<=",
|
||||
'gte' => ">=",
|
||||
'neqs' => "<>",
|
||||
'neqn' => "!=",
|
||||
'like' => "like",
|
||||
'nlike' => "not like",
|
||||
],
|
||||
// 'css' => []
|
||||
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
|
||||
return $this->createAttributeDataGrid()->render();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,155 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Admin\DataGrids;
|
||||
|
||||
use Illuminate\View\View;
|
||||
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||
|
||||
|
||||
/**
|
||||
* Attributes Family DataGrid
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
class AttributeFamilyDataGrid
|
||||
{
|
||||
/**
|
||||
* The Data Grid implementation.
|
||||
*
|
||||
* @var CountryComposer
|
||||
* for countries
|
||||
*/
|
||||
|
||||
public function createAttributeFamilyDataGrid()
|
||||
{
|
||||
|
||||
return DataGrid::make([
|
||||
'name' => 'Attribute Family',
|
||||
'table' => 'attribute_families',
|
||||
'select' => 'id',
|
||||
'perpage' => 10,
|
||||
'aliased' => false, //use this with false as default and true in case of joins
|
||||
|
||||
'massoperations' =>[
|
||||
[
|
||||
'route' => route('admin.datagrid.delete'),
|
||||
'method' => 'DELETE',
|
||||
'label' => 'Delete',
|
||||
'type' => 'button',
|
||||
],
|
||||
],
|
||||
|
||||
'actions' => [
|
||||
[
|
||||
'type' => 'Edit',
|
||||
'route' => route('admin.datagrid.delete'),
|
||||
'confirm_text' => 'Do you really want to do this?',
|
||||
'icon' => 'icon pencil-lg-icon',
|
||||
], [
|
||||
'type' => 'Delete',
|
||||
'route' => route('admin.datagrid.delete'),
|
||||
'confirm_text' => 'Do you really want to do this?',
|
||||
'icon' => 'icon trash-icon',
|
||||
],
|
||||
],
|
||||
|
||||
'join' => [
|
||||
// [
|
||||
// 'join' => 'leftjoin',
|
||||
// 'table' => 'roles as r',
|
||||
// 'primaryKey' => 'u.role_id',
|
||||
// 'condition' => '=',
|
||||
// 'secondaryKey' => 'r.id',
|
||||
// ]
|
||||
],
|
||||
|
||||
//use aliasing on secodary columns if join is performed
|
||||
|
||||
'columns' => [
|
||||
|
||||
[
|
||||
'name' => 'id',
|
||||
'alias' => 'attributeFamilyId',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'code',
|
||||
'alias' => 'attributeFamilyCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'name',
|
||||
'alias' => 'attributeFamilyName',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
'sortable' => true,
|
||||
],
|
||||
],
|
||||
|
||||
'filterable' => [
|
||||
[
|
||||
'column' => 'id',
|
||||
'alias' => 'attributeFamilyId',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
],
|
||||
[
|
||||
'column' => 'code',
|
||||
'alias' => 'attributeFamilyCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
],
|
||||
[
|
||||
'column' => 'name',
|
||||
'alias' => 'attributeFamilyName',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
],
|
||||
],
|
||||
|
||||
//don't use aliasing in case of searchables
|
||||
|
||||
'searchable' => [
|
||||
[
|
||||
'column' => 'name',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
],
|
||||
[
|
||||
'column' => 'code',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
],
|
||||
],
|
||||
|
||||
//list of viable operators that will be used
|
||||
'operators' => [
|
||||
'eq' => "=",
|
||||
'lt' => "<",
|
||||
'gt' => ">",
|
||||
'lte' => "<=",
|
||||
'gte' => ">=",
|
||||
'neqs' => "<>",
|
||||
'neqn' => "!=",
|
||||
'like' => "like",
|
||||
'nlike' => "not like",
|
||||
],
|
||||
// 'css' => []
|
||||
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
|
||||
return $this->createAttributeFamilyDataGrid()->render();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,172 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Admin\DataGrids;
|
||||
|
||||
use Illuminate\View\View;
|
||||
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||
|
||||
|
||||
/**
|
||||
* Category DataGrid
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
class CategoryDataGrid
|
||||
{
|
||||
/**
|
||||
* The Data Grid implementation.
|
||||
*
|
||||
* @var AttributeDataGrid
|
||||
* for countries
|
||||
*/
|
||||
|
||||
public function createCategoryDataGrid()
|
||||
{
|
||||
|
||||
return DataGrid::make([
|
||||
'name' => 'Categories',
|
||||
'table' => 'categories as cat',
|
||||
'select' => 'cat.id',
|
||||
'perpage' => 10,
|
||||
'aliased' => true, //use this with false as default and true in case of joins
|
||||
|
||||
'massoperations' =>[
|
||||
[
|
||||
'route' => route('admin.datagrid.delete'),
|
||||
'method' => 'DELETE',
|
||||
'label' => 'Delete',
|
||||
'type' => 'button',
|
||||
],
|
||||
],
|
||||
|
||||
'actions' => [
|
||||
[
|
||||
'type' => 'Edit',
|
||||
'route' => route('admin.datagrid.delete'),
|
||||
'confirm_text' => 'Do you really want to do this?',
|
||||
'icon' => 'icon pencil-lg-icon',
|
||||
], [
|
||||
'type' => 'Delete',
|
||||
'route' => route('admin.datagrid.delete'),
|
||||
'confirm_text' => 'Do you really want to do this?',
|
||||
'icon' => 'icon trash-icon',
|
||||
],
|
||||
],
|
||||
|
||||
'join' => [
|
||||
[
|
||||
'join' => 'leftjoin',
|
||||
'table' => 'category_translations as ct',
|
||||
'primaryKey' => 'cat.id',
|
||||
'condition' => '=',
|
||||
'secondaryKey' => 'ct.category_id',
|
||||
], [
|
||||
'join' => 'leftjoin',
|
||||
'table' => 'category_translations as cta',
|
||||
'primaryKey' => 'cat.parent_id',
|
||||
'condition' => '=',
|
||||
'secondaryKey' => 'cta.category_id',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
//use aliasing on secodary columns if join is performed
|
||||
|
||||
'columns' => [
|
||||
[
|
||||
'name' => 'cat.id',
|
||||
'alias' => 'catID',
|
||||
'type' => 'number',
|
||||
'label' => 'Category ID',
|
||||
'sortable' => true,
|
||||
], [
|
||||
'name' => 'ct.name',
|
||||
'alias' => 'catName',
|
||||
'type' => 'string',
|
||||
'label' => 'Category Name',
|
||||
'sortable' => false,
|
||||
], [
|
||||
'name' => 'cat.position',
|
||||
'alias' => 'catPosition',
|
||||
'type' => 'string',
|
||||
'label' => 'Category Position',
|
||||
'sortable' => false,
|
||||
], [
|
||||
'name' => 'cta.name',
|
||||
'alias' => 'parentName',
|
||||
'type' => 'string',
|
||||
'label' => 'Parent Name',
|
||||
'sortable' => true,
|
||||
], [
|
||||
'name' => 'cat.status',
|
||||
'alias' => 'catStatus',
|
||||
'type' => 'string',
|
||||
'label' => 'Visible in Menu',
|
||||
'sortable' => true,
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
'filterable' => [
|
||||
// [
|
||||
// 'column' => 'id',
|
||||
// 'alias' => 'attribute_family_id',
|
||||
// 'type' => 'number',
|
||||
// 'label' => 'ID',
|
||||
// ],
|
||||
// [
|
||||
// 'column' => 'code',
|
||||
// 'alias' => 'attribute_family_code',
|
||||
// 'type' => 'string',
|
||||
// 'label' => 'Code',
|
||||
// ],
|
||||
// [
|
||||
// 'column' => 'name',
|
||||
// 'alias' => 'attribute_family_name',
|
||||
// 'type' => 'string',
|
||||
// 'label' => 'Name',
|
||||
// ],
|
||||
],
|
||||
|
||||
//don't use aliasing in case of searchables
|
||||
|
||||
'searchable' => [
|
||||
// [
|
||||
// 'column' => 'name',
|
||||
// 'type' => 'string',
|
||||
// 'label' => 'Name',
|
||||
// ],
|
||||
// [
|
||||
// 'column' => 'code',
|
||||
// 'type' => 'string',
|
||||
// 'label' => 'Code',
|
||||
// ],
|
||||
],
|
||||
|
||||
//list of viable operators that will be used
|
||||
'operators' => [
|
||||
'eq' => "=",
|
||||
'lt' => "<",
|
||||
'gt' => ">",
|
||||
'lte' => "<=",
|
||||
'gte' => ">=",
|
||||
'neqs' => "<>",
|
||||
'neqn' => "!=",
|
||||
'like' => "like",
|
||||
'nlike' => "not like",
|
||||
],
|
||||
// 'css' => []
|
||||
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
|
||||
return $this->createCategoryDataGrid()->render();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +1,19 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Admin\Http\ViewComposers\DataGrids;
|
||||
namespace Webkul\Admin\DataGrids;
|
||||
|
||||
use Illuminate\View\View;
|
||||
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||
|
||||
// use App\Repositories\UserRepository;
|
||||
|
||||
class ChannelsComposer
|
||||
/**
|
||||
* Channels DataGrid
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
class ChannelDataGrid
|
||||
{
|
||||
/**
|
||||
* The Data Grid implementation.
|
||||
|
|
@ -16,17 +22,10 @@ class ChannelsComposer
|
|||
* for countries
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Bind data to the view.
|
||||
*
|
||||
* @param View $view
|
||||
* @return void
|
||||
*/
|
||||
public function compose(View $view)
|
||||
public function createChannelsDataGrid()
|
||||
{
|
||||
|
||||
$datagrid = DataGrid::make([
|
||||
return DataGrid::make([
|
||||
'name' => 'Channels',
|
||||
'table' => 'channels',
|
||||
'select' => 'id',
|
||||
|
|
@ -99,19 +98,19 @@ class ChannelsComposer
|
|||
'filterable' => [
|
||||
[
|
||||
'column' => 'id',
|
||||
'alias' => 'channel_id',
|
||||
'alias' => 'channelId',
|
||||
'type' => 'number',
|
||||
'label' => 'Channel ID',
|
||||
],
|
||||
[
|
||||
'column' => 'code',
|
||||
'alias' => 'channel_code',
|
||||
'alias' => 'channelCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Channel Code',
|
||||
],
|
||||
[
|
||||
'column' => 'name',
|
||||
'alias' => 'channel_name',
|
||||
'alias' => 'channelName',
|
||||
'type' => 'string',
|
||||
'label' => 'Channel Name',
|
||||
],
|
||||
|
|
@ -148,7 +147,10 @@ class ChannelsComposer
|
|||
|
||||
]);
|
||||
|
||||
$view->with('datagrid', $datagrid);
|
||||
// $view->with('count', $this->users->count());
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return $this->createChannelsDataGrid()->render();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +1,19 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Admin\Http\ViewComposers\DataGrids;
|
||||
namespace Webkul\Admin\DataGrids;
|
||||
|
||||
use Illuminate\View\View;
|
||||
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||
|
||||
// use App\Repositories\UserRepository;
|
||||
|
||||
class CountryComposer
|
||||
/**
|
||||
* Countries DataGrid
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
class CountryDataGrid
|
||||
{
|
||||
/**
|
||||
* The Data Grid implementation.
|
||||
|
|
@ -16,17 +22,10 @@ class CountryComposer
|
|||
* for countries
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Bind data to the view.
|
||||
*
|
||||
* @param View $view
|
||||
* @return void
|
||||
*/
|
||||
public function compose(View $view)
|
||||
public function createCountryDataGrid()
|
||||
{
|
||||
|
||||
$datagrid = DataGrid::make([
|
||||
return DataGrid::make([
|
||||
'name' => 'Countries',
|
||||
'table' => 'countries',
|
||||
'select' => 'id',
|
||||
|
|
@ -72,28 +71,28 @@ class CountryComposer
|
|||
|
||||
[
|
||||
'name' => 'id',
|
||||
'alias' => 'country_id',
|
||||
'alias' => 'countryId',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'code',
|
||||
'alias' => 'country_code',
|
||||
'alias' => 'countryCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'name',
|
||||
'alias' => 'country_name',
|
||||
'alias' => 'countryName',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'status',
|
||||
'alias' => 'country_status',
|
||||
'alias' => 'countryStatus',
|
||||
'type' => 'number',
|
||||
'label' => 'Code',
|
||||
'sortable' => true,
|
||||
|
|
@ -106,25 +105,25 @@ class CountryComposer
|
|||
'filterable' => [
|
||||
[
|
||||
'column' => 'id',
|
||||
'alias' => 'country_id',
|
||||
'alias' => 'countryId',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
],
|
||||
[
|
||||
'column' => 'code',
|
||||
'alias' => 'country_code',
|
||||
'alias' => 'countryCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
],
|
||||
[
|
||||
'column' => 'name',
|
||||
'alias' => 'country_name',
|
||||
'alias' => 'countryName',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
],
|
||||
[
|
||||
'column' => 'status',
|
||||
'alias' => 'country_status',
|
||||
'alias' => 'countryStatus',
|
||||
'type' => 'number',
|
||||
'label' => 'Code',
|
||||
],
|
||||
|
|
@ -161,7 +160,12 @@ class CountryComposer
|
|||
|
||||
]);
|
||||
|
||||
$view->with('datagrid', $datagrid);
|
||||
// $view->with('count', $this->users->count());
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
|
||||
return $this->createCountryDataGrid()->render();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Admin\Http\ViewComposers\DataGrids;
|
||||
namespace Webkul\Admin\DataGrids;
|
||||
|
||||
use Illuminate\View\View;
|
||||
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||
|
||||
// use App\Repositories\UserRepository;
|
||||
/**
|
||||
* Currencies DataGrid
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
class CurrenciesComposer
|
||||
class CurrencyDataGrid
|
||||
{
|
||||
/**
|
||||
* The Data Grid implementation.
|
||||
*
|
||||
* @var CountryComposer
|
||||
* @var CurrenciesDataGrid
|
||||
* for countries
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Bind data to the view.
|
||||
*
|
||||
* @param View $view
|
||||
* @return void
|
||||
*/
|
||||
public function compose(View $view)
|
||||
public function createCurrencyDataGrid()
|
||||
{
|
||||
|
||||
$datagrid = DataGrid::make([
|
||||
return DataGrid::make([
|
||||
'name' => 'Currencies',
|
||||
'table' => 'currencies',
|
||||
'select' => 'id',
|
||||
|
|
@ -72,21 +70,21 @@ class CurrenciesComposer
|
|||
|
||||
[
|
||||
'name' => 'id',
|
||||
'alias' => 'currency_id',
|
||||
'alias' => 'currencyId',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'code',
|
||||
'alias' => 'currency_code',
|
||||
'alias' => 'currencyCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'name',
|
||||
'alias' => 'currency_name',
|
||||
'alias' => 'currencyName',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
'sortable' => true,
|
||||
|
|
@ -99,19 +97,19 @@ class CurrenciesComposer
|
|||
'filterable' => [
|
||||
[
|
||||
'column' => 'id',
|
||||
'alias' => 'currency_id',
|
||||
'alias' => 'currencyId',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
],
|
||||
[
|
||||
'column' => 'code',
|
||||
'alias' => 'currency_code',
|
||||
'alias' => 'currencyCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
],
|
||||
[
|
||||
'column' => 'name',
|
||||
'alias' => 'currency_name',
|
||||
'alias' => 'currencyName',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
],
|
||||
|
|
@ -148,7 +146,10 @@ class CurrenciesComposer
|
|||
|
||||
]);
|
||||
|
||||
$view->with('datagrid', $datagrid);
|
||||
// $view->with('count', $this->users->count());
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return $this->createCurrencyDataGrid()->render();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Admin\Http\ViewComposers\DataGrids;
|
||||
namespace Webkul\Admin\DataGrids;
|
||||
|
||||
use Illuminate\View\View;
|
||||
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||
|
||||
// use App\Repositories\UserRepository;
|
||||
/**
|
||||
* Exchange Rates DataGrid
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
class ExchangeRatesComposer
|
||||
class ExchangeRatesDataGrid
|
||||
{
|
||||
/**
|
||||
* The Data Grid implementation.
|
||||
*
|
||||
* @var CountryComposer
|
||||
* for countries
|
||||
* @var ExchangeRatesDataGrid
|
||||
* for Exchange Rates
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Bind data to the view.
|
||||
*
|
||||
* @param View $view
|
||||
* @return void
|
||||
*/
|
||||
public function compose(View $view)
|
||||
public function createExchangeRatesDataGrid()
|
||||
{
|
||||
|
||||
$datagrid = DataGrid::make([
|
||||
return DataGrid::make([
|
||||
'name' => 'Exchange Rates',
|
||||
'table' => 'currency_exchange_rates',
|
||||
'select' => 'id',
|
||||
|
|
@ -72,28 +71,28 @@ class ExchangeRatesComposer
|
|||
|
||||
[
|
||||
'name' => 'id',
|
||||
'alias' => 'exch_id',
|
||||
'alias' => 'exchID',
|
||||
'type' => 'number',
|
||||
'label' => 'Rate ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'source_currency',
|
||||
'alias' => 'exch_source_currency',
|
||||
'alias' => 'exchSourceCurrency',
|
||||
'type' => 'string',
|
||||
'label' => 'Source Currency',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'target_currency',
|
||||
'alias' => 'exch_target_currency',
|
||||
'alias' => 'exchTargetCurrency',
|
||||
'type' => 'string',
|
||||
'label' => 'Target Currency',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'ratio',
|
||||
'alias' => 'exch_ratio',
|
||||
'alias' => 'exchRatio',
|
||||
'type' => 'string',
|
||||
'label' => 'Exchange Ratio',
|
||||
],
|
||||
|
|
@ -105,20 +104,20 @@ class ExchangeRatesComposer
|
|||
'filterable' => [
|
||||
[
|
||||
'column' => 'id',
|
||||
'alias' => 'exch_id',
|
||||
'alias' => 'exchId',
|
||||
'type' => 'number',
|
||||
'label' => 'Rate ID',
|
||||
],
|
||||
[
|
||||
'column' => 'source_currency',
|
||||
'alias' => 'exch_source_currency',
|
||||
'alias' => 'exchSourceCurrency',
|
||||
'type' => 'string',
|
||||
'label' => 'Source Currency',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'column' => 'target_currency',
|
||||
'alias' => 'exch_target_currency',
|
||||
'alias' => 'exchTargetCurrency',
|
||||
'type' => 'string',
|
||||
'label' => 'Target Currency',
|
||||
'sortable' => true,
|
||||
|
|
@ -156,7 +155,10 @@ class ExchangeRatesComposer
|
|||
|
||||
]);
|
||||
|
||||
$view->with('datagrid', $datagrid);
|
||||
// $view->with('count', $this->users->count());
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return $this->createExchangeRatesDataGrid()->render();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Admin\Http\ViewComposers\DataGrids;
|
||||
namespace Webkul\Admin\DataGrids;
|
||||
|
||||
use Illuminate\View\View;
|
||||
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||
|
||||
// use App\Repositories\UserRepository;
|
||||
/**
|
||||
* Inventory Sources DataGrid
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
class InventorySourcesComposer
|
||||
class InventorySourcesDataGrid
|
||||
{
|
||||
/**
|
||||
* The Data Grid implementation.
|
||||
*
|
||||
* @var CountryComposer
|
||||
* for countries
|
||||
* @var InventorySourcesDataGrid
|
||||
* for Inventory Sources
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Bind data to the view.
|
||||
*
|
||||
* @param View $view
|
||||
* @return void
|
||||
*/
|
||||
public function compose(View $view)
|
||||
public function createInventorySourcesDataGrid()
|
||||
{
|
||||
|
||||
$datagrid = DataGrid::make([
|
||||
return DataGrid::make([
|
||||
'name' => 'Inventory Sources',
|
||||
'table' => 'inventory_sources',
|
||||
'select' => 'id',
|
||||
|
|
@ -72,35 +69,35 @@ class InventorySourcesComposer
|
|||
|
||||
[
|
||||
'name' => 'id',
|
||||
'alias' => 'inventory_id',
|
||||
'alias' => 'inventoryID',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'code',
|
||||
'alias' => 'inventory_code',
|
||||
'alias' => 'inventoryCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'name',
|
||||
'alias' => 'inventory_name',
|
||||
'alias' => 'inventoryName',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'priority',
|
||||
'alias' => 'inventory_priority',
|
||||
'alias' => 'inventoryPriority',
|
||||
'type' => 'string',
|
||||
'label' => 'Priority',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'status',
|
||||
'alias' => 'inventory_status',
|
||||
'alias' => 'inventoryStatus',
|
||||
'type' => 'string',
|
||||
'label' => 'Status',
|
||||
'sortable' => true,
|
||||
|
|
@ -113,19 +110,19 @@ class InventorySourcesComposer
|
|||
'filterable' => [
|
||||
[
|
||||
'column' => 'id',
|
||||
'alias' => 'inventory_id',
|
||||
'alias' => 'inventoryId',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
],
|
||||
[
|
||||
'column' => 'code',
|
||||
'alias' => 'inventory_code',
|
||||
'alias' => 'inventoryCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
],
|
||||
[
|
||||
'column' => 'name',
|
||||
'alias' => 'inventory_name',
|
||||
'alias' => 'inventoryName',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
],
|
||||
|
|
@ -161,7 +158,10 @@ class InventorySourcesComposer
|
|||
// 'css' => []
|
||||
|
||||
]);
|
||||
}
|
||||
|
||||
$view->with('datagrid', $datagrid);
|
||||
public function render()
|
||||
{
|
||||
return $this->createInventorySourcesDataGrid()->render();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Admin\Http\ViewComposers\DataGrids;
|
||||
namespace Webkul\Admin\DataGrids;
|
||||
|
||||
use Illuminate\View\View;
|
||||
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||
|
||||
// use App\Repositories\UserRepository;
|
||||
/**
|
||||
* Locales DataGrid
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
class LocalesComposer
|
||||
class LocalesDataGrid
|
||||
{
|
||||
/**
|
||||
* The Data Grid implementation.
|
||||
*
|
||||
* @var CountryComposer
|
||||
* @var CountryDataGrid
|
||||
* for countries
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Bind data to the view.
|
||||
*
|
||||
* @param View $view
|
||||
* @return void
|
||||
*/
|
||||
public function compose(View $view)
|
||||
public function createCountryDataGrid()
|
||||
{
|
||||
|
||||
$datagrid = DataGrid::make([
|
||||
return DataGrid::make([
|
||||
'name' => 'Locales',
|
||||
'table' => 'locales',
|
||||
'select' => 'id',
|
||||
|
|
@ -72,21 +70,21 @@ class LocalesComposer
|
|||
|
||||
[
|
||||
'name' => 'id',
|
||||
'alias' => 'locale_id',
|
||||
'alias' => 'localeId',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'code',
|
||||
'alias' => 'locale_code',
|
||||
'alias' => 'localeCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'name',
|
||||
'alias' => 'locale_name',
|
||||
'alias' => 'localeName',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
'sortable' => true,
|
||||
|
|
@ -99,19 +97,19 @@ class LocalesComposer
|
|||
'filterable' => [
|
||||
[
|
||||
'column' => 'id',
|
||||
'alias' => 'locale_id',
|
||||
'alias' => 'localeId',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
],
|
||||
[
|
||||
'column' => 'code',
|
||||
'alias' => 'locale_code',
|
||||
'alias' => 'localeCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
],
|
||||
[
|
||||
'column' => 'name',
|
||||
'alias' => 'locale_name',
|
||||
'alias' => 'localeName',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
],
|
||||
|
|
@ -148,7 +146,10 @@ class LocalesComposer
|
|||
|
||||
]);
|
||||
|
||||
$view->with('datagrid', $datagrid);
|
||||
// $view->with('count', $this->users->count());
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return $this->createCountryDataGrid()->render();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,215 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Admin\DataGrids;
|
||||
|
||||
use Illuminate\View\View;
|
||||
use Webkul\Ui\DataGrid\Facades\ProductGrid;
|
||||
use Webkul\Channel\Repositories\ChannelRepository;
|
||||
use Webkul\Product\Repositories\ProductRepository;
|
||||
|
||||
/**
|
||||
* Product DataGrid
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
class ProductDataGrid
|
||||
{
|
||||
/**
|
||||
* The Data Grid implementation.
|
||||
* @var ProductDataGrid
|
||||
* for Products
|
||||
*/
|
||||
|
||||
public function createProductDataGrid()
|
||||
{
|
||||
|
||||
return ProductGrid::make([
|
||||
'name' => 'Products',
|
||||
'table' => 'products as prods',
|
||||
'select' => 'prods.id',
|
||||
'perpage' => 10,
|
||||
'aliased' => true, //use this with false as default and true in case of joins
|
||||
|
||||
'massoperations' =>[
|
||||
// [
|
||||
// 'route' => route('admin.datagrid.delete'),
|
||||
// 'method' => 'DELETE',
|
||||
// 'label' => 'Delete',
|
||||
// 'type' => 'button',
|
||||
// ],
|
||||
],
|
||||
|
||||
'actions' => [
|
||||
[
|
||||
'type' => 'Edit',
|
||||
'route' => route('admin.datagrid.delete'),
|
||||
'confirm_text' => 'Do you really want to do this?',
|
||||
'icon' => 'icon pencil-lg-icon',
|
||||
], [
|
||||
'type' => 'Delete',
|
||||
'route' => route('admin.datagrid.delete'),
|
||||
'confirm_text' => 'Do you really want to do this?',
|
||||
'icon' => 'icon trash-icon',
|
||||
],
|
||||
],
|
||||
|
||||
'attributeColumns' => [
|
||||
'name', 'price'
|
||||
],
|
||||
|
||||
'join' => [
|
||||
|
||||
//for getting name of attrib family.
|
||||
[
|
||||
'join' => 'leftjoin',
|
||||
'table' => 'attribute_families as attfam',
|
||||
'primaryKey' => 'prods.attribute_family_id',
|
||||
'condition' => '=',
|
||||
'secondaryKey' => 'attfam.id',
|
||||
],
|
||||
|
||||
//for getting the attribute values.
|
||||
[
|
||||
'join' => 'leftjoin',
|
||||
'table' => 'product_attribute_values as pav',
|
||||
'primaryKey' => 'prods.id',
|
||||
'condition' => '=',
|
||||
'secondaryKey' => 'pav.product_id',
|
||||
'withAttributes' => true
|
||||
],
|
||||
|
||||
//for getting the inventory quantity of a product
|
||||
[
|
||||
'join' => 'leftjoin',
|
||||
'table' => 'product_inventories as pi',
|
||||
'primaryKey' => 'prods.id',
|
||||
'condition' => '=',
|
||||
'secondaryKey' => 'pi.product_id',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
//use aliasing on secodary columns if join is performed
|
||||
|
||||
'columns' => [
|
||||
//name, alias, type, label, sortable
|
||||
[
|
||||
'name' => 'prods.id',
|
||||
'alias' => 'productID',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'prods.sku',
|
||||
'alias' => 'productCode',
|
||||
'type' => 'string',
|
||||
'label' => 'SKU',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'attfam.name',
|
||||
'alias' => 'FamilyName',
|
||||
'type' => 'string',
|
||||
'label' => 'Family Name',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'pi.qty',
|
||||
'alias' => 'ProductQuantity',
|
||||
'type' => 'string',
|
||||
'label' => 'Product Quatity',
|
||||
'sortable' => false,
|
||||
],
|
||||
// [
|
||||
// 'name' => 'pav.attribute_id',
|
||||
// 'alias' => 'AttributeID',
|
||||
// 'type' => 'string',
|
||||
// 'label' => 'Attribute ID',
|
||||
// 'sortable' => false,
|
||||
|
||||
// ],
|
||||
],
|
||||
|
||||
'filterable' => [
|
||||
//column, type, and label
|
||||
[
|
||||
'name' => 'prods.id',
|
||||
'alias' => 'productID',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
],
|
||||
[
|
||||
'name' => 'prods.sku',
|
||||
'alias' => 'productCode',
|
||||
'type' => 'string',
|
||||
'label' => 'SKU',
|
||||
],
|
||||
[
|
||||
'name' => 'attfam.name',
|
||||
'alias' => 'FamilyName',
|
||||
'type' => 'string',
|
||||
'label' => 'Family Name',
|
||||
],
|
||||
[
|
||||
'name' => 'pi.qty',
|
||||
'alias' => 'ProductQuantity',
|
||||
'type' => 'string',
|
||||
'label' => 'Product Quatity',
|
||||
],
|
||||
],
|
||||
|
||||
//don't use aliasing in case of searchables
|
||||
|
||||
'searchable' => [
|
||||
//column, type and label
|
||||
[
|
||||
'column' => 'prods.id',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
],
|
||||
[
|
||||
'column' => 'prods.sku',
|
||||
'type' => 'string',
|
||||
'label' => 'SKU',
|
||||
],
|
||||
[
|
||||
'column' => 'attfam.name',
|
||||
'type' => 'string',
|
||||
'label' => 'Family Name',
|
||||
],
|
||||
[
|
||||
'column' => 'pi.qty',
|
||||
'type' => 'string',
|
||||
'label' => 'Product Quatity',
|
||||
],
|
||||
],
|
||||
|
||||
//list of viable operators that will be used
|
||||
'operators' => [
|
||||
'eq' => "=",
|
||||
'lt' => "<",
|
||||
'gt' => ">",
|
||||
'lte' => "<=",
|
||||
'gte' => ">=",
|
||||
'neqs' => "<>",
|
||||
'neqn' => "!=",
|
||||
'like' => "like",
|
||||
'nlike' => "not like",
|
||||
],
|
||||
// 'css' => []
|
||||
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return $this->createProductDataGrid()->render();
|
||||
// return $this->getProducts();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,32 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Admin\Http\ViewComposers\DataGrids;
|
||||
namespace Webkul\Admin\DataGrids;
|
||||
|
||||
use Illuminate\View\View;
|
||||
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||
|
||||
// use App\Repositories\UserRepository;
|
||||
/**
|
||||
* User Roles DataGrid
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
class RolesComposer
|
||||
class RolesDataGrid
|
||||
{
|
||||
/**
|
||||
* The Data Grid implementation.
|
||||
*
|
||||
* @var CountryComposer
|
||||
* for countries
|
||||
* @var RolesDataGrid
|
||||
* for Roles
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Bind data to the view.
|
||||
*
|
||||
* @param View $view
|
||||
* @return void
|
||||
*/
|
||||
public function compose(View $view)
|
||||
public function createRolesDataGrid()
|
||||
{
|
||||
|
||||
$datagrid = DataGrid::make([
|
||||
return DataGrid::make([
|
||||
'name' => 'Roles',
|
||||
'table' => 'roles',
|
||||
'select' => 'id',
|
||||
|
|
@ -72,21 +71,21 @@ class RolesComposer
|
|||
|
||||
[
|
||||
'name' => 'id',
|
||||
'alias' => 'r_id',
|
||||
'alias' => 'roleId',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'name',
|
||||
'alias' => 'r_name',
|
||||
'alias' => 'roleName',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'permission_type',
|
||||
'alias' => 'r_permission_type',
|
||||
'alias' => 'rolePermissionType',
|
||||
'type' => 'string',
|
||||
'label' => 'Permission Type',
|
||||
'sortable' => true,
|
||||
|
|
@ -99,19 +98,19 @@ class RolesComposer
|
|||
'filterable' => [
|
||||
[
|
||||
'column' => 'id',
|
||||
'alias' => 'r_id',
|
||||
'alias' => 'roleId',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
],
|
||||
[
|
||||
'column' => 'name',
|
||||
'alias' => 'r_name',
|
||||
'alias' => 'roleName',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
],
|
||||
[
|
||||
'column' => 'permission_type',
|
||||
'alias' => 'r_permission_type',
|
||||
'alias' => 'rolePermissionType',
|
||||
'type' => 'string',
|
||||
'label' => 'Permission Type',
|
||||
],
|
||||
|
|
@ -148,7 +147,10 @@ class RolesComposer
|
|||
|
||||
]);
|
||||
|
||||
$view->with('datagrid', $datagrid);
|
||||
// $view->with('count', $this->users->count());
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return $this->createRolesDataGrid()->render();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Admin\Http\ViewComposers\DataGrids;
|
||||
namespace Webkul\Admin\DataGrids;
|
||||
|
||||
use Illuminate\View\View;
|
||||
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||
|
||||
// use App\Repositories\UserRepository;
|
||||
/**
|
||||
* Sliders DataGrid
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
class SliderComposer
|
||||
class SliderDataGrid
|
||||
{
|
||||
/**
|
||||
* The Data Grid implementation.
|
||||
*
|
||||
* @var CountryComposer
|
||||
* for countries
|
||||
* @var SliderDataGrid
|
||||
* for Sliders
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Bind data to the view.
|
||||
*
|
||||
* @param View $view
|
||||
* @return void
|
||||
*/
|
||||
public function compose(View $view)
|
||||
public function createSliderDataGrid()
|
||||
{
|
||||
|
||||
$datagrid = DataGrid::make([
|
||||
return DataGrid::make([
|
||||
'name' => 'Sliders',
|
||||
'table' => 'sliders as s',
|
||||
'select' => 's.id',
|
||||
|
|
@ -72,27 +70,27 @@ class SliderComposer
|
|||
|
||||
[
|
||||
'name' => 's.id',
|
||||
'alias' => 'slider_id',
|
||||
'alias' => 'sliderId',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 's.title',
|
||||
'alias' => 'slider_title',
|
||||
'alias' => 'sliderTitle',
|
||||
'type' => 'string',
|
||||
'label' => 'title',
|
||||
],
|
||||
[
|
||||
'name' => 's.channel_id',
|
||||
'alias' => 'channel_id',
|
||||
'alias' => 'channelId',
|
||||
'type' => 'string',
|
||||
'label' => 'Channel ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'c.name',
|
||||
'alias' => 'channel_name',
|
||||
'alias' => 'channelName',
|
||||
'type' => 'string',
|
||||
'label' => 'Channel Name',
|
||||
'sortable' => true,
|
||||
|
|
@ -153,7 +151,10 @@ class SliderComposer
|
|||
|
||||
]);
|
||||
|
||||
$view->with('datagrid', $datagrid);
|
||||
// $view->with('count', $this->users->count());
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return $this->createSliderDataGrid()->render();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,33 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Admin\Http\ViewComposers\DataGrids;
|
||||
namespace Webkul\Admin\DataGrids;
|
||||
|
||||
use Illuminate\View\View;
|
||||
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||
|
||||
// use App\Repositories\UserRepository;
|
||||
/**
|
||||
* Users DataGrid
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
class UserComposer
|
||||
class UserDataGrid
|
||||
{
|
||||
/**
|
||||
* The Data Grid implementation.
|
||||
*
|
||||
* @var UserComposer
|
||||
* for admin
|
||||
* @var UserDataGrid
|
||||
* for admin users
|
||||
*/
|
||||
protected $users;
|
||||
|
||||
|
||||
/**
|
||||
* Bind data to the view.
|
||||
*
|
||||
* @param View $view
|
||||
* @return void
|
||||
*/
|
||||
public function compose(View $view)
|
||||
public function createUserDataGrid()
|
||||
{
|
||||
|
||||
$datagrid = DataGrid::make([
|
||||
return DataGrid::make([
|
||||
'name' => 'Admins',
|
||||
'table' => 'admins as u',
|
||||
'select' => 'u.id',
|
||||
|
|
@ -59,7 +56,8 @@ class UserComposer
|
|||
'route' => route('admin.datagrid.delete'),
|
||||
'confirm_text' => 'Do you really want to do this?',
|
||||
'icon' => 'icon pencil-lg-icon',
|
||||
], [
|
||||
],
|
||||
[
|
||||
'type' => 'Delete',
|
||||
'route' => route('admin.datagrid.delete'),
|
||||
'confirm_text' => 'Do you really want to do this?',
|
||||
|
|
@ -148,14 +146,16 @@ class UserComposer
|
|||
'alias' => 'Name',
|
||||
'type' => 'string',
|
||||
'label' => 'Name'
|
||||
], [
|
||||
],
|
||||
[
|
||||
'column' => 'u.id',
|
||||
'alias' => 'ID',
|
||||
'type' => 'number',
|
||||
'label' => 'Admin ID'
|
||||
], [
|
||||
],
|
||||
[
|
||||
'column' => 'r.id',
|
||||
'alias' => 'Role_ID',
|
||||
'alias' => 'xc',
|
||||
'type' => 'number',
|
||||
'label' => 'Role ID'
|
||||
]
|
||||
|
|
@ -166,7 +166,8 @@ class UserComposer
|
|||
'column' => 'u.email',
|
||||
'type' => 'string',
|
||||
'label' => 'E-Mail'
|
||||
], [
|
||||
],
|
||||
[
|
||||
'column' => 'u.name',
|
||||
'type' => 'string',
|
||||
'label' => 'Name'
|
||||
|
|
@ -187,7 +188,11 @@ class UserComposer
|
|||
|
||||
]);
|
||||
|
||||
$view->with('datagrid', $datagrid);
|
||||
// $view->with('count', $this->users->count());
|
||||
}
|
||||
|
||||
public function render() {
|
||||
|
||||
return $this->createUserDataGrid()->render();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -6,7 +6,6 @@ use Illuminate\Support\ServiceProvider;
|
|||
use Illuminate\Support\Facades\Event;
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Webkul\Admin\Providers\EventServiceProvider;
|
||||
use Webkul\Admin\Providers\ComposerServiceProvider;
|
||||
|
||||
class AdminServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
|
@ -30,7 +29,6 @@ class AdminServiceProvider extends ServiceProvider
|
|||
$this->composeView();
|
||||
|
||||
$this->app->register(EventServiceProvider::class);
|
||||
$this->app->register(ComposerServiceProvider::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,58 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Admin\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use View;
|
||||
|
||||
class ComposerServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register bindings in the container.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
|
||||
//for the users in the countries dashboard
|
||||
View::composer('admin::settings.countries.index', 'Webkul\Admin\Http\ViewComposers\DataGrids\CountryComposer');
|
||||
|
||||
//for the users in the admin dashboard
|
||||
View::composer('admin::users.users.index', 'Webkul\Admin\Http\ViewComposers\DataGrids\UserComposer');
|
||||
|
||||
//for the users in the admin dashboard
|
||||
View::composer('admin::users.roles.index', 'Webkul\Admin\Http\ViewComposers\DataGrids\RolesComposer');
|
||||
|
||||
//for the locales in admin dashboard
|
||||
View::composer('admin::settings.locales.index', 'Webkul\Admin\Http\ViewComposers\DataGrids\LocalesComposer');
|
||||
|
||||
//for the currencies in admin dashboard
|
||||
View::composer('admin::settings.currencies.index', 'Webkul\Admin\Http\ViewComposers\DataGrids\CurrenciesComposer');
|
||||
|
||||
//for the Exchange Rates in admin dashboard
|
||||
View::composer('admin::settings.exchange_rates.index', 'Webkul\Admin\Http\ViewComposers\DataGrids\ExchangeRatesComposer');
|
||||
|
||||
//for inventory sources in admin dashboard
|
||||
View::composer('admin::settings.inventory_sources.index', 'Webkul\Admin\Http\ViewComposers\DataGrids\InventorySourcesComposer');
|
||||
|
||||
//for channels in admin dashboard
|
||||
View::composer('admin::settings.channels.index', 'Webkul\Admin\Http\ViewComposers\DataGrids\ChannelsComposer');
|
||||
|
||||
//for sliders in admin dashboard
|
||||
View::composer('admin::settings.sliders.index', 'Webkul\Admin\Http\ViewComposers\DataGrids\SliderComposer');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
|
|
@ -128,7 +128,7 @@ class EventServiceProvider extends ServiceProvider
|
|||
Event::fire('admin.catalog.products.accordian.build', $accordian);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Event::listen('admin.catalog.products.accordian.build', function($accordian) {
|
||||
$accordian->add('inventories', 'Inventories', 'admin::catalog.products.accordians.inventories', 1);
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
@inject('attributes','Webkul\Admin\DataGrids\AttributeDataGrid')
|
||||
{!! $attributes->render() !!}
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
|
@ -15,7 +15,8 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
@inject('categories','Webkul\Admin\DataGrids\CategoryDataGrid')
|
||||
{!! $categories->render() !!}
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
|
@ -15,7 +15,8 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
@inject('attributefamily','Webkul\Admin\DataGrids\AttributeFamilyDataGrid')
|
||||
{!! $attributefamily->render() !!}
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
<div class="content">
|
||||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
{{ __('admin::app.catalog.products.products') }}
|
||||
<h1>{{ __('admin::app.catalog.products.products') }}</h1>
|
||||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
|
|
@ -15,7 +15,8 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
@inject('product','Webkul\Admin\DataGrids\ProductDataGrid')
|
||||
{!! $product->render() !!}
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
|
@ -15,7 +15,8 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
{!! $datagrid->render() !!}
|
||||
@inject('channels','Webkul\Admin\DataGrids\ChannelDataGrid')
|
||||
{!! $channels->render() !!}
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
|
@ -15,7 +15,8 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
{!! $datagrid->render() !!}
|
||||
@inject('countries','Webkul\Admin\DataGrids\CountryDataGrid')
|
||||
{!! $countries->render() !!}
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
|
@ -15,7 +15,8 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
{!! $datagrid->render() !!}
|
||||
@inject('currencies','Webkul\Admin\DataGrids\CurrencyDataGrid')
|
||||
{!! $currencies->render() !!}
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
|
@ -19,7 +19,8 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
{!! $datagrid->render() !!}
|
||||
@inject('exchange_rates','Webkul\Admin\DataGrids\ExchangeRatesDataGrid')
|
||||
{!! $exchange_rates->render() !!}
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
|
@ -19,7 +19,8 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
{!! $datagrid->render() !!}
|
||||
@inject('inventory_sources','Webkul\Admin\DataGrids\InventorySourcesDataGrid')
|
||||
{!! $inventory_sources->render() !!}
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
|
@ -15,7 +15,9 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
{!! $datagrid->render() !!}
|
||||
|
||||
@inject('locales','Webkul\Admin\DataGrids\LocalesDataGrid')
|
||||
{!! $locales->render() !!}
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
|
@ -15,7 +15,8 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
{!! $datagrid->render() !!}
|
||||
@inject('sliders','Webkul\Admin\DataGrids\SliderDataGrid')
|
||||
{!! $sliders->render() !!}
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
|
@ -15,7 +15,8 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
{!! $datagrid->render() !!}
|
||||
@inject('roles','Webkul\Admin\DataGrids\RolesDataGrid')
|
||||
{!! $roles->render() !!}
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
<div class="page-content">
|
||||
|
||||
@inject('datagrid','Webkul\Admin\DataGrids\UserDataGrid')
|
||||
{!! $datagrid->render() !!}
|
||||
{{-- <datetime></datetime> --}}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ class AttributeFamilyTableSeeder extends Seeder
|
|||
{
|
||||
$this->attributeFamily = $attributeFamily;
|
||||
}
|
||||
|
||||
|
||||
public function run()
|
||||
{
|
||||
foreach($this->rawData as $row) {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ use Webkul\Attribute\Models\Attribute;
|
|||
class AttributeOption extends TranslatableModel
|
||||
{
|
||||
public $timestamps = false;
|
||||
|
||||
|
||||
public $translatedAttributes = ['label'];
|
||||
|
||||
protected $fillable = ['admin_name', 'sort_order'];
|
||||
|
|
@ -19,6 +19,6 @@ class AttributeOption extends TranslatableModel
|
|||
*/
|
||||
public function attribute()
|
||||
{
|
||||
return $this->belongsTo(Attribute::class);
|
||||
return $this->model()->getCustomAttributesAttribute();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
<?php
|
||||
|
||||
namespace Webkul\Attribute\Repositories;
|
||||
|
||||
|
||||
use Webkul\Core\Eloquent\Repository;
|
||||
use Webkul\Attribute\Repositories\AttributeRepository;
|
||||
use Webkul\Attribute\Repositories\AttributeGroupRepository;
|
||||
|
|
@ -97,7 +97,7 @@ class AttributeFamilyRepository extends Repository
|
|||
$family->update($data);
|
||||
|
||||
$previousAttributeGroupIds = $family->attribute_groups()->pluck('id');
|
||||
|
||||
|
||||
if(isset($data['attribute_groups'])) {
|
||||
foreach ($data['attribute_groups'] as $attributeGroupId => $attributeGroupInputs) {
|
||||
if (str_contains($attributeGroupId, 'group_')) {
|
||||
|
|
@ -116,7 +116,7 @@ class AttributeFamilyRepository extends Repository
|
|||
|
||||
$attributeGroup = $this->attributeGroup->findOrFail($attributeGroupId);
|
||||
$attributeGroup->update($attributeGroupInputs);
|
||||
|
||||
|
||||
$attributeIds = $attributeGroup->custom_attributes()->get()->pluck('id');
|
||||
|
||||
if(isset($attributeGroupInputs['custom_attributes'])) {
|
||||
|
|
|
|||
|
|
@ -24,28 +24,28 @@ class ProductController extends Controller
|
|||
* @var array
|
||||
*/
|
||||
protected $_config;
|
||||
|
||||
|
||||
/**
|
||||
* AttributeFamilyRepository object
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $attributeFamily;
|
||||
|
||||
|
||||
/**
|
||||
* CategoryRepository object
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $category;
|
||||
|
||||
|
||||
/**
|
||||
* InventorySourceRepository object
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $inventorySource;
|
||||
|
||||
|
||||
/**
|
||||
* ProductRepository object
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
/node_modules
|
||||
/package-lock.json
|
||||
/package-lock.json
|
||||
npm-debug.log
|
||||
|
|
@ -22,14 +22,14 @@ class CategoryController extends Controller
|
|||
* @var array
|
||||
*/
|
||||
protected $_config;
|
||||
|
||||
|
||||
/**
|
||||
* CategoryRepository object
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $category;
|
||||
|
||||
|
||||
/**
|
||||
* ProductRepository object
|
||||
*
|
||||
|
|
@ -65,4 +65,4 @@ class CategoryController extends Controller
|
|||
|
||||
return view($this->_config['view'], compact('category'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,13 +6,16 @@ use Illuminate\Http\Request;
|
|||
use Illuminate\Http\Response;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Webkul\Core\Repositories\SliderRepository as Sliders;
|
||||
use Webkul\Channel\Channel as Channel;
|
||||
|
||||
/**
|
||||
* Admin user session controller
|
||||
* Home page controller
|
||||
*
|
||||
* @author Jitendra Singh <jitendra@webkul.com>
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com>
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class HomeController extends controller
|
||||
|
||||
class HomeController extends controller
|
||||
{
|
||||
protected $_config;
|
||||
protected $sliders;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ use Illuminate\Routing\Controller;
|
|||
use Webkul\Core\Repositories\SliderRepository as Slider;
|
||||
|
||||
/**
|
||||
* Slider controller
|
||||
* Slider controller for managing the slider controls.
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com>
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
|
|
|
|||
|
|
@ -7,6 +7,14 @@ use Illuminate\Support\Collection;
|
|||
|
||||
use Webkul\Category\Repositories\CategoryRepository as Category;
|
||||
|
||||
|
||||
/**
|
||||
* Category List Composer on Navigation Menu
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com>
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
class CategoryComposer
|
||||
{
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
Route::group(['middleware' => ['web']], function () {
|
||||
|
||||
Route::get('/', 'Webkul\Shop\Http\Controllers\HomeController@index')->defaults('_config', [
|
||||
'view' => 'shop::home.index'
|
||||
]);
|
||||
|
|
@ -8,4 +9,4 @@ Route::group(['middleware' => ['web']], function () {
|
|||
Route::get('/categories/{slug}', 'Webkul\Shop\Http\Controllers\CategoryController@index')->defaults('_config', [
|
||||
'view' => 'shop::products.index'
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="254px" height="236px" viewBox="0 0 254 236" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 50 (54983) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>404-image</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Desktop" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.5">
|
||||
<g id="404-page" transform="translate(-960.000000, -288.000000)">
|
||||
<g id="404-image" transform="translate(961.000000, 289.000000)">
|
||||
<polyline id="Path-3" stroke="#242424" stroke-width="3" points="0.626953125 0.990234375 34.3359375 26.4658203 34.6796875 73.1640625 34.3359375 186.773437 160.960938 215.992187 210.71875 130.375 34.3359375 72.71875"></polyline>
|
||||
<g id="Group" transform="translate(46.000000, 190.000000)" fill="#FFFFFF" stroke="#242424" stroke-width="3">
|
||||
<circle id="Oval" cx="22.5" cy="22.5" r="21"></circle>
|
||||
<circle id="Oval" cx="23" cy="23" r="5.5"></circle>
|
||||
</g>
|
||||
<g id="Group" transform="translate(208.000000, 163.000000)" fill="#FFFFFF" stroke="#242424" stroke-width="3">
|
||||
<circle id="Oval" cx="22.5" cy="22.5" r="21"></circle>
|
||||
<circle id="Oval" cx="23" cy="23" r="5.5"></circle>
|
||||
</g>
|
||||
<path d="M178,205 L182,205 L182,208 L178,208 L178,205 Z M185,205 L206,205 L206,208 L185,208 L185,205 Z" id="Combined-Shape" fill="#242424" transform="translate(192.000000, 206.500000) rotate(-23.000000) translate(-192.000000, -206.500000) "></path>
|
||||
<path d="M172.473165,218.350993 L176.473165,218.350993 L176.473165,221.350993 L172.473165,221.350993 L172.473165,218.350993 Z M179.473165,218.350993 L200.473165,218.350993 L200.473165,221.350993 L179.473165,221.350993 L179.473165,218.350993 Z" id="Combined-Shape" fill="#242424" transform="translate(186.473165, 219.850993) rotate(-23.000000) translate(-186.473165, -219.850993) "></path>
|
||||
<path d="M198.610065,126.237911 L222.219028,78.9333292 L163.963322,59.4411726 L147.719875,109.950161 L198.610065,126.237911 Z" id="Path-4" stroke="#242424" stroke-width="3"></path>
|
||||
<polyline id="Path-5" stroke="#242424" stroke-width="3" points="131.557617 105.489258 134.746094 71.9423828 157.437808 79.0096878"></polyline>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.4 KiB |
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="106px" height="16px" viewBox="0 0 106 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 50 (54983) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Star-4</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Star-4" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<polygon id="Star" fill="#242424" points="8.41169779 13.2668737 3.21298265 16 4.2058489 10.2111456 2.29816166e-14 6.11145618 5.81234022 5.26687371 8.41169779 0 11.0110554 5.26687371 16.8233956 6.11145618 12.6175467 10.2111456 13.6104129 16"></polygon>
|
||||
<polygon id="Star" fill="#242424" points="31.4116978 13.2668737 26.2129827 16 27.2058489 10.2111456 23 6.11145618 28.8123402 5.26687371 31.4116978 0 34.0110554 5.26687371 39.8233956 6.11145618 35.6175467 10.2111456 36.6104129 16"></polygon>
|
||||
<polygon id="Star" fill="#242424" points="53.4116978 13.2668737 48.2129827 16 49.2058489 10.2111456 45 6.11145618 50.8123402 5.26687371 53.4116978 0 56.0110554 5.26687371 61.8233956 6.11145618 57.6175467 10.2111456 58.6104129 16"></polygon>
|
||||
<polygon id="Star" fill="#242424" points="75.4116978 13.2668737 70.2129827 16 71.2058489 10.2111456 67 6.11145618 72.8123402 5.26687371 75.4116978 0 78.0110554 5.26687371 83.8233956 6.11145618 79.6175467 10.2111456 80.6104129 16"></polygon>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 50 (54983) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>icon-grid-view</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Desktop" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Category" transform="translate(-918.000000, -652.000000)" fill="#242424">
|
||||
<g id="icon-grid-view" transform="translate(918.000000, 652.000000)">
|
||||
<rect id="1" x="0" y="0" width="10" height="10"></rect>
|
||||
<rect id="2" x="0" y="14" width="10" height="10"></rect>
|
||||
<rect id="3" x="14" y="0" width="10" height="10"></rect>
|
||||
<rect id="4" x="14" y="14" width="10" height="10"></rect>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 947 B |
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 50 (54983) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>icon-list-view</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Desktop" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Category" transform="translate(-952.000000, -652.000000)" fill="#242424">
|
||||
<g id="icon-list-view" transform="translate(952.000000, 652.000000)">
|
||||
<rect id="4" x="0" y="0" width="10" height="10"></rect>
|
||||
<rect id="4" x="0" y="14" width="10" height="10"></rect>
|
||||
<rect id="Rectangle-4" x="12" y="0" width="12" height="3"></rect>
|
||||
<rect id="Rectangle-4-Copy" x="12" y="5" width="10" height="3"></rect>
|
||||
<rect id="Rectangle-4" x="12" y="14" width="12" height="3"></rect>
|
||||
<rect id="Rectangle-4-Copy" x="12" y="19" width="10" height="3"></rect>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 50 (54983) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>icon-share</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="icon-share" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M17.6017572,10.3626848 L17.6017572,8.97307668 L17.7423684,8.6716255 C18.0755216,7.95739026 18.7398682,7.5 19.5457911,7.5 C20.1894353,7.5 20.7487974,7.78098589 21.2150301,8.2450489 L25.7080449,12.7380637 L26.4358083,14.1586418 L25.673421,15.4378805 L25.5412491,15.5700523 L21.4220501,19.6885211 C20.7714032,20.3058878 20.2492699,20.6394498 19.5457911,20.6394498 C18.4975787,20.6394498 17.9427193,19.9473628 17.6730945,19.0185829 L17.6136225,18.8137191 L17.6136225,17.7824848 L17.0348214,17.7824848 C14.7402618,18.0465879 13.3365725,18.4574553 12.9871802,18.8050312 C12.8906505,18.901059 12.7357942,19.3763592 12.6365699,20.1145364 C12.6079463,20.3274811 12.5836405,20.5556138 12.5597427,20.8255333 C12.5451306,20.9905732 12.4990927,21.5648652 12.5023767,21.5251552 C12.4357011,22.3313848 12.3949365,22.6163508 12.2061579,22.9983804 C11.452927,24.5226869 9.71842249,24.8652049 8.74190088,23.2916804 C8.3315068,22.6303892 8.01010578,21.536647 7.69057879,19.8821889 C7.45964356,18.6864444 7.38096076,16.8312152 7.7443344,15.6617817 C8.1616307,14.3188106 8.80512846,13.2419676 9.75271558,12.4112199 C11.2470104,11.1011747 13.3610793,10.4388485 16.0925932,10.3626848 L17.6017572,10.3626848 Z" id="Path-4" stroke="#242424" stroke-width="3"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
|
@ -8,7 +8,7 @@ Vue.use(VeeValidate);
|
|||
|
||||
Vue.component("category-nav", require("./components/category-nav.vue"));
|
||||
Vue.component("category-item", require("./components/category-item.vue"));
|
||||
Vue.component("image-slider", require("./components/imageSlider.vue"));
|
||||
Vue.component("image-slider", require("./components/image-slider.vue"));
|
||||
Vue.component("vue-slider", require("vue-slider-component"));
|
||||
|
||||
$(document).ready(function () {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,123 @@
|
|||
<template>
|
||||
<transition name="slide">
|
||||
<div class="slider-content" v-if="images.length>0">
|
||||
|
||||
<ul class="slider-images">
|
||||
<li v-for="(image,index) in images" :key="index" v-bind:class="{'show': index==currentIndex}">
|
||||
<img class="slider-item" :src="image" />
|
||||
<!-- <div class="show-content"></div> -->
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="slider-control" v-if="images_loaded">
|
||||
<span class="icon dark-left-icon slider-left" @click="changeIndexLeft"></span>
|
||||
<span class="icon light-right-icon slider-right" @click="changeIndexRight"></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</transition>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
|
||||
props:{
|
||||
slides: {
|
||||
type: Array,
|
||||
required: true,
|
||||
default: () => [],
|
||||
}
|
||||
},
|
||||
|
||||
data: function() {
|
||||
|
||||
return {
|
||||
images: [],
|
||||
currentIndex: -1,
|
||||
content: [],
|
||||
current: false,
|
||||
images_loaded: false,
|
||||
|
||||
};
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.getProps();
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
getProps() {
|
||||
this.setProps();
|
||||
},
|
||||
|
||||
setProps() {
|
||||
|
||||
var this_this = this;
|
||||
this.slides.forEach(function(slider) {
|
||||
this_this.images.push(slider.path);
|
||||
});
|
||||
this.currentIndex = 0;
|
||||
|
||||
if(this.images.length == 0) {
|
||||
this.images.push = "vendor/webkul/shop/assets/images/banner.png";
|
||||
} else {
|
||||
this.images_loaded = true;
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
changeIndexLeft: function() {
|
||||
|
||||
if (this.currentIndex > 0) {
|
||||
|
||||
this.currentIndex--;
|
||||
|
||||
}
|
||||
|
||||
else if(this.currentIndex == 0) {
|
||||
|
||||
this.currentIndex = this.images.length-1;
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
changeIndexRight: function() {
|
||||
|
||||
if(this.currentIndex < this.images.length-1) {
|
||||
|
||||
this.currentIndex++;
|
||||
|
||||
}
|
||||
|
||||
else if(this.currentIndex == this.images.length-1) {
|
||||
|
||||
this.currentIndex = 0;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.slide-enter-active {
|
||||
|
||||
transition: all 0.2s cubic-bezier(0.55, 0.085, 0.68, 0.53);
|
||||
|
||||
}
|
||||
.slide-leave-active {
|
||||
|
||||
transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
||||
|
||||
}
|
||||
|
||||
.slide-enter, .slide-leave-to {
|
||||
|
||||
-webkit-transform: scaleY(0) translateZ(0);
|
||||
transform: scaleY(0) translateZ(0);
|
||||
opacity: 0;
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
<template>
|
||||
<div class="slider-content">
|
||||
<ul class="slider-images">
|
||||
<li>
|
||||
<img class="slider-item" :src="images[currentIndex]" />
|
||||
<div class="show-content"></div>
|
||||
</li>
|
||||
<div class="slider-control">
|
||||
<span class="icon dark-left-icon slider-left" @click="changeIndexLeft"></span>
|
||||
<span class="icon light-right-icon slider-right" @click="changeIndexRight"></span>
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
|
||||
props:{
|
||||
slides: {
|
||||
type: Array,
|
||||
required: true,
|
||||
default: () => [],
|
||||
}
|
||||
},
|
||||
|
||||
data: function() {
|
||||
|
||||
return {
|
||||
images: [
|
||||
// "vendor/webkul/shop/assets/images/banner.png"
|
||||
],
|
||||
currentIndex: 0,
|
||||
content: [],
|
||||
|
||||
};
|
||||
},
|
||||
|
||||
mounted(){
|
||||
this.getProps();
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
getProps() {
|
||||
this.setProps();
|
||||
},
|
||||
|
||||
setProps() {
|
||||
for(var i=0;i<this.slides.length;i++) {
|
||||
this.images.push(this.slides[i].path);
|
||||
this.content.push(this.slides[i].content);
|
||||
}
|
||||
if($('.show-content').html(this.content[0]))
|
||||
console.log('content pushed');
|
||||
else
|
||||
console.log('cannot push');
|
||||
},
|
||||
|
||||
changeIndexLeft: function() {
|
||||
if (this.currentIndex > 0) {
|
||||
this.currentIndex--;
|
||||
if($('.show-content').html(this.content[this.currentIndex]))
|
||||
console.log('content pushed');
|
||||
else
|
||||
console.log('cannot push');
|
||||
}
|
||||
|
||||
else if(this.currentIndex == 0) {
|
||||
this.currentIndex = this.images.length-1;
|
||||
if($('.show-content').html(this.content[this.currentIndex]))
|
||||
console.log('content pushed');
|
||||
else
|
||||
console.log('cannot push');
|
||||
}
|
||||
|
||||
},
|
||||
changeIndexRight: function() {
|
||||
if(this.currentIndex < this.images.length-1) {
|
||||
this.currentIndex++;
|
||||
if($('.show-content').html(this.content[this.currentIndex]))
|
||||
console.log('content pushed');
|
||||
else
|
||||
console.log('cannot push');
|
||||
}
|
||||
|
||||
else if(this.currentIndex == this.images.length-1) {
|
||||
this.currentIndex = 0;
|
||||
if($('.show-content').html(this.content[this.currentIndex]))
|
||||
console.log('content pushed');
|
||||
else
|
||||
console.log('cannot push');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
//shop variables
|
||||
$font-name: "Montserrat", sans-serif;
|
||||
$background-color: #f2f2f2;
|
||||
$footer-back: #f2f2f2;
|
||||
$list-heading-color: rgba(165, 165, 165, 1);
|
||||
$list-color: #242424;
|
||||
$subscribe-btn-color: black;
|
||||
|
|
@ -13,6 +14,16 @@ $offer-color: #ff6472;
|
|||
$sign-up-text-color: #5e5e5e;
|
||||
$login-text: #3a3a3a;
|
||||
$background-color: #ffffff;
|
||||
$color-black : black;
|
||||
$forgot-password-color: #0031f0;
|
||||
$profile-content-color: #5e5e5e;
|
||||
$horizontal-rule-color: #E8E8E8;
|
||||
//customer variables ends here
|
||||
|
||||
//product
|
||||
$real-price:#A5A5A5;
|
||||
$product-font-color: #242424;
|
||||
$product-price-color: #FF6472;
|
||||
$dark-blue-shade: #0031F0;
|
||||
$bar-color: #D8D8D8;
|
||||
$gray-shade: #5E5E5E;
|
||||
|
|
@ -58,7 +58,7 @@ body {
|
|||
font-size: 14px;
|
||||
}
|
||||
|
||||
.q-c {
|
||||
.search-icon-wrapper {
|
||||
box-sizing: border-box;
|
||||
height: 38px;
|
||||
width: 38px;
|
||||
|
|
@ -113,10 +113,10 @@ body {
|
|||
}
|
||||
}
|
||||
|
||||
ul.product-dropdown-container {
|
||||
ul.cart-dropdown {
|
||||
float: right;
|
||||
|
||||
li.product-dropdown {
|
||||
li.cart-summary {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin-left: 14px;
|
||||
|
|
@ -284,44 +284,65 @@ body {
|
|||
}
|
||||
}
|
||||
|
||||
.slider-block {
|
||||
section.slider-block {
|
||||
display: block;
|
||||
width: 80%;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-bottom: 5%;
|
||||
|
||||
.slider-content {
|
||||
div.slider-content {
|
||||
width: 80%;
|
||||
height: 500px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
|
||||
|
||||
ul.slider-images {
|
||||
li img {
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
object-fit: fill;
|
||||
|
||||
li{
|
||||
//both rules are equivalent to display none
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.slider-control {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
position: absolute;
|
||||
right: 10%;
|
||||
margin-top: -60px;
|
||||
margin-right: 10px;
|
||||
li.show {
|
||||
display:block;
|
||||
visibility: visible;
|
||||
width: 80%;
|
||||
animation-name: example;
|
||||
animation-duration: 4s;
|
||||
}
|
||||
|
||||
.dark-left-icon {
|
||||
background-color: white;
|
||||
height: 48px;
|
||||
width: 48px;
|
||||
max-height: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
@keyframes example {
|
||||
0% {opacity: 0.1;}
|
||||
100% {opacity: 1;}
|
||||
}
|
||||
|
||||
.light-right-icon {
|
||||
background-color: black;
|
||||
height: 48px;
|
||||
width: 48px;
|
||||
max-height: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
li img {
|
||||
height: 500px;
|
||||
width:100%;
|
||||
}
|
||||
}
|
||||
div.slider-control {
|
||||
display: block;
|
||||
position: absolute;
|
||||
user-select: none;
|
||||
bottom: 2%;
|
||||
right: 11%;
|
||||
|
||||
|
||||
.dark-left-icon {
|
||||
background-color: $background-color;
|
||||
height: 48px;
|
||||
width: 48px;
|
||||
max-height: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.light-right-icon {
|
||||
background-color: $color-black;
|
||||
height: 48px;
|
||||
width: 48px;
|
||||
max-height: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -384,7 +405,7 @@ body {
|
|||
|
||||
.checkbox {
|
||||
margin: 0;
|
||||
|
||||
|
||||
.checkbox-view {
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
|
|
@ -452,7 +473,7 @@ body {
|
|||
margin-bottom: 14px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
.product-price {
|
||||
font-size: 16px;
|
||||
margin-bottom: 14px;
|
||||
|
|
@ -572,7 +593,7 @@ body {
|
|||
}
|
||||
|
||||
.footer {
|
||||
background-color: $background-color;
|
||||
background-color: $footer-back;
|
||||
padding-left: 10%;
|
||||
padding-right: 10%;
|
||||
|
||||
|
|
@ -733,7 +754,7 @@ body {
|
|||
align-content: center;
|
||||
justify-content: flex-start;
|
||||
border: 1px solid #e8e8e8;
|
||||
background: #ffffff;
|
||||
background: $background-color;
|
||||
width: 25%;
|
||||
height: 100%;
|
||||
text-transform: capitalize;
|
||||
|
|
@ -762,7 +783,7 @@ body {
|
|||
}
|
||||
|
||||
li.active {
|
||||
color: #0031f0;
|
||||
color: $forgot-password-color;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -815,7 +836,7 @@ body {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//edit form
|
||||
.edit-form-content {
|
||||
margin-left: 5.5%;
|
||||
|
|
@ -848,4 +869,4 @@ body {
|
|||
}
|
||||
//edit form ends
|
||||
}
|
||||
//account ends here
|
||||
//account ends here
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
@extends('shop::layouts.master')
|
||||
|
||||
@section('content-wrapper')
|
||||
<div class="account-content">
|
||||
@include('shop::customers.account.partials.sidemenu')
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
@extends('shop::layouts.master')
|
||||
|
||||
@section('content-wrapper')
|
||||
<div class="account-content">
|
||||
@include('shop::customers.account.partials.sidemenu')
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
@extends('shop::layouts.master')
|
||||
|
||||
@section('content-wrapper')
|
||||
|
||||
<div class="content">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,66 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>Foo</title>
|
||||
<style>
|
||||
.container {
|
||||
box-sizing: border-box;
|
||||
max-width: 50%;
|
||||
border: 1px solid green;
|
||||
height: 95vh;
|
||||
}
|
||||
|
||||
.last-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(47.5%, 1fr));
|
||||
grid-gap: 5%;
|
||||
}
|
||||
|
||||
.block1 {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
background: pink;
|
||||
height: 95vh;
|
||||
}
|
||||
|
||||
.block2 {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
/* background: red; */
|
||||
height: 95vh;
|
||||
display: grid;
|
||||
grid-template-rows: 47.5% 47.5%;
|
||||
grid-row-gap: 5%;
|
||||
}
|
||||
|
||||
.sub-block1 {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
background: green;
|
||||
}
|
||||
|
||||
.sub-block2 {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
background: paleturquoise;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="last-grid">
|
||||
<div class="block1"></div>
|
||||
<div class="block2">
|
||||
<div class="sub-block1"></div>
|
||||
<div class="sub-block2"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
<div class="footer">
|
||||
<div class="footer-content">
|
||||
<div class="footer-list-container">
|
||||
<div class="list-container">
|
||||
<span class="list-heading">Categories</span>
|
||||
<ul class="list-group">
|
||||
<li>MEN</li>
|
||||
<li>Women</li>
|
||||
<li>Kids</li>
|
||||
<li>Accessories</li>
|
||||
<li>Home & Living</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="list-container">
|
||||
<span class="list-heading">Quick Links</span>
|
||||
<ul class="list-group">
|
||||
<li>About Us</li>
|
||||
<li>Return Policy</li>
|
||||
<li>Refund Policy</li>
|
||||
<li>Terms and conditions</li>
|
||||
<li>Terms of Use</li>
|
||||
<li>Contact Us</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="list-container">
|
||||
<span class="list-heading">Connect With Us</span>
|
||||
<ul class="list-group">
|
||||
<li><span class="icon-wrapper"><span class="icon icon-dashboard"></span></span>Facebook</li>
|
||||
<li><span class="icon-wrapper"><span class="icon icon-dashboard"></span></span>Twitter</li>
|
||||
<li><span class="icon-wrapper"><span class="icon icon-dashboard"></span></span>Instagram</li>
|
||||
<li><span class="icon-wrapper"><span class="icon icon-dashboard"></span></span>Google+</li>
|
||||
<li><span class="icon-wrapper"><span class="icon icon-dashboard"></span></span>LinkedIn</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div class="list-container">
|
||||
<span class="list-heading">Subscribe Newsletter</span>
|
||||
<div class="form-container">
|
||||
<div class="control-group">
|
||||
<input type="text" class="control subscribe-field" placeholder="Email Address"><br/>
|
||||
<button class="btn btn-md btn-primary">Subscribe</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,26 +1,31 @@
|
|||
<div class="header">
|
||||
|
||||
<div class="header-top">
|
||||
|
||||
<div class="left-content">
|
||||
|
||||
<ul class="logo-container">
|
||||
<li>
|
||||
<a href="">
|
||||
<a href="{{ route('store.home') }}">
|
||||
<img class="logo" src="vendor/webkul/shop/assets/images/logo.svg" />
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="search-container">
|
||||
|
||||
<ul class="search-container">
|
||||
<li class="search-group">
|
||||
<input type="search" class="search-field" placeholder="Search for products">
|
||||
<div class="q-c">
|
||||
<div class="search-icon-wrapper">
|
||||
<span class="icon search-icon"></span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="right-content">
|
||||
|
||||
{{-- Triggered on responsive mode only --}}
|
||||
<ul class="search-dropdown-container">
|
||||
<li class="search-dropdown">
|
||||
|
||||
|
|
@ -28,40 +33,68 @@
|
|||
</ul>
|
||||
|
||||
<ul class="account-dropdown-container">
|
||||
|
||||
<li class="account-dropdown">
|
||||
|
||||
<span class="icon account-icon"></span>
|
||||
|
||||
<div class="dropdown-toggle">
|
||||
|
||||
<div style="display: inline-block; cursor: pointer;">
|
||||
<span class="name">Account</span>
|
||||
</div>
|
||||
|
||||
<i class="icon arrow-down-icon active"></i>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="dropdown-list bottom-right" style="display: none;">
|
||||
|
||||
<div class="dropdown-container">
|
||||
|
||||
<label>Account</label>
|
||||
|
||||
<ul>
|
||||
<li><a href="{{ route('customer.session.index') }}">Sign In</a></li>
|
||||
<li><a href="{{ route('customer.register.index') }}">Sign Up</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<ul class="product-dropdown-container">
|
||||
<li class="product-dropdown">
|
||||
<ul class="cart-dropdown">
|
||||
|
||||
<li class="cart-summary">
|
||||
|
||||
<span class="icon cart-icon"></span>
|
||||
|
||||
<span class="cart"><span class="cart-count">5</span>Products</span>
|
||||
|
||||
<span class="icon arrow-down-icon"></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
{{-- Meant for responsive views only --}}
|
||||
<ul class="ham-dropdown-container">
|
||||
|
||||
<li class="ham-dropdown">
|
||||
{{-- use this section for the dropdown of the hamburger menu --}}
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<div class="right-responsive">
|
||||
|
||||
<ul class="right-wrapper">
|
||||
<li class="search-box"><span class="icon search-icon"></span></li>
|
||||
<li class="account-box"><span class="icon account-icon"></span></li>
|
||||
|
|
@ -71,9 +104,11 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header-bottom">
|
||||
@include('shop::layouts.header.nav-menu.navmenu')
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@push('scripts')
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
<link rel="stylesheet" href="{{ asset('vendor/webkul/ui/assets/css/ui.css') }}">
|
||||
|
||||
@yield('head')
|
||||
|
||||
|
||||
@yield('css')
|
||||
|
||||
</head>
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@include('shop::layouts.footer')
|
||||
|
||||
</div>
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
|
||||
<script type="text/javascript" src="{{ bagisto_asset('js/shop.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('vendor/webkul/ui/assets/js/ui.js') }}"></script>
|
||||
|
||||
|
||||
@stack('scripts')
|
||||
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
@extends('shop::layouts.master')
|
||||
@section('slider')
|
||||
@include('shop::store.slider.slider')
|
||||
@endsection
|
||||
@section('content-wrapper')
|
||||
@include('shop::store.grids.featured.featuredproductgrid')
|
||||
@include('shop::store.grids.newproduct.newproductgrid')
|
||||
@include('shop::store.grids.newsupdate.newsupdategrid')
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,285 @@
|
|||
@extends('shop::layouts.master')
|
||||
@section('content-wrapper')
|
||||
<section class="product-detail">
|
||||
<div class="category-breadcrumbs">
|
||||
|
||||
<span class="breadcrumb">Home</span> > <span class="breadcrumb">Men</span> > <span class="breadcrumb">Slit Open Jeans</span>
|
||||
|
||||
</div>
|
||||
<div class="layouter">
|
||||
|
||||
<div class="product-image-group">
|
||||
|
||||
<div class="side-group">
|
||||
<img src="{{ asset('vendor/webkul/shop/assets/images/jeans.jpg') }}" />
|
||||
<img src="{{ asset('vendor/webkul/shop/assets/images/jeans.jpg') }}" />
|
||||
<img src="{{ asset('vendor/webkul/shop/assets/images/jeans.jpg') }}" />
|
||||
<img src="{{ asset('vendor/webkul/shop/assets/images/jeans.jpg') }}" />
|
||||
</div>
|
||||
|
||||
<div class="product-hero-image">
|
||||
<img src="{{ asset('vendor/webkul/shop/assets/images/jeans_big.jpg') }}" />
|
||||
<img class="wishlist" src="{{ asset('vendor/webkul/shop/assets/images/wish.svg') }}" />
|
||||
<img class="share" src="{{ asset('vendor/webkul/shop/assets/images/icon-share.svg') }}" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="details">
|
||||
|
||||
<div class="product-heading">
|
||||
<span>Rainbow creation Embroidered</span>
|
||||
</div>
|
||||
<div class="rating">
|
||||
<img src="{{ asset('vendor/webkul/shop/assets/images/5star.svg') }}" />
|
||||
75 Ratings & 11 Reviews
|
||||
</div>
|
||||
<div class="price">
|
||||
<span class="main-price">
|
||||
$24.00
|
||||
</span>
|
||||
<span class="real-price">
|
||||
$25.00
|
||||
</span>
|
||||
<span class="discount">
|
||||
10% Off
|
||||
</span>
|
||||
</div>
|
||||
<div class="stock-status">
|
||||
InStock
|
||||
</div>
|
||||
<br/>
|
||||
<div class="description">
|
||||
Bluetooth-enabled connectivity with NFC provides 100% independence, device compatibility and freedom of movement Ear-cup-mounted sensors for easy-access, touch-sensitive control 30mm drivers.
|
||||
</div>
|
||||
|
||||
<hr/>
|
||||
|
||||
<div class="attributes">
|
||||
|
||||
<div class="attribute color">
|
||||
<div class="title">Color</div>
|
||||
|
||||
<div class="values">
|
||||
<div class="colors red"></div>
|
||||
<div class="colors blue"></div>
|
||||
<div class="colors green"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="attribute size">
|
||||
<div class="title">Size</div>
|
||||
|
||||
<div class="values">
|
||||
<div class="size xl">XL</div>
|
||||
<div class="size xxl">XXL</div>
|
||||
<div class="size xxxl">XXXL</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="attribute quantity">
|
||||
<div class="title">Quantity</div>
|
||||
|
||||
<div class="values">
|
||||
<div class="size">1</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<hr/>
|
||||
{{-- The elements below will be accordians --}}
|
||||
<div class="full-description">
|
||||
<h4>Description</h4>
|
||||
Bluetooth-enabled connectivity with NFC provides 100% independence, device compatibility and freedom of movement Ear-cup-mounted sensors for easy-access, touch-sensitive control 30mm drivers
|
||||
|
||||
Bluetooth-enabled connectivity with NFC provides 100% independence, device compatibility and freedom of movement Ear-cup-mounted sensors for easy-access, touch-sensitive control 30mm d rivers. Bluetooth-enabled connectivity with NFC provides 100% independence, device compatibility and freedom of movement Ear-cup-mounted sensors for easy-access, touch-sensitive control 30mm drivers
|
||||
|
||||
NFC provides 100% independence, device compatibility and freedom of movement Ear-cup-mounted sensors for easy-access, touch-sensitive control 30mm drivers
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="full-specifications">
|
||||
<h4>Specification</h4>
|
||||
</div>
|
||||
|
||||
<hr/>
|
||||
|
||||
<div class="rating-reviews">
|
||||
<div class="title">
|
||||
Ratings & Reviews
|
||||
</div>
|
||||
<div class="overall">
|
||||
<span class="number">
|
||||
4.3
|
||||
</span>
|
||||
<span class="stars">
|
||||
<img src="{{ asset('vendor/webkul/shop/assets/images/5star.svg') }}" />
|
||||
</span>
|
||||
|
||||
<button class="btn btn-md btn-primary">Write Review</button>
|
||||
|
||||
<div class="total-reviews">
|
||||
24,330 Ratings & 104 Reviews
|
||||
</div>
|
||||
</div>
|
||||
<div class="reviews">
|
||||
<div class="review">
|
||||
<div class="title">
|
||||
Awesome
|
||||
</div>
|
||||
<div class="stars">
|
||||
<img src="{{ asset('vendor/webkul/shop/assets/images/5star.svg') }}" />
|
||||
</div>
|
||||
<div class="message">
|
||||
NFC provides 100% independence, device compatibility and freedom of movement Ear-cup-mounted sensors for easy-access, touch-sensitive control 30mm drivers
|
||||
</div>
|
||||
<div class="reviewer-details">
|
||||
<span class="by">
|
||||
By John Doe
|
||||
</span>
|
||||
<span class="when">
|
||||
, 25, June 2018
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="review">
|
||||
<div class="title">
|
||||
Awesome
|
||||
</div>
|
||||
<div class="stars">
|
||||
<img src="{{ asset('vendor/webkul/shop/assets/images/5star.svg') }}" />
|
||||
</div>
|
||||
<div class="message">
|
||||
NFC provides 100% independence, device compatibility and freedom of movement Ear-cup-mounted sensors for easy-access, touch-sensitive control 30mm drivers
|
||||
</div>
|
||||
<div class="reviewer-details">
|
||||
<span class="by">
|
||||
By John Doe
|
||||
</span>
|
||||
<span class="when">
|
||||
, 25, June 2018
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="review">
|
||||
<div class="title">
|
||||
Awesome
|
||||
</div>
|
||||
<div class="stars">
|
||||
<img src="{{ asset('vendor/webkul/shop/assets/images/5star.svg') }}" />
|
||||
</div>
|
||||
<div class="message">
|
||||
NFC provides 100% independence, device compatibility and freedom of movement Ear-cup-mounted sensors for easy-access, touch-sensitive control 30mm drivers
|
||||
</div>
|
||||
<div class="reviewer-details">
|
||||
<span class="by">
|
||||
By John Doe
|
||||
</span>
|
||||
<span class="when">
|
||||
, 25, June 2018
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="view-all">View All</div>
|
||||
<hr/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="related-products-wrapper">
|
||||
|
||||
<div class="title">
|
||||
We found other products you might like!
|
||||
</div>
|
||||
|
||||
<div class="horizontal-rule"></div>
|
||||
|
||||
<div class="related-products">
|
||||
|
||||
<div class="product-card">
|
||||
<div class="product-image">
|
||||
<img src="vendor/webkul/shop/assets/images/grid.png" />
|
||||
</div>
|
||||
<div class="product-name">
|
||||
<span>Red Black Tees</span>
|
||||
</div>
|
||||
<div class="product-price">
|
||||
<span>$65.00</span>
|
||||
</div>
|
||||
<div class="product-ratings">
|
||||
<span>
|
||||
<img src="vendor/webkul/shop/assets/images/5star.svg" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="cart-fav-seg">
|
||||
<button class="btn btn-md btn-primary addtocart">Add to Cart</button>
|
||||
<span><img src="vendor/webkul/shop/assets/images/wishadd.svg" /></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="product-card">
|
||||
<div class="product-image">
|
||||
<img src="vendor/webkul/shop/assets/images/grid.png" />
|
||||
</div>
|
||||
<div class="product-name">
|
||||
<span>Red Black Tees</span>
|
||||
</div>
|
||||
<div class="product-price">
|
||||
<span>$65.00</span>
|
||||
</div>
|
||||
<div class="product-ratings">
|
||||
<span>
|
||||
<img src="vendor/webkul/shop/assets/images/5star.svg" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="cart-fav-seg">
|
||||
<button class="btn btn-md btn-primary addtocart">Add to Cart</button>
|
||||
<span><img src="vendor/webkul/shop/assets/images/wishadd.svg" /></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="product-card">
|
||||
<div class="product-image">
|
||||
<img src="vendor/webkul/shop/assets/images/grid.png" />
|
||||
</div>
|
||||
<div class="product-name">
|
||||
<span>Red Black Tees</span>
|
||||
</div>
|
||||
<div class="product-price">
|
||||
<span>$65.00</span>
|
||||
</div>
|
||||
<div class="product-ratings">
|
||||
<span>
|
||||
<img src="vendor/webkul/shop/assets/images/5star.svg" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="cart-fav-seg">
|
||||
<button class="btn btn-md btn-primary addtocart">Add to Cart</button>
|
||||
<span><img src="vendor/webkul/shop/assets/images/wishadd.svg" /></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="product-card">
|
||||
<div class="product-image">
|
||||
<img src="vendor/webkul/shop/assets/images/grid.png" />
|
||||
</div>
|
||||
<div class="product-name">
|
||||
<span>Red Black Tees</span>
|
||||
</div>
|
||||
<div class="product-price">
|
||||
<span>$65.00</span>
|
||||
</div>
|
||||
<div class="product-ratings">
|
||||
<span>
|
||||
<img src="vendor/webkul/shop/assets/images/5star.svg" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="cart-fav-seg">
|
||||
<button class="btn btn-md btn-primary addtocart">Add to Cart</button>
|
||||
<span><img src="vendor/webkul/shop/assets/images/wishadd.svg" /></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</section>
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,162 @@
|
|||
@extends('shop::layouts.master')
|
||||
@section('content-wrapper')
|
||||
<section class="product-review">
|
||||
<div class="category-breadcrumbs">
|
||||
|
||||
<span class="breadcrumb">Home</span> > <span class="breadcrumb">Men</span> > <span class="breadcrumb">Slit Open Jeans</span>
|
||||
|
||||
</div>
|
||||
<div class="layouter">
|
||||
|
||||
<div class="mixed-group">
|
||||
|
||||
<div class="single-image">
|
||||
<img src="{{ asset('vendor/webkul/shop/assets/images/jeans_big.jpg') }}" />
|
||||
</div>
|
||||
|
||||
<div class="details">
|
||||
|
||||
<div class="product-name">
|
||||
Slit Open Jeans
|
||||
</div>
|
||||
|
||||
<div class="price">
|
||||
<span class="main-price">
|
||||
$24.00
|
||||
</span>
|
||||
<span class="real-price">
|
||||
$25.00
|
||||
</span>
|
||||
<span class="discount">
|
||||
10% Off
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="rating-reviews">
|
||||
|
||||
<div class="title-inline">
|
||||
<span>Ratings & Reviews</span>
|
||||
<button class="btn btn-md btn-primary">Write Review</button>
|
||||
</div>
|
||||
|
||||
<div class="overall">
|
||||
<div class="left-side">
|
||||
<span class="number">
|
||||
4.3
|
||||
</span>
|
||||
<span class="stars">
|
||||
<img src="{{ asset('vendor/webkul/shop/assets/images/5star.svg') }}" />
|
||||
</span>
|
||||
|
||||
<div class="total-reviews">
|
||||
24,330 Ratings & 104 Reviews
|
||||
</div>
|
||||
</div>
|
||||
<div class="right-side">
|
||||
|
||||
<div class="rater 5star">
|
||||
<div class="star">5 Star</div>
|
||||
<div class="line-bar">
|
||||
<div class="line-value"></div>
|
||||
</div>
|
||||
<div class="percentage">20%</div>
|
||||
</div> <br/>
|
||||
<div class="rater 4star">
|
||||
<div class="star">4 Star</div>
|
||||
<div class="line-bar">
|
||||
<div class="line-value"></div>
|
||||
</div>
|
||||
<div class="percentage">20%</div>
|
||||
</div> <br/>
|
||||
<div class="rater 3star">
|
||||
<div class="star">3 Star</div>
|
||||
<div class="line-bar">
|
||||
<div class="line-value"></div>
|
||||
</div>
|
||||
<div class="percentage">20%</div>
|
||||
</div> <br/>
|
||||
<div class="rater 2star">
|
||||
<div class="star">2 Star</div>
|
||||
<div class="line-bar">
|
||||
<div class="line-value"></div>
|
||||
</div>
|
||||
<div class="percentage">20%</div>
|
||||
</div> <br/>
|
||||
<div class="rater 1star">
|
||||
<div class="star">1 Star</div>
|
||||
<div class="line-bar">
|
||||
<div class="line-value"></div>
|
||||
</div>
|
||||
<div class="percentage">20%</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="reviews">
|
||||
<div class="review">
|
||||
<div class="title">
|
||||
Awesome
|
||||
</div>
|
||||
<div class="stars">
|
||||
<img src="{{ asset('vendor/webkul/shop/assets/images/5star.svg') }}" />
|
||||
</div>
|
||||
<div class="message">
|
||||
NFC provides 100% independence, device compatibility and freedom of movement Ear-cup-mounted sensors for easy-access, touch-sensitive control 30mm drivers
|
||||
</div>
|
||||
<div class="reviewer-details">
|
||||
<span class="by">
|
||||
By John Doe
|
||||
</span>
|
||||
<span class="when">
|
||||
, 25, June 2018
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="review">
|
||||
<div class="title">
|
||||
Awesome
|
||||
</div>
|
||||
<div class="stars">
|
||||
<img src="{{ asset('vendor/webkul/shop/assets/images/5star.svg') }}" />
|
||||
</div>
|
||||
<div class="message">
|
||||
NFC provides 100% independence, device compatibility and freedom of movement Ear-cup-mounted sensors for easy-access, touch-sensitive control 30mm drivers
|
||||
</div>
|
||||
<div class="reviewer-details">
|
||||
<span class="by">
|
||||
By John Doe
|
||||
</span>
|
||||
<span class="when">
|
||||
, 25, June 2018
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="review">
|
||||
<div class="title">
|
||||
Awesome
|
||||
</div>
|
||||
<div class="stars">
|
||||
<img src="{{ asset('vendor/webkul/shop/assets/images/5star.svg') }}" />
|
||||
</div>
|
||||
<div class="message">
|
||||
NFC provides 100% independence, device compatibility and freedom of movement Ear-cup-mounted sensors for easy-access, touch-sensitive control 30mm drivers
|
||||
</div>
|
||||
<div class="reviewer-details">
|
||||
<span class="by">
|
||||
By John Doe
|
||||
</span>
|
||||
<span class="when">
|
||||
, 25, June 2018
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="view-all">Load More</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,247 @@
|
|||
@extends('shop::layouts.master')
|
||||
@section('content-wrapper')
|
||||
<section class="cart">
|
||||
<div class="title">
|
||||
Shopping Cart
|
||||
</div>
|
||||
|
||||
<div class="cart-content">
|
||||
|
||||
<div class="left-side">
|
||||
|
||||
<div class="item">
|
||||
<img class="item-image" src="{{ asset('vendor/webkul/shop/assets/images/jeans_big.jpg') }}" />
|
||||
|
||||
<div class="item-details">
|
||||
|
||||
<div class="item-title">
|
||||
Rainbow Creation Embroided
|
||||
</div>
|
||||
|
||||
<div class="price">
|
||||
<span class="main-price">
|
||||
$24.00
|
||||
</span>
|
||||
<span class="real-price">
|
||||
$25.00
|
||||
</span>
|
||||
<span class="discount">
|
||||
10% Off
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="summary">
|
||||
Color : Gray, Size : S, Sleeve type : Puffed Sleeves, Occasion : Birthday, Marriage Anniversary
|
||||
</div>
|
||||
|
||||
<div class="misc">
|
||||
<div class="qty-text">Quantity</div>
|
||||
<div class="box">1</div>
|
||||
<span class="remove">Remove</span>
|
||||
<span class="towishlist">Move to Wishlist</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="item">
|
||||
<img class="item-image" src="{{ asset('vendor/webkul/shop/assets/images/jeans_big.jpg') }}" />
|
||||
|
||||
<div class="item-details">
|
||||
|
||||
<div class="item-title">
|
||||
Rainbow Creation Embroided
|
||||
</div>
|
||||
|
||||
<div class="price">
|
||||
<span class="main-price">
|
||||
$24.00
|
||||
</span>
|
||||
<span class="real-price">
|
||||
$25.00
|
||||
</span>
|
||||
<span class="discount">
|
||||
10% Off
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="summary">
|
||||
Color : Gray, Size : S, Sleeve type : Puffed Sleeves, Occasion : Birthday, Marriage Anniversary
|
||||
</div>
|
||||
|
||||
<div class="misc">
|
||||
<div class="qty-text">Quantity</div>
|
||||
<div class="box">1</div>
|
||||
<span class="remove">Remove</span>
|
||||
<span class="towishlist">Move to Wishlist</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="misc-controls">
|
||||
<span>Continue Shopping</span>
|
||||
<button class="btn btn-lg btn-primary">PROCEED TO CHECKOUT</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="right-side">
|
||||
<div class="price-section">
|
||||
<div class="title">
|
||||
Price Detail
|
||||
</div>
|
||||
<div class="all-item-details">
|
||||
|
||||
<div class="item-details">
|
||||
<span class="name">Item 1</span>
|
||||
<span class="price">$25.00</span>
|
||||
</div>
|
||||
|
||||
<div class="item-details">
|
||||
<span class="name">Item 2</span>
|
||||
<span class="price">$25.00</span>
|
||||
</div>
|
||||
|
||||
<div class="item-details">
|
||||
<span class="name">Item 3</span>
|
||||
<span class="price">$25.00</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="horizontal-rule"></div>
|
||||
|
||||
<div class="total-details">
|
||||
<span class="name">Amount Payable</span>
|
||||
<span class="amount">$75.00</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="coupon-section">
|
||||
|
||||
<span class="title">Apply Coupon</span>
|
||||
|
||||
<div class="control-group">
|
||||
<input type="text" class="control coupon-input" placeholder="Coupon Code" />
|
||||
</div>
|
||||
|
||||
<button class="btn btn-md btn-primary">Apply</button>
|
||||
|
||||
<div class="coupon-details">
|
||||
<div class="title">Coupon Used</div>
|
||||
<div class="coupon">
|
||||
<span class="name">Coupon 1</span>
|
||||
<span class="discount">$15</span>
|
||||
</div>
|
||||
<div class="coupon">
|
||||
<span class="name">Coupon 2</span>
|
||||
<span class="discount">$5</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="horizontal-rule"></div>
|
||||
|
||||
<div class="after-coupon-amount">
|
||||
<span class="name">Amount Payable</span>
|
||||
<span class="amount">$75.00</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="related-products-wrapper">
|
||||
|
||||
<div class="title">
|
||||
We found other products you might like!
|
||||
</div>
|
||||
|
||||
<div class="horizontal-rule"></div>
|
||||
|
||||
<div class="related-products">
|
||||
|
||||
<div class="product-card">
|
||||
<div class="product-image">
|
||||
<img src="vendor/webkul/shop/assets/images/grid.png" />
|
||||
</div>
|
||||
<div class="product-name">
|
||||
<span>Red Black Tees</span>
|
||||
</div>
|
||||
<div class="product-price">
|
||||
<span>$65.00</span>
|
||||
</div>
|
||||
<div class="product-ratings">
|
||||
<span>
|
||||
<img src="vendor/webkul/shop/assets/images/5star.svg" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="cart-fav-seg">
|
||||
<button class="btn btn-md btn-primary addtocart">Add to Cart</button>
|
||||
<span><img src="vendor/webkul/shop/assets/images/wishadd.svg" /></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="product-card">
|
||||
<div class="product-image">
|
||||
<img src="vendor/webkul/shop/assets/images/grid.png" />
|
||||
</div>
|
||||
<div class="product-name">
|
||||
<span>Red Black Tees</span>
|
||||
</div>
|
||||
<div class="product-price">
|
||||
<span>$65.00</span>
|
||||
</div>
|
||||
<div class="product-ratings">
|
||||
<span>
|
||||
<img src="vendor/webkul/shop/assets/images/5star.svg" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="cart-fav-seg">
|
||||
<button class="btn btn-md btn-primary addtocart">Add to Cart</button>
|
||||
<span><img src="vendor/webkul/shop/assets/images/wishadd.svg" /></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="product-card">
|
||||
<div class="product-image">
|
||||
<img src="vendor/webkul/shop/assets/images/grid.png" />
|
||||
</div>
|
||||
<div class="product-name">
|
||||
<span>Red Black Tees</span>
|
||||
</div>
|
||||
<div class="product-price">
|
||||
<span>$65.00</span>
|
||||
</div>
|
||||
<div class="product-ratings">
|
||||
<span>
|
||||
<img src="vendor/webkul/shop/assets/images/5star.svg" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="cart-fav-seg">
|
||||
<button class="btn btn-md btn-primary addtocart">Add to Cart</button>
|
||||
<span><img src="vendor/webkul/shop/assets/images/wishadd.svg" /></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="product-card">
|
||||
<div class="product-image">
|
||||
<img src="vendor/webkul/shop/assets/images/grid.png" />
|
||||
</div>
|
||||
<div class="product-name">
|
||||
<span>Red Black Tees</span>
|
||||
</div>
|
||||
<div class="product-price">
|
||||
<span>$65.00</span>
|
||||
</div>
|
||||
<div class="product-ratings">
|
||||
<span>
|
||||
<img src="vendor/webkul/shop/assets/images/5star.svg" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="cart-fav-seg">
|
||||
<button class="btn btn-md btn-primary addtocart">Add to Cart</button>
|
||||
<span><img src="vendor/webkul/shop/assets/images/wishadd.svg" /></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -1,2 +1,3 @@
|
|||
/node_modules
|
||||
/package-lock.json
|
||||
/package-lock.json
|
||||
npm-debug.log
|
||||
|
|
@ -11,27 +11,46 @@ use Webkul\Ui\DataGrid\Helpers\Pagination;
|
|||
use Webkul\Ui\DataGrid\Helpers\Css;
|
||||
use URL;
|
||||
|
||||
/**
|
||||
* DataGrid controller
|
||||
*
|
||||
* @author Nikhil Malik <nikhil@webkul.com> @ysmnikhil
|
||||
* &
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
*
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
|
||||
class DataGrid
|
||||
{
|
||||
|
||||
/**
|
||||
* Name of DataGrid
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
|
||||
protected $name;
|
||||
|
||||
|
||||
/**
|
||||
* select from table(s)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
|
||||
protected $select;
|
||||
|
||||
|
||||
/**
|
||||
* Table
|
||||
* @var Boolean for aliasing
|
||||
*/
|
||||
|
||||
protected $aliased;
|
||||
|
||||
|
||||
/**
|
||||
* Pagination variable
|
||||
* @var String
|
||||
|
|
@ -39,6 +58,7 @@ class DataGrid
|
|||
|
||||
protected $perpage;
|
||||
|
||||
|
||||
/**
|
||||
* Table
|
||||
*
|
||||
|
|
@ -46,6 +66,8 @@ class DataGrid
|
|||
*/
|
||||
|
||||
protected $table;
|
||||
|
||||
|
||||
/**
|
||||
* Join
|
||||
*
|
||||
|
|
@ -60,62 +82,83 @@ class DataGrid
|
|||
* 'callback' => 'not supported yet'
|
||||
* ]
|
||||
*/
|
||||
protected $join;
|
||||
/**
|
||||
|
||||
protected $join;
|
||||
|
||||
|
||||
/**
|
||||
* Collection Object of Column $columns
|
||||
*
|
||||
* @var Collection
|
||||
*/
|
||||
protected $columns;
|
||||
|
||||
/**
|
||||
protected $columns;
|
||||
|
||||
|
||||
/**
|
||||
* array of columns
|
||||
* to be filtered
|
||||
* @var Array
|
||||
*/
|
||||
protected $filterable;
|
||||
|
||||
/**
|
||||
protected $filterable;
|
||||
|
||||
|
||||
/**
|
||||
* array of columns
|
||||
* to be searched
|
||||
*
|
||||
* @var Array
|
||||
*/
|
||||
protected $searchable;
|
||||
|
||||
/**
|
||||
protected $searchable;
|
||||
|
||||
|
||||
/**
|
||||
* mass operations
|
||||
*
|
||||
* @var Array
|
||||
*/
|
||||
protected $massoperations;
|
||||
|
||||
/**
|
||||
protected $massoperations;
|
||||
|
||||
|
||||
/**
|
||||
* Pagination $pagination
|
||||
*
|
||||
* @var Pagination
|
||||
*/
|
||||
protected $pagination;
|
||||
|
||||
|
||||
protected $pagination;
|
||||
|
||||
|
||||
/**
|
||||
* Css $css
|
||||
*
|
||||
* @var Css
|
||||
*/
|
||||
protected $css;
|
||||
|
||||
/**
|
||||
protected $css;
|
||||
|
||||
|
||||
/**
|
||||
* Actions $action
|
||||
* @var action
|
||||
*/
|
||||
|
||||
protected $actions;
|
||||
|
||||
|
||||
/**
|
||||
* URL parse $parsed
|
||||
* @var parse
|
||||
*/
|
||||
protected $parsed;
|
||||
/*
|
||||
|
||||
protected $parsed;
|
||||
|
||||
|
||||
/*
|
||||
public function __construct(
|
||||
$name = null ,
|
||||
$table = null ,
|
||||
|
|
@ -136,6 +179,7 @@ class DataGrid
|
|||
}
|
||||
*/
|
||||
|
||||
//Prepares the input parameters passed as the configuration for datagrid.
|
||||
public function make($args)
|
||||
{
|
||||
// list($name, $select, $table, $join, $columns) = array_values($args);
|
||||
|
|
@ -146,9 +190,7 @@ class DataGrid
|
|||
return $this->build($name, $select, $filterable, $searchable, $massoperations, $aliased, $perpage, $table, $join, $columns, $css, $operators,$actions);
|
||||
}
|
||||
|
||||
//starts buikding the queries on the basis of selects, joins and filter with
|
||||
//attributes for class names and styles.
|
||||
|
||||
//This assigns the private and public properties of the datagrid classes from make functions
|
||||
public function build(
|
||||
$name = null,
|
||||
$select = false,
|
||||
|
|
@ -647,6 +689,7 @@ class DataGrid
|
|||
$parsed = $this->parse();
|
||||
|
||||
if ($this->aliased==true) {
|
||||
|
||||
//flags
|
||||
$table_alias = false;
|
||||
$join_table_alias = false;
|
||||
|
|
@ -672,6 +715,7 @@ class DataGrid
|
|||
$table_name = trim($exploded[0]);
|
||||
$table_alias = trim($exploded[1]);
|
||||
}
|
||||
|
||||
//Run this if there are any selects priorly.
|
||||
if (!empty($this->select)) {
|
||||
$this->getSelect();
|
||||
|
|
@ -679,8 +723,11 @@ class DataGrid
|
|||
|
||||
//Run this if there are joins
|
||||
if (!empty($this->join)) {
|
||||
foreach ($this->join as $join) {
|
||||
|
||||
foreach ($this->join as $index => $join) {
|
||||
|
||||
$name = strtolower($join['join']);
|
||||
|
||||
//Allow joins i.e left or right
|
||||
if ($name=='leftjoin' || $name=='rightjoin') {
|
||||
|
||||
|
|
@ -688,24 +735,32 @@ class DataGrid
|
|||
$primary_key_alias = trim(explode('.', $join['primaryKey'])[0]);
|
||||
|
||||
if ($primary_key_alias == $table_alias) {
|
||||
|
||||
$join_table_alias = explode('as', $join['table']);
|
||||
|
||||
if (isset($join_table_alias)) {
|
||||
|
||||
$alias1 = trim($join_table_alias[1]); //important!!!!!
|
||||
|
||||
//check if the secondary table match column is not having '.' and has proper alias
|
||||
$secondary_join_column = $join['secondaryKey'];
|
||||
if (isset($secondary_join_column)) {
|
||||
|
||||
$exploded_secondary = explode('.', $secondary_join_column);
|
||||
$alias2 = trim($exploded_secondary[0]);
|
||||
|
||||
if ($alias1 == $alias2) {
|
||||
$this->getQueryWithJoin();
|
||||
if($index==count($this->join)-1)
|
||||
$this->getQueryWithJoin();
|
||||
$alias_proper_secondary = true;
|
||||
} else {
|
||||
throw new \Exception('Aliases of Join table and the secondary key columns do not match');
|
||||
|
||||
}
|
||||
} else {
|
||||
throw new \Exception('Improper aliasing on secondary/join column for join');
|
||||
}
|
||||
|
||||
} else {
|
||||
throw new \Exception('Join/Secondary table alias is not found for join');
|
||||
}
|
||||
|
|
@ -729,6 +784,7 @@ class DataGrid
|
|||
$this->results = $this->query->get();
|
||||
|
||||
$this->results = $this->query->paginate($this->perpage)->appends(request()->except('page'));
|
||||
|
||||
return $this->results;
|
||||
|
||||
} else {
|
||||
|
|
@ -752,12 +808,17 @@ class DataGrid
|
|||
}
|
||||
|
||||
/**
|
||||
* Main Render Function,
|
||||
* it renders views responsible
|
||||
* for loading datagrid.
|
||||
*
|
||||
* @return view
|
||||
*/
|
||||
|
||||
public function render()
|
||||
{
|
||||
$this->getDbQueryResults();
|
||||
|
||||
return view('ui::datagrid.index', [
|
||||
'css' => $this->css,
|
||||
'results' => $this->results,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Ui\DataGrid\Facades;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
|
||||
class ProductGrid extends Facade
|
||||
{
|
||||
/**
|
||||
* Get the registered name of the component.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeAccessor()
|
||||
{
|
||||
return 'productgrid';
|
||||
}
|
||||
}
|
||||
|
|
@ -2,8 +2,14 @@
|
|||
|
||||
namespace Webkul\Ui\DataGrid\Helpers;
|
||||
|
||||
/**
|
||||
* AbstractFillable
|
||||
* @author Nikhil Malik <nikhil@webkul.com> @ysmnikhil
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
abstract class AbstractFillable
|
||||
{
|
||||
{
|
||||
const NO_RESULT = null;
|
||||
|
||||
protected $fillable = [];
|
||||
|
|
@ -43,7 +49,7 @@ abstract class AbstractFillable
|
|||
private function fieldValidate($key, $value, $allowed = ['string', 'integer', 'float', "boolean"], $merge = false)
|
||||
{
|
||||
$error = false;
|
||||
if( in_array($key, $this->fillable) ||
|
||||
if( in_array($key, $this->fillable) ||
|
||||
array_filter(
|
||||
array_keys($this->fillable) , function($value){
|
||||
return gettype($value) === "string";
|
||||
|
|
@ -54,7 +60,7 @@ abstract class AbstractFillable
|
|||
// if($merge){
|
||||
// if(!$this->{$key}) $this->{$key} = [];
|
||||
// $this->{$key}[] = $value;
|
||||
// }else
|
||||
// }else
|
||||
// $this->{$key} = $value;
|
||||
}else{
|
||||
dump(gettype($value));
|
||||
|
|
|
|||
|
|
@ -3,6 +3,16 @@ namespace Webkul\Ui\DataGrid\Helpers;
|
|||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/**
|
||||
* Column controller
|
||||
*
|
||||
* @author Nikhil Malik <nikhil@webkul.com> @ysmnikhil
|
||||
* &
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
*
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
class Column extends AbstractFillable
|
||||
{
|
||||
const SORT = 'sort';
|
||||
|
|
|
|||
|
|
@ -2,8 +2,14 @@
|
|||
|
||||
namespace Webkul\Ui\DataGrid\Helpers;
|
||||
|
||||
/**
|
||||
* Css
|
||||
* @author Nikhil Malik <nikhil@webkul.com> @ysmnikhil
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
class Css extends AbstractFillable
|
||||
{
|
||||
{
|
||||
const NO_RESULT = 'no-class';
|
||||
|
||||
protected $datagrid = 'datagrid';
|
||||
|
|
@ -13,6 +19,10 @@ class Css extends AbstractFillable
|
|||
protected $tbody = 'tbody';
|
||||
protected $tbody_td = 'tbody_td';
|
||||
|
||||
public function __construct($args){
|
||||
parent::__construct($args);
|
||||
}
|
||||
|
||||
protected function setFillable(){
|
||||
$this->fillable = [
|
||||
'datagrid',
|
||||
|
|
@ -23,8 +33,4 @@ class Css extends AbstractFillable
|
|||
'tbody_td',
|
||||
];
|
||||
}
|
||||
|
||||
public function __construct($args){
|
||||
parent::__construct($args);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,12 @@ namespace Webkul\Ui\DataGrid\Helpers;
|
|||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/**
|
||||
* MassAction
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
class MassAction
|
||||
{
|
||||
public function validateSchemaMassAction($attributes)
|
||||
|
|
|
|||
|
|
@ -5,8 +5,18 @@ namespace Webkul\Ui\DataGrid\Helpers;
|
|||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Pagination\Paginator;
|
||||
|
||||
/**
|
||||
* DataGrid controller
|
||||
*
|
||||
* @author Nikhil Malik <nikhil@webkul.com> @ysmnikhil
|
||||
* &
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
*
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
class Pagination extends Paginator
|
||||
{
|
||||
{
|
||||
const LIMIT = 20;
|
||||
const OFFSET = 0;
|
||||
const VIEW = '';
|
||||
|
|
|
|||
|
|
@ -9,30 +9,51 @@ use Illuminate\Support\Facades\DB;
|
|||
use Webkul\Ui\DataGrid\Helpers\Column;
|
||||
use Webkul\Ui\DataGrid\Helpers\Pagination;
|
||||
use Webkul\Ui\DataGrid\Helpers\Css;
|
||||
use Webkul\Ui\DataGrid\Helpers\MassAction;
|
||||
use Webkul\Attribute\Repositories\AttributeRepository;
|
||||
use Webkul\Product\Repositories\ProductAttributeValueRepository;
|
||||
use Webkul\Product\Models\ProductAttributeValue;
|
||||
use URL;
|
||||
|
||||
/**
|
||||
* DataGrid controller
|
||||
*
|
||||
* @author Nikhil Malik <nikhil@webkul.com> @ysmnikhil
|
||||
* &
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
*
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
|
||||
class ProductGrid
|
||||
{
|
||||
|
||||
/**
|
||||
* Name of DataGrid
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
|
||||
protected $name;
|
||||
|
||||
|
||||
/**
|
||||
* select from table(s)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
|
||||
protected $select;
|
||||
|
||||
|
||||
/**
|
||||
* Table
|
||||
* @var Boolean for aliasing
|
||||
*/
|
||||
|
||||
protected $aliased;
|
||||
|
||||
|
||||
/**
|
||||
* Pagination variable
|
||||
* @var String
|
||||
|
|
@ -40,6 +61,7 @@ class ProductGrid
|
|||
|
||||
protected $perpage;
|
||||
|
||||
|
||||
/**
|
||||
* Table
|
||||
*
|
||||
|
|
@ -47,6 +69,8 @@ class ProductGrid
|
|||
*/
|
||||
|
||||
protected $table;
|
||||
|
||||
|
||||
/**
|
||||
* Join
|
||||
*
|
||||
|
|
@ -61,94 +85,124 @@ class ProductGrid
|
|||
* 'callback' => 'not supported yet'
|
||||
* ]
|
||||
*/
|
||||
protected $join;
|
||||
/**
|
||||
|
||||
protected $join;
|
||||
|
||||
|
||||
/**
|
||||
* Collection Object of Column $columns
|
||||
*
|
||||
* @var Collection
|
||||
*/
|
||||
protected $columns;
|
||||
|
||||
/**
|
||||
protected $columns;
|
||||
|
||||
|
||||
/**
|
||||
* array of columns
|
||||
* to be filtered
|
||||
* @var Array
|
||||
*/
|
||||
protected $filterable;
|
||||
|
||||
/**
|
||||
protected $filterable;
|
||||
|
||||
|
||||
/**
|
||||
* array of columns
|
||||
* to be searched
|
||||
*
|
||||
* @var Array
|
||||
*/
|
||||
protected $searchable;
|
||||
|
||||
/**
|
||||
protected $searchable;
|
||||
|
||||
|
||||
/**
|
||||
* mass operations
|
||||
*
|
||||
* @var Array
|
||||
*/
|
||||
protected $massoperations;
|
||||
|
||||
/**
|
||||
protected $massoperations;
|
||||
|
||||
|
||||
/**
|
||||
* Pagination $pagination
|
||||
*
|
||||
* @var Pagination
|
||||
*/
|
||||
protected $pagination;
|
||||
|
||||
|
||||
protected $pagination;
|
||||
|
||||
|
||||
/**
|
||||
* Css $css
|
||||
*
|
||||
* @var Css
|
||||
*/
|
||||
protected $css;
|
||||
|
||||
protected $css;
|
||||
|
||||
|
||||
/**
|
||||
* Actions $action
|
||||
* @var action
|
||||
*/
|
||||
|
||||
protected $actions;
|
||||
|
||||
/**
|
||||
* Attribute Columns
|
||||
* for columns which
|
||||
* are attributes.
|
||||
*
|
||||
* @var $attributeColumns
|
||||
*/
|
||||
|
||||
protected $attributeColumns;
|
||||
|
||||
/**
|
||||
* URL parse $parsed
|
||||
* @var parse
|
||||
*/
|
||||
protected $parsed;
|
||||
/*
|
||||
public function __construct(
|
||||
$name = null ,
|
||||
$table = null ,
|
||||
array $join = [],
|
||||
Collection $columns = null,
|
||||
Pagination $pagination = null
|
||||
){
|
||||
$this->make(
|
||||
$name,
|
||||
$table,
|
||||
$join,
|
||||
$columns,
|
||||
$pagination
|
||||
);
|
||||
return $this;
|
||||
|
||||
Separates the bags in the array of make attributes
|
||||
}
|
||||
*/
|
||||
protected $parsed;
|
||||
|
||||
//Prepares the input parameters passed as the configuration for datagrid.
|
||||
public function make($args)
|
||||
{
|
||||
// list($name, $select, $table, $join, $columns) = array_values($args);
|
||||
$name = $select = $aliased = $table = false;
|
||||
$join = $columns = $filterable = $searchable =
|
||||
$massoperations = $css = $operators = [];
|
||||
$massoperations = $attributeColumns = $css = $operators = $actions = [];
|
||||
extract($args);
|
||||
return $this->build($name, $select, $filterable, $searchable, $massoperations, $aliased, $perpage, $table, $join, $columns, $css, $operators);
|
||||
return $this->build($name, $select, $filterable, $searchable, $massoperations, $attributeColumns , $aliased, $perpage, $table, $join, $columns, $css, $operators,$actions);
|
||||
}
|
||||
|
||||
//starts buikding the queries on the basis of selects, joins and filter with
|
||||
//attributes for class names and styles.
|
||||
//contructor for getting the current locale and channel
|
||||
|
||||
private $locale;
|
||||
private $channel;
|
||||
private $attributes;
|
||||
private $allAttributes;
|
||||
|
||||
public function __construct(AttributeRepository $attributes) {
|
||||
|
||||
$this->channel = request()->get('channel') ?: channel()->getChannel();
|
||||
$this->locale = request()->get('locale') ?: app()->getLocale();
|
||||
$this->attributes = $attributes;
|
||||
|
||||
}
|
||||
|
||||
//This assigns the private and public properties of the datagrid classes from make functions
|
||||
public function build(
|
||||
$name = null,
|
||||
$select = false,
|
||||
array $filterable = [],
|
||||
array $searchable = [],
|
||||
array $massoperations = [],
|
||||
array $attributeColumns = [],
|
||||
bool $aliased = false,
|
||||
$perpage = 0,
|
||||
$table = null,
|
||||
|
|
@ -156,6 +210,7 @@ class ProductGrid
|
|||
array $columns = null,
|
||||
array $css = [],
|
||||
array $operators = [],
|
||||
array $actions = [],
|
||||
Pagination $pagination = null
|
||||
) {
|
||||
$this->request = Request::capture();
|
||||
|
|
@ -164,6 +219,7 @@ class ProductGrid
|
|||
$this->setFilterable($filterable);
|
||||
$this->setSearchable($filterable);
|
||||
$this->setMassOperations($massoperations);
|
||||
$this->setAttributeColumns($attributeColumns);
|
||||
$this->setAlias($aliased);
|
||||
$this->setPerPage($perpage);
|
||||
$this->setTable($table);
|
||||
|
|
@ -171,6 +227,7 @@ class ProductGrid
|
|||
$this->addColumns($columns, true);
|
||||
$this->setCss($css);
|
||||
$this->setOperators($operators);
|
||||
$this->setActions($actions);
|
||||
// $this->addPagination($pagination);
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -297,6 +354,18 @@ class ProductGrid
|
|||
return $this->css;
|
||||
}
|
||||
|
||||
/**
|
||||
* To set the attributes
|
||||
* bag on product datagrid.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
|
||||
private function setAttributeColumns($attributes = []) {
|
||||
$this->attributeColumns = $attributes;
|
||||
return $this->attributeColumns;
|
||||
}
|
||||
|
||||
/**
|
||||
* setFilterableColumns
|
||||
* @return $this
|
||||
|
|
@ -308,6 +377,17 @@ class ProductGrid
|
|||
// return $this;
|
||||
// }
|
||||
|
||||
/**
|
||||
* Section actions bag
|
||||
* here.
|
||||
* @return $this
|
||||
*/
|
||||
|
||||
public function setActions($actions = []) {
|
||||
$this->actions = $actions ?: [];
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add Columns.
|
||||
*
|
||||
|
|
@ -421,18 +501,55 @@ class ProductGrid
|
|||
{
|
||||
$select = [];
|
||||
foreach ($this->columns as $column) {
|
||||
$select[] = $column->name;
|
||||
$select[] = $column->name.' as '.$column->alias;
|
||||
}
|
||||
|
||||
$this->query->select(...$select);
|
||||
|
||||
if ($this->select) {
|
||||
$this->query->addselect($this->select);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will
|
||||
* map and resolve the
|
||||
* product attributes
|
||||
* and thier values
|
||||
* per channel and per
|
||||
* locale.
|
||||
*
|
||||
* @return Array
|
||||
*/
|
||||
|
||||
private function resolveOrMapAttributes () {
|
||||
return $this->query->get();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* To find the alias
|
||||
* of the column and
|
||||
* by taking the column
|
||||
* name.
|
||||
* @return string
|
||||
*/
|
||||
|
||||
public function findAlias($column_alias) {
|
||||
foreach($this->columns as $column) {
|
||||
if($column->alias == $column_alias) {
|
||||
return $column->name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the URL
|
||||
* and get it ready
|
||||
* to be used.
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
|
||||
private function parse()
|
||||
|
|
@ -449,6 +566,50 @@ class ProductGrid
|
|||
}
|
||||
}
|
||||
|
||||
public function getProducts() {
|
||||
$qb = DB::table('products')->addSelect('products.*');
|
||||
|
||||
$channel = core()->getCurrentChannelCode();
|
||||
$locale = app()->getLocale();
|
||||
|
||||
foreach (['name', 'description', 'short_description', 'price'] as $code) {
|
||||
$attribute = $this->attributes->findBy('code', $code);
|
||||
|
||||
$productValueAlias = 'pav_' . $attribute->code;
|
||||
|
||||
$qb->leftJoin('product_attribute_values as ' . $productValueAlias, function($leftJoin) use($channel, $locale, $attribute, $productValueAlias) {
|
||||
|
||||
$leftJoin->on('products.id', $productValueAlias . '.product_id');
|
||||
|
||||
if($attribute->value_per_channel) {
|
||||
if($attribute->value_per_locale) {
|
||||
$leftJoin->where($productValueAlias . '.channel', $channel)
|
||||
->where($productValueAlias . '.locale', $locale);
|
||||
} else {
|
||||
$leftJoin->where($productValueAlias . '.channel', $channel);
|
||||
}
|
||||
} else {
|
||||
if($attribute->value_per_locale) {
|
||||
$leftJoin->where($productValueAlias . '.locale', $locale);
|
||||
}
|
||||
}
|
||||
|
||||
$leftJoin->where($productValueAlias . '.attribute_id', $attribute->id);
|
||||
});
|
||||
|
||||
|
||||
$qb->addSelect($productValueAlias . '.' . ProductAttributeValue::$attributeTypeFields[$attribute->type] . ' as ' . $code);
|
||||
|
||||
|
||||
if($code == 'name') {
|
||||
$filterAlias = 'filter_' . $attribute->code;
|
||||
|
||||
$qb->leftJoin('product_attribute_values as ' . $filterAlias, 'products.id', '=', $filterAlias . '.product_id');
|
||||
$qb->where($filterAlias . '.' . ProductAttributeValue::$attributeTypeFields[$attribute->type], 'Product Name');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ->join('contacts', 'users.id', '=', 'contacts.user_id')
|
||||
* @return $this->query
|
||||
|
|
@ -456,11 +617,61 @@ class ProductGrid
|
|||
|
||||
private function getQueryWithJoin()
|
||||
{
|
||||
|
||||
foreach ($this->join as $join) {
|
||||
$this->query->{$join['join']}($join['table'], $join['primaryKey'], $join['condition'], $join['secondaryKey']);
|
||||
|
||||
if(array_key_exists('withAttributes',$join)) {
|
||||
|
||||
$qb = $this->query;
|
||||
|
||||
$channel = $this->channel;
|
||||
$locale = $this->locale;
|
||||
|
||||
foreach ($this->attributeColumns as $code) {
|
||||
$attribute = $this->attributes->findBy('code', $code);
|
||||
|
||||
$productValueAlias = 'pav_' . $attribute->code;
|
||||
|
||||
$qb->leftJoin('product_attribute_values as ' . $productValueAlias, function ($leftJoin) use ($channel, $locale, $attribute, $productValueAlias) {
|
||||
$leftJoin->on('prods.id', $productValueAlias . '.product_id');
|
||||
|
||||
if ($attribute->value_per_channel) {
|
||||
if ($attribute->value_per_locale) {
|
||||
$leftJoin->where($productValueAlias . '.channel', $channel)->where($productValueAlias . '.locale', $locale);
|
||||
} else {
|
||||
$leftJoin->where($productValueAlias . '.channel', $channel);
|
||||
}
|
||||
} else {
|
||||
if ($attribute->value_per_locale) {
|
||||
$leftJoin->where($productValueAlias . '.locale', $locale);
|
||||
}
|
||||
}
|
||||
|
||||
$leftJoin->where($productValueAlias . '.attribute_id', $attribute->id);
|
||||
});
|
||||
|
||||
$qb->addSelect($productValueAlias . '.' . ProductAttributeValue::$attributeTypeFields[$attribute->type] . ' as ' . $code);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
$this->query->{$join['join']}($join['table'], $join['primaryKey'], $join['condition'], $join['secondaryKey']);
|
||||
|
||||
}
|
||||
|
||||
$this->query->get();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this function
|
||||
* when taking filters
|
||||
* on columns while
|
||||
* fetching columns
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
||||
private function getQueryWithColumnFilters()
|
||||
{
|
||||
foreach ($this->columns as $column) {
|
||||
|
|
@ -505,7 +716,7 @@ class ProductGrid
|
|||
if ($key=="sort") {
|
||||
//resolve the case with the column helper class
|
||||
if(substr_count($key,'_') >= 1)
|
||||
$column_name = str_replace_first('_', '.', $key);
|
||||
$column_name = $this->findAlias($key);
|
||||
|
||||
//case that don't need any resolving
|
||||
$count_keys = count(array_keys($value));
|
||||
|
|
@ -527,8 +738,7 @@ class ProductGrid
|
|||
}
|
||||
});
|
||||
} else {
|
||||
$column_name = str_replace_first('_', '.', $key);
|
||||
|
||||
$column_name = $this->findAlias($key);
|
||||
if (array_keys($value)[0]=="like" || array_keys($value)[0]=="nlike") {
|
||||
foreach ($value as $condition => $filter_value) {
|
||||
$this->query->where(
|
||||
|
|
@ -579,9 +789,8 @@ class ProductGrid
|
|||
throw new \Exception('Multiple Search keys Found, Please Resolve the URL Manually.');
|
||||
|
||||
} else {
|
||||
|
||||
$column_name = $key;
|
||||
|
||||
// $column_name = $key;
|
||||
$column_name = $this->findAlias($key);
|
||||
if (array_keys($value)[0]=="like" || array_keys($value)[0]=="nlike") {
|
||||
foreach ($value as $condition => $filter_value) {
|
||||
$this->query->where(
|
||||
|
|
@ -610,6 +819,7 @@ class ProductGrid
|
|||
$parsed = $this->parse();
|
||||
|
||||
if ($this->aliased==true) {
|
||||
|
||||
//flags
|
||||
$table_alias = false;
|
||||
$join_table_alias = false;
|
||||
|
|
@ -622,7 +832,7 @@ class ProductGrid
|
|||
|
||||
//explode if alias is available
|
||||
if (strpos('.', $this->table)) {
|
||||
throw new \Exception("dot/s cannot be used in table names in mysql");
|
||||
throw new \Exception("Dot(s) cannot be used in table names in Database.");
|
||||
} else {
|
||||
$exploded = explode('as', $this->table);
|
||||
}
|
||||
|
|
@ -635,6 +845,7 @@ class ProductGrid
|
|||
$table_name = trim($exploded[0]);
|
||||
$table_alias = trim($exploded[1]);
|
||||
}
|
||||
|
||||
//Run this if there are any selects priorly.
|
||||
if (!empty($this->select)) {
|
||||
$this->getSelect();
|
||||
|
|
@ -642,8 +853,11 @@ class ProductGrid
|
|||
|
||||
//Run this if there are joins
|
||||
if (!empty($this->join)) {
|
||||
foreach ($this->join as $join) {
|
||||
|
||||
foreach ($this->join as $index => $join) {
|
||||
|
||||
$name = strtolower($join['join']);
|
||||
|
||||
//Allow joins i.e left or right
|
||||
if ($name=='leftjoin' || $name=='rightjoin') {
|
||||
|
||||
|
|
@ -651,46 +865,53 @@ class ProductGrid
|
|||
$primary_key_alias = trim(explode('.', $join['primaryKey'])[0]);
|
||||
|
||||
if ($primary_key_alias == $table_alias) {
|
||||
|
||||
$join_table_alias = explode('as', $join['table']);
|
||||
|
||||
if (isset($join_table_alias)) {
|
||||
|
||||
$alias1 = trim($join_table_alias[1]); //important!!!!!
|
||||
|
||||
//check if the secondary table match column is not having '.' and has proper alias
|
||||
$secondary_join_column = $join['secondaryKey'];
|
||||
if (isset($secondary_join_column)) {
|
||||
|
||||
$exploded_secondary = explode('.', $secondary_join_column);
|
||||
$alias2 = trim($exploded_secondary[0]);
|
||||
|
||||
if ($alias1 == $alias2) {
|
||||
$this->getQueryWithJoin();
|
||||
if($index==count($this->join)-1)
|
||||
$this->getQueryWithJoin();
|
||||
$alias_proper_secondary = true;
|
||||
} else {
|
||||
throw new \Exception('Aliases of Join table and the secondary key columns do not match');
|
||||
throw new \Exception('Aliases of Join table and the secondary key columns do not match.');
|
||||
|
||||
}
|
||||
} else {
|
||||
throw new \Exception('Improper aliasing on secondary/join column for join');
|
||||
throw new \Exception('Improper aliasing on secondary/join column for join.');
|
||||
}
|
||||
|
||||
} else {
|
||||
throw new \Exception('Join/Secondary table alias is not found for join');
|
||||
throw new \Exception('Join/Secondary table alias is not found for join.');
|
||||
}
|
||||
} else {
|
||||
throw new \Exception('Primary key and primary table aliases do not match for join');
|
||||
throw new \Exception('Primary key and primary table aliases do not match for join.');
|
||||
}
|
||||
} else {
|
||||
$other_joins = true;
|
||||
throw new \Exception('Please check if there is some fault in your aliasing and do not use as in column names or you might have been using a join that is not allowed i.e cross, inner, etc use left and right join only');
|
||||
throw new \Exception('Please check if there is some fault in your aliasing and do not use as in column names or you might have been using a join that is not allowed i.e cross, inner, etc use left and right join only.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Check for column filter bags and resolve aliasing
|
||||
$this->getQueryWithColumnFilters();
|
||||
|
||||
if (!empty($parsed)) {
|
||||
$this->getQueryWithFilters();
|
||||
}
|
||||
// $this->results = $this->query->get();
|
||||
// return $this->results;
|
||||
$this->results = $this->query->get();
|
||||
$this->results = $this->query->paginate($this->perpage)->appends(request()->except('page'));
|
||||
|
||||
$this->results = $this->query->paginate($this->perpage)->appends(request()->input());
|
||||
return $this->results;
|
||||
|
||||
} else {
|
||||
|
|
@ -698,30 +919,52 @@ class ProductGrid
|
|||
$this->query = DB::table($this->table);
|
||||
|
||||
$this->getSelect();
|
||||
|
||||
$this->getQueryWithColumnFilters();
|
||||
|
||||
if (!empty($parsed)) {
|
||||
$this->getQueryWithFilters();
|
||||
}
|
||||
$this->results = $this->query->get();
|
||||
$this->results = $this->query->paginate($this->perpage)->appends(request()->except('page'));
|
||||
|
||||
$this->results = $this->query->distinct()->paginate($this->perpage)->appends(request()->input());
|
||||
return $this->results;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Main Render Function,
|
||||
* it renders views responsible
|
||||
* for loading datagrid.
|
||||
*
|
||||
* @return view
|
||||
*/
|
||||
|
||||
public function render()
|
||||
{
|
||||
|
||||
$this->allAttributes = $this->getAttributes();
|
||||
$this->getDbQueryResults();
|
||||
// dd($this->results);
|
||||
return view('ui::datagrid.index', [
|
||||
'css' => $this->css,
|
||||
'results' => $this->results,
|
||||
'columns' => $this->columns,
|
||||
'attribute_columns' => $this->attributeColumns,
|
||||
'filterable' =>$this->filterable,
|
||||
'operators' => $this->operators,
|
||||
'massoperations' => $this->massoperations,
|
||||
'actions' => $this->actions,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Getting all attributes from the repository instance
|
||||
* type hinted in the contructor of product grid.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function getAttributes() {
|
||||
// dd($this->attributes->all());
|
||||
return $this->attributes->all();
|
||||
}
|
||||
}
|
||||
|
|
@ -34,5 +34,7 @@ class UiServiceProvider extends ServiceProvider
|
|||
public function register()
|
||||
{
|
||||
$this->app->bind('datagrid', 'Webkul\Ui\DataGrid\DataGrid');
|
||||
//specifically for mananging products
|
||||
$this->app->bind('productgrid', 'Webkul\Ui\DataGrid\ProductGrid');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,4 +4,8 @@ $danger-color: #FC6868;
|
|||
$success-color: #4CAF50;
|
||||
$warning-color: #FFC107;
|
||||
$control-border-color: #C7C7C7;
|
||||
$border-color: rgba(162, 162, 162, 0.2);
|
||||
$border-color: rgba(162, 162, 162, 0.2);
|
||||
$filter-toggle-color : #8e8e8e;
|
||||
$color-white: #ffffff;
|
||||
$color-black: #000000;
|
||||
$color-black-shade : #000311;
|
||||
|
|
@ -224,7 +224,7 @@ h2 {
|
|||
padding: 10px;
|
||||
border-bottom: solid 1px #d3d3d3;
|
||||
color: $font-color;
|
||||
vertical-align: top;
|
||||
vertical-align: middle;
|
||||
|
||||
&.actions {
|
||||
text-align: right;
|
||||
|
|
@ -682,22 +682,6 @@ h2 {
|
|||
.dropdown-filters {
|
||||
display: inline-flex;
|
||||
|
||||
// .column-filter {
|
||||
// margin-right: 5px;
|
||||
|
||||
// .control {
|
||||
// font-family: "montserrat", sans-serif;
|
||||
// padding-left: 5px;
|
||||
// height: 36px;
|
||||
// width: 150px;
|
||||
// border: 2px solid $control-border-color;
|
||||
// border-radius: 3px;
|
||||
// background-color: white;
|
||||
// color: #8e8e8e;
|
||||
// font-size: 14px;
|
||||
// }
|
||||
// }
|
||||
|
||||
.more-filters {
|
||||
margin-right: 5px;
|
||||
|
||||
|
|
@ -713,7 +697,7 @@ h2 {
|
|||
border: 2px solid $control-border-color;
|
||||
border-radius: 2px;
|
||||
background-color: white;
|
||||
color: #8e8e8e;
|
||||
color: $filter-toggle-color;
|
||||
font-size: 14px;
|
||||
|
||||
.dropdown-header {
|
||||
|
|
@ -734,8 +718,8 @@ h2 {
|
|||
li.filter-column-dropdown {
|
||||
.filter-column-select {
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
border: 2px solid #c7c7c7;
|
||||
background: $color-white;
|
||||
border: 2px solid $control-border-color;
|
||||
border-radius: 3px;
|
||||
height: 36px;
|
||||
display: inline-block;
|
||||
|
|
@ -752,8 +736,8 @@ h2 {
|
|||
}
|
||||
li {
|
||||
select {
|
||||
background: #fff;
|
||||
border: 2px solid #c7c7c7;
|
||||
background: $color-white;
|
||||
border: 2px solid $control-border-color;
|
||||
border-radius: 3px;
|
||||
height: 36px;
|
||||
max-width: 100%;
|
||||
|
|
@ -832,7 +816,7 @@ h2 {
|
|||
display: inline-flex;
|
||||
background: #e7e7e7;
|
||||
padding-left: 5px;
|
||||
color: #000311;
|
||||
color: $color-black-shade;
|
||||
vertical-align: middle;
|
||||
|
||||
.f-value {
|
||||
|
|
@ -881,8 +865,18 @@ h2 {
|
|||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
tbody {
|
||||
td.action {
|
||||
a:first-child {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pagination {
|
||||
margin-top:20px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,12 +10,11 @@
|
|||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
var columns = @json($columns); //referential
|
||||
var allFilters1 = [];
|
||||
var allFilters = [];
|
||||
var search_value;
|
||||
var filter_column;
|
||||
var filter_condition;
|
||||
var filter_range;
|
||||
var filt = '';
|
||||
var count_filters = parseInt(0);
|
||||
var url;
|
||||
var array_start = '[';
|
||||
|
|
@ -24,11 +23,11 @@
|
|||
var selectedColumn = '';
|
||||
var myURL = document.location;
|
||||
let params;
|
||||
$(document).ready(function(){
|
||||
$(document).ready(function() {
|
||||
|
||||
params = (new URL(document.location)).search;
|
||||
if(params.length>0){
|
||||
if(allFilters1.length == 0) {
|
||||
if(params.length>0) {
|
||||
if(allFilters.length == 0) {
|
||||
//call reverse url function
|
||||
arrayFromUrl(params.slice(1,params.length));
|
||||
}
|
||||
|
|
@ -40,8 +39,11 @@
|
|||
|
||||
//controls for header when sorting is done
|
||||
$('.grid_head').on('click', function() {
|
||||
|
||||
var column = $(this).data('column-name');
|
||||
|
||||
var currentSort = $(this).data('column-sort');
|
||||
|
||||
if(currentSort == "asc")
|
||||
formURL("sort",column,"desc",params);
|
||||
else if(currentSort == "desc")
|
||||
|
|
@ -88,7 +90,7 @@
|
|||
$('.filter-condition-dropdown-datetime').css('display','inherit');
|
||||
$('.filter-response-datetime').css('display','inherit');
|
||||
}
|
||||
else if(typeValue == 'number'){
|
||||
else if(typeValue == 'number') {
|
||||
//hide unwanted
|
||||
$('.filter-condition-dropdown-string').css('display','none');
|
||||
$('.filter-condition-dropdown-datetime').css('display','none');
|
||||
|
|
@ -102,35 +104,42 @@
|
|||
|
||||
}
|
||||
|
||||
$('.apply-filter').on('click',function(){
|
||||
$('.apply-filter').on('click',function() {
|
||||
|
||||
params = (new URL(document.location)).search;
|
||||
if(typeValue == 'number'){
|
||||
|
||||
if(typeValue == 'number') {
|
||||
|
||||
var conditionUsed = $('.filter-condition-dropdown-number').find(':selected').val();
|
||||
var response = $('.response-number').val();
|
||||
formURL(selectedColumn,conditionUsed,response,params,col_label);
|
||||
}
|
||||
if(typeValue == 'string'){
|
||||
if(typeValue == 'string') {
|
||||
|
||||
var conditionUsed = $('.filter-condition-dropdown-string').find(':selected').val();
|
||||
var response = $('.response-string').val();
|
||||
formURL(selectedColumn,conditionUsed,response,params,col_label);
|
||||
|
||||
}
|
||||
if(typeValue == 'datetime'){
|
||||
if(typeValue == 'datetime') {
|
||||
|
||||
var conditionUsed = $('.filter-condition-dropdown-datetime').find(':selected').val();
|
||||
var response = $('.response-datetime').val();
|
||||
formURL(selectedColumn,conditionUsed,response,params,col_label);
|
||||
}
|
||||
if(typeValue == 'boolean'){ //use select dropdown with two values true and false
|
||||
if(typeValue == 'boolean') { //use select dropdown with two values true and false
|
||||
|
||||
console.log('boolean');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//remove the filter and from clicking on cross icon on tag
|
||||
$('.remove-filter').on('click', function(){
|
||||
$('.remove-filter').on('click', function() {
|
||||
|
||||
var id = $(this).parents('.filter-one').attr('id');
|
||||
if(allFilters1.length == 1){
|
||||
allFilters1.pop();
|
||||
if(allFilters.length == 1) {
|
||||
allFilters.pop();
|
||||
var uri = window.location.href.toString();
|
||||
if (uri.indexOf("?") > 0) {
|
||||
var clean_uri = uri.substring(0, uri.indexOf("?"));
|
||||
|
|
@ -138,9 +147,9 @@
|
|||
document.location = clean_uri;
|
||||
}
|
||||
}
|
||||
else{
|
||||
allFilters1.splice(id,1);
|
||||
makeURL(allFilters1);
|
||||
else {
|
||||
allFilters.splice(id,1);
|
||||
makeURL();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -150,43 +159,57 @@
|
|||
|
||||
// master checkbox for selecting all entries
|
||||
$("input[id=mastercheckbox]").change(function() {
|
||||
if($("input[id=mastercheckbox]").prop('checked') == true){
|
||||
$('.indexers').each(function(){
|
||||
if($("input[id=mastercheckbox]").prop('checked') == true) {
|
||||
$('.indexers').each(function() {
|
||||
this.checked = true;
|
||||
if(this.checked){
|
||||
y = parseInt($(this).attr('id')); id.push(y);
|
||||
}
|
||||
});
|
||||
|
||||
$('.mass-action').css('display','');
|
||||
|
||||
$('.table-grid-header').css('display','none');
|
||||
// $('.selected-items').html(id.toString());
|
||||
|
||||
$('#indexes').val(id);
|
||||
}
|
||||
else if($("input[id=mastercheckbox]").prop('checked') == false) {
|
||||
|
||||
$('.indexers').each(function(){ this.checked = false; });
|
||||
|
||||
id = [];
|
||||
|
||||
$('.mass-action').css('display','none');
|
||||
|
||||
$('.table-grid-header').css('display','');
|
||||
|
||||
$('#indexes').val('');
|
||||
}
|
||||
});
|
||||
|
||||
$('.massaction-remove').on('click', function(){
|
||||
$('.massaction-remove').on('click', function() {
|
||||
|
||||
id = [];
|
||||
|
||||
$('.mass-action').css('display','none');
|
||||
|
||||
if($('#mastercheckbox').prop('checked')) {
|
||||
$('#mastercheckbox').prop('checked',false);
|
||||
}
|
||||
$("input[class=indexers]").each(function(){
|
||||
if($(this).prop('checked')){
|
||||
|
||||
$("input[class=indexers]").each(function() {
|
||||
if($(this).prop('checked')) {
|
||||
$(this).prop('checked',false);
|
||||
}
|
||||
});
|
||||
|
||||
$('.table-grid-header').css('display','');
|
||||
});
|
||||
|
||||
$("input[class=indexers]").change(function() {
|
||||
if(this.checked){
|
||||
|
||||
if(this.checked) {
|
||||
y = parseInt($(this).attr('id'));
|
||||
id.push(y);
|
||||
}
|
||||
|
|
@ -195,6 +218,7 @@
|
|||
var index = id.indexOf(y);
|
||||
id.splice(index,1);
|
||||
}
|
||||
|
||||
if(id.length>0) {
|
||||
|
||||
$('.mass-action').css('display','');
|
||||
|
|
@ -204,7 +228,9 @@
|
|||
}else if(id.length == 0) {
|
||||
|
||||
$('.mass-action').css('display','none');
|
||||
|
||||
$('.table-grid-header').css('display','');
|
||||
|
||||
$('#indexes').val('');
|
||||
|
||||
if($('#mastercheckbox').prop('checked')) {
|
||||
|
|
@ -218,69 +244,113 @@
|
|||
});
|
||||
|
||||
//make the url from the array and redirect
|
||||
function makeURL() {
|
||||
if(allFilters1.length>0)
|
||||
function makeURL(repetition = false) {
|
||||
|
||||
if(allFilters.length>0 && repetition == false)
|
||||
{
|
||||
for(i=0;i<allFilters1.length;i++) {
|
||||
|
||||
for(i=0;i<allFilters.length;i++) {
|
||||
if(i==0){
|
||||
url = '?' + allFilters1[i].column + '[' + allFilters1[i].cond + ']' + '=' + allFilters1[i].val;
|
||||
url = '?' + allFilters[i].column + '[' + allFilters[i].cond + ']' + '=' + allFilters[i].val;
|
||||
}
|
||||
else
|
||||
url = url + '&' + allFilters1[i].column + '[' + allFilters1[i].cond + ']' + '=' + allFilters1[i].val;
|
||||
url = url + '&' + allFilters[i].column + '[' + allFilters[i].cond + ']' + '=' + allFilters[i].val;
|
||||
}
|
||||
document.location = url;
|
||||
|
||||
} else if(allFilters.length>0 && repetition == true) {
|
||||
|
||||
//this is the case when the filter is being repeated on a single column with different condition and value
|
||||
for(i=0;i<allFilters.length;i++) {
|
||||
|
||||
if(i==0){
|
||||
url = '?' + allFilters[i].column + '[' + allFilters[i].cond + ']' + '=' + allFilters[i].val;
|
||||
}
|
||||
else
|
||||
url = url + '&' + allFilters[i].column + '[' + allFilters[i].cond + ']' + '=' + allFilters[i].val;
|
||||
}
|
||||
|
||||
document.location = url;
|
||||
|
||||
} else {
|
||||
|
||||
var uri = window.location.href.toString();
|
||||
|
||||
var clean_uri = uri.substring(0, uri.indexOf("?"));
|
||||
|
||||
document.location = clean_uri;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//make the filter array from url after being redirected
|
||||
function arrayFromUrl(x) {
|
||||
function arrayFromUrl(urlstring) {
|
||||
|
||||
var obj={};
|
||||
t = x.slice(0,x.length);
|
||||
|
||||
t = urlstring.slice(0,urlstring.length);
|
||||
|
||||
splitted = [];
|
||||
|
||||
moreSplitted = [];
|
||||
|
||||
splitted = t.split('&');
|
||||
|
||||
for(i=0;i<splitted.length;i++) {
|
||||
|
||||
moreSplitted.push(splitted[i].split('='));
|
||||
|
||||
}
|
||||
for(i=0;i<moreSplitted.length;i++) {
|
||||
|
||||
col = moreSplitted[i][0].replace(']','').split('[')[0];
|
||||
|
||||
cond = moreSplitted[i][0].replace(']','').split('[')[1]
|
||||
|
||||
val = moreSplitted[i][1];
|
||||
|
||||
obj.column = col;
|
||||
|
||||
obj.cond = cond;
|
||||
|
||||
obj.val = val;
|
||||
|
||||
if(col!=undefined && cond!=undefined && val!=undefined)
|
||||
allFilters1.push(obj);
|
||||
allFilters.push(obj);
|
||||
|
||||
obj = {};
|
||||
|
||||
}
|
||||
makeTags();
|
||||
}
|
||||
|
||||
//use the label to prevent the display of column name on the body
|
||||
function makeTags() {
|
||||
var filterRepeat = 0;
|
||||
if(allFilters1.length!=0)
|
||||
for(var i = 0;i<allFilters1.length;i++) {
|
||||
if(allFilters1[i].column == "sort") {
|
||||
|
||||
col_label_tag = $('li[data-name="'+allFilters1[i].cond+'"]').text();
|
||||
var filter_card = '<span class="filter-one" id="'+ i +'"><span class="filter-name">'+ col_label_tag +'</span><span class="filter-value"><span class="f-value">'+ allFilters1[i].val +'</span><span class="icon cross-icon remove-filter"></span></span></span>';
|
||||
var filterRepeat = 0;
|
||||
|
||||
if(allFilters.length!=0)
|
||||
for(var i = 0;i<allFilters.length;i++) {
|
||||
|
||||
if(allFilters[i].column == "sort") {
|
||||
|
||||
col_label_tag = $('li[data-name="'+allFilters[i].cond+'"]').text();
|
||||
|
||||
var filter_card = '<span class="filter-one" id="'+ i +'"><span class="filter-name">'+ col_label_tag +'</span><span class="filter-value"><span class="f-value">'+ allFilters[i].val +'</span><span class="icon cross-icon remove-filter"></span></span></span>';
|
||||
$('.filter-row-two').append(filter_card);
|
||||
|
||||
} else if(allFilters1[i].column == "search") {
|
||||
} else if(allFilters[i].column == "search") {
|
||||
|
||||
col_label_tag = "Search";
|
||||
var filter_card = '<span class="filter-one" id="'+ i +'"><span class="filter-name">'+ col_label_tag +'</span><span class="filter-value"><span class="f-value">'+ allFilters1[i].val +'</span><span class="icon cross-icon remove-filter"></span></span></span>';
|
||||
|
||||
var filter_card = '<span class="filter-one" id="'+ i +'"><span class="filter-name">'+ col_label_tag +'</span><span class="filter-value"><span class="f-value">'+ allFilters[i].val +'</span><span class="icon cross-icon remove-filter"></span></span></span>';
|
||||
$('.filter-row-two').append(filter_card);
|
||||
|
||||
} else {
|
||||
col_label_tag = $('li[data-name="'+allFilters1[i].column+'"]').text().trim();
|
||||
var filter_card = '<span class="filter-one" id="'+ i +'"><span class="filter-name">'+ col_label_tag +'</span><span class="filter-value"><span class="f-value">'+ allFilters1[i].val +'</span><span class="icon cross-icon remove-filter"></span></span></span>';
|
||||
|
||||
col_label_tag = $('li[data-name="'+allFilters[i].column+'"]').text().trim();
|
||||
|
||||
var filter_card = '<span class="filter-one" id="'+ i +'"><span class="filter-name">'+ col_label_tag +'</span><span class="filter-value"><span class="f-value">'+ allFilters[i].val +'</span><span class="icon cross-icon remove-filter"></span></span></span>';
|
||||
$('.filter-row-two').append(filter_card);
|
||||
|
||||
}
|
||||
|
|
@ -290,64 +360,88 @@
|
|||
|
||||
//This is being used for validation of url params and making array of filters
|
||||
function formURL(column, condition, response, urlparams,clabel) {
|
||||
/*validate the conditions here and do the replacements and
|
||||
push here in the all filters array*/
|
||||
|
||||
/* validate the conditions here and do the replacements and
|
||||
push here in the all filters array */
|
||||
var obj1 = {};
|
||||
|
||||
if(column == "" || condition == "" || response == "") {
|
||||
alert("Please mention all the fields for column, condition and match params for proper functioning");
|
||||
|
||||
alert("Some of the required field is null, please check column, condition and value properly.");
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
if(allFilters1.length>0) {
|
||||
if(allFilters.length>0) {
|
||||
//case for repeated filter
|
||||
|
||||
if(column != "sort" && column != "search") {
|
||||
|
||||
filter_repeated = 0;
|
||||
for(j=0;j<allFilters1.length;j++) {
|
||||
if(allFilters1[j].column==column && allFilters1[j].cond==condition && allFilters1[j].val==response)
|
||||
|
||||
for(j=0;j<allFilters.length;j++) {
|
||||
|
||||
if(allFilters[j].column == column && allFilters[j].cond == condition && allFilters[j].val == response)
|
||||
{
|
||||
filter_repeated = 1;
|
||||
return false;
|
||||
} else if(allFilters[j].column == column) {
|
||||
|
||||
filter_repeated = 1;
|
||||
allFilters[j].cond = condition;
|
||||
allFilters[j].val = response;
|
||||
makeURL(true);
|
||||
|
||||
}
|
||||
}
|
||||
if(filter_repeated == 0) {
|
||||
|
||||
obj1.column = column;
|
||||
obj1.cond = condition;
|
||||
obj1.val = response;
|
||||
obj1.label = clabel;
|
||||
allFilters1.push(obj1);
|
||||
allFilters.push(obj1);
|
||||
obj1 = {};
|
||||
makeURL();
|
||||
}
|
||||
}
|
||||
if(column == "sort") {
|
||||
sort_exists = 0;
|
||||
for(j=0;j<allFilters1.length;j++) {
|
||||
if(allFilters1[j].column == "sort") {
|
||||
|
||||
if(allFilters1[j].column==column && allFilters1[j].cond==condition && allFilters1[j].val==response){
|
||||
sort_exists = 0;
|
||||
|
||||
for(j=0;j<allFilters.length;j++) {
|
||||
|
||||
if(allFilters[j].column == "sort") {
|
||||
|
||||
if(allFilters[j].column==column && allFilters[j].cond==condition && allFilters[j].val==response) {
|
||||
|
||||
if(response=="asc") {
|
||||
allFilters1[j].column = column;
|
||||
allFilters1[j].cond = condition;
|
||||
allFilters1[j].val = "desc";
|
||||
allFilters1[j].label = clabel;
|
||||
|
||||
allFilters[j].column = column;
|
||||
allFilters[j].cond = condition;
|
||||
allFilters[j].val = "desc";
|
||||
allFilters[j].label = clabel;
|
||||
makeURL();
|
||||
|
||||
}
|
||||
else {
|
||||
allFilters1[j].column = column;
|
||||
allFilters1[j].cond = condition;
|
||||
allFilters1[j].val = "asc";
|
||||
allFilters1[j].label = clabel;
|
||||
|
||||
allFilters[j].column = column;
|
||||
allFilters[j].cond = condition;
|
||||
allFilters[j].val = "asc";
|
||||
allFilters[j].label = clabel;
|
||||
makeURL();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
allFilters1[j].column = column;
|
||||
allFilters1[j].cond = condition;
|
||||
allFilters1[j].val = response;
|
||||
allFilters1[j].label = clabel;
|
||||
|
||||
allFilters[j].column = column;
|
||||
allFilters[j].cond = condition;
|
||||
allFilters[j].val = response;
|
||||
allFilters[j].label = clabel;
|
||||
makeURL();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -355,39 +449,46 @@
|
|||
}
|
||||
}
|
||||
if(column == "search") {
|
||||
|
||||
search_found = 0;
|
||||
for(j=0;j<allFilters1.length;j++) {
|
||||
if(allFilters1[j].column == "search") {
|
||||
allFilters1[j].column = column;
|
||||
allFilters1[j].cond = condition;
|
||||
allFilters1[j].val = response;
|
||||
allFilters1[j].label = clabel;
|
||||
|
||||
for(j=0;j<allFilters.length;j++) {
|
||||
|
||||
if(allFilters[j].column == "search") {
|
||||
allFilters[j].column = column;
|
||||
allFilters[j].cond = condition;
|
||||
allFilters[j].val = response;
|
||||
allFilters[j].label = clabel;
|
||||
makeURL();
|
||||
}
|
||||
}
|
||||
for(j=0;j<allFilters1.length;j++) {
|
||||
if(allFilters1[j].column == "search") {
|
||||
|
||||
for(j=0;j<allFilters.length;j++) {
|
||||
if(allFilters[j].column == "search") {
|
||||
search_found = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if(search_found == 0) {
|
||||
obj1.column = column;
|
||||
obj1.cond = condition;
|
||||
obj1.val = response;
|
||||
obj1.label = clabel;
|
||||
allFilters1.push(obj1);
|
||||
allFilters.push(obj1);
|
||||
obj1 = {};
|
||||
makeURL();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
obj1.column = column;
|
||||
obj1.cond = condition;
|
||||
obj1.val = response;
|
||||
obj1.label = clabel;
|
||||
allFilters1.push(obj1);
|
||||
allFilters.push(obj1);
|
||||
obj1 = {};
|
||||
makeURL();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,21 +89,30 @@
|
|||
<label class="checkbox-view" for="checkbox"></label>
|
||||
</span>
|
||||
</th>
|
||||
@foreach ($columns as $column) @if($column->sortable == "true")
|
||||
<th class="grid_head"
|
||||
@if(strpos($column->alias, ' as '))
|
||||
<?php $exploded_name = explode(' as ',$column->name); ?>
|
||||
data-column-name="{{ $exploded_name[0] }}"
|
||||
@else
|
||||
data-column-name="{{ $column->alias }}"
|
||||
@endif
|
||||
@foreach ($columns as $column)
|
||||
@if($column->sortable == "true")
|
||||
<th class="grid_head"
|
||||
@if(strpos($column->alias, ' as '))
|
||||
<?php $exploded_name = explode(' as ',$column->name); ?>
|
||||
data-column-name="{{ $exploded_name[0] }}"
|
||||
@else
|
||||
data-column-name="{{ $column->alias }}"
|
||||
@endif
|
||||
|
||||
data-column-label="{{ $column->label }}"
|
||||
data-column-sort="asc">{!! $column->sorting() !!}<span class="icon sort-down-icon"></span>
|
||||
</th>
|
||||
@else
|
||||
<th class="grid_head" data-column-name="{{ $column->alias }}" data-column-label="{{ $column->label }}">{!! $column->sorting() !!}</th>
|
||||
@endif @endforeach
|
||||
data-column-label="{{ $column->label }}"
|
||||
data-column-sort="asc">{!! $column->sorting() !!}<span class="icon sort-down-icon"></span>
|
||||
</th>
|
||||
@else
|
||||
<th class="grid_head" data-column-name="{{ $column->alias }}" data-column-label="{{ $column->label }}">{!! $column->sorting() !!}</th>
|
||||
@endif
|
||||
@endforeach
|
||||
@if(isset($attribute_columns))
|
||||
@foreach($attribute_columns as $key => $value)
|
||||
<th>
|
||||
{{ $value }}
|
||||
</th>
|
||||
@endforeach
|
||||
@endif
|
||||
<th>
|
||||
Actions
|
||||
</th>
|
||||
|
|
@ -112,6 +121,7 @@
|
|||
<tbody class="{{ $css->tbody }}">
|
||||
@foreach ($results as $result)
|
||||
<tr>
|
||||
|
||||
<td class="">
|
||||
<span class="checkbox">
|
||||
<input type="checkbox" class="indexers" id="{{ $result->id }}" name="checkbox[]">
|
||||
|
|
@ -119,12 +129,16 @@
|
|||
</span>
|
||||
</td>
|
||||
@foreach ($columns as $column)
|
||||
<td class="">{!! $column->render($result) !!}</td>
|
||||
<td class="">{!! $column->render($result) !!}</td>
|
||||
@endforeach
|
||||
|
||||
@foreach ($attribute_columns as $atc)
|
||||
<td>{{ $result->{$atc} }}</td>
|
||||
@endforeach
|
||||
|
||||
<td class="action">
|
||||
@foreach($actions as $action)
|
||||
<a @if($action['type']=="Edit") href="{{ url()->current().'/edit/'.$result->id }}" @elseif($action['type']=="Delete") href="{{ url()->current().'/delete/'.$result->id }}" @endif class="Action-{{ $action['type'] }}" id="{{ $result->id }}" onclick="return confirm_click('{{ $action['confirm_text'] }}');">
|
||||
<a @if($action['type'] == "Edit") href="{{ url()->current().'/edit/'.$result->id }}" @elseif($action['type']=="Delete") href="{{ url()->current().'/delete/'.$result->id }}" @endif class="Action-{{ $action['type'] }}" id="{{ $result->id }}" onclick="return confirm_click('{{ $action['confirm_text'] }}');">
|
||||
<i class="{{ $action['icon'] }}"></i>
|
||||
</a>
|
||||
@endforeach
|
||||
|
|
|
|||