Compile assets from production

This commit is contained in:
jitendra 2018-12-19 15:05:23 +05:30
commit c943fa3603
73 changed files with 927 additions and 36213 deletions

View File

@ -95,7 +95,7 @@ php artisan storage:link
> That's it, now just execute the project on your specified domain entry point pointing to public folder inside installation directory.
### 5. Migration from v0.1.0 to v0.1.1
### 5. Migration from v0.1.0 to v0.1.1 (Only for git users, everyone have to download fresh copy or follow from step 1 and use the same database configuration)
**Run commands below:**

View File

@ -1,7 +1,5 @@
<?php
return [
];
return [
?>
];

View File

@ -11,16 +11,12 @@ use Webkul\Ui\DataGrid\Facades\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
*/
/**
* The Data Grid implementation for Attributes
*/
public function createAttributeDataGrid()
{
@ -32,11 +28,10 @@ class AttributeDataGrid
'aliased' => true,
'massoperations' => [
[
'route' => route('admin.catalog.attributes.massdelete'),
'method' => 'DELETE',
'label' => 'Delete',
'type' => 'button',
0 => [
'type' => 'delete', //all lower case will be shifted in the configuration file for better control and increased fault tolerance
'action' => route('admin.catalog.attributes.massdelete'),
'method' => 'DELETE'
]
],
@ -85,7 +80,7 @@ class AttributeDataGrid
], [
'name' => 'is_required',
'alias' => 'attributeIsRequired',
'type' => 'string',
'type' => 'boolean',
'label' => 'Required',
'sortable' => true,
'wrapper' => function ($value) {
@ -97,7 +92,7 @@ class AttributeDataGrid
], [
'name' => 'is_unique',
'alias' => 'attributeIsUnique',
'type' => 'string',
'type' => 'boolean',
'label' => 'Unique',
'sortable' => true,
'wrapper' => function ($value) {
@ -109,7 +104,7 @@ class AttributeDataGrid
], [
'name' => 'value_per_locale',
'alias' => 'attributeValuePerLocale',
'type' => 'string',
'type' => 'boolean',
'label' => 'Locale based',
'sortable' => true,
'wrapper' => function ($value) {
@ -121,7 +116,7 @@ class AttributeDataGrid
], [
'name' => 'value_per_channel',
'alias' => 'attributeValuePerChannel',
'type' => 'string',
'type' => 'boolean',
'label' => 'Channel based',
'sortable' => true,
'wrapper' => function ($value) {
@ -130,7 +125,7 @@ class AttributeDataGrid
else
return "True";
},
],
]
],
'filterable' => [
@ -154,7 +149,27 @@ class AttributeDataGrid
'alias' => 'attributeType',
'type' => 'string',
'label' => 'Type',
],
], [
'name' => 'is_required',
'alias' => 'attributeIsRequired',
'type' => 'boolean',
'label' => 'Required',
], [
'name' => 'is_unique',
'alias' => 'attributeIsUnique',
'type' => 'boolean',
'label' => 'Unique',
], [
'name' => 'value_per_locale',
'alias' => 'attributeValuePerLocale',
'type' => 'boolean',
'label' => 'Locale based',
], [
'name' => 'value_per_channel',
'alias' => 'attributeValuePerChannel',
'type' => 'boolean',
'label' => 'Channel based',
]
],
//don't use aliasing in case of searchables

View File

@ -5,23 +5,18 @@ 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
*/
/**
* The Data Grid implementation for Attribute Families
*/
public function createAttributeFamilyDataGrid()
{

View File

@ -12,16 +12,12 @@ use Webkul\Ui\DataGrid\Facades\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
*/
/**
* The Data Grid implementation for category
*/
public function createCategoryDataGrid()
{
@ -89,7 +85,7 @@ class CategoryDataGrid
], [
'name' => 'cat.status',
'alias' => 'catstatus',
'type' => 'string',
'type' => 'boolean',
'label' => 'Visible in Menu',
'sortable' => true,
'wrapper' => function ($value) {
@ -125,7 +121,7 @@ class CategoryDataGrid
], [
'column' => 'cat.status',
'alias' => 'catstatus',
'type' => 'string',
'type' => 'boolean',
'label' => 'Visible in Menu',
],
],

View File

@ -12,16 +12,12 @@ use Webkul\Ui\DataGrid\Facades\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.
*
* @var CountryComposer
* for countries
*/
/**
* The Data Grid implementation for channel
*/
public function createChannelsDataGrid()
{

View File

@ -12,16 +12,12 @@ use Webkul\Ui\DataGrid\Facades\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.
*
* @var CountryComposer
* for countries
*/
/**
* The Data Grid implementation for countries
*/
public function createCountryDataGrid()
{

View File

@ -11,16 +11,12 @@ use Webkul\Ui\DataGrid\Facades\DataGrid;
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class CurrencyDataGrid
{
/**
* The Data Grid implementation.
*
* @var CurrenciesDataGrid
* for countries
*/
/**
* The Data Grid implementation for currencies
*/
public function createCurrencyDataGrid()
{
@ -32,11 +28,10 @@ class CurrencyDataGrid
'aliased' => false, //use this with false as default and true in case of joins
'massoperations' =>[
[
'route' => route('admin.currencies.massdelete'),
'method' => 'DELETE',
'label' => 'Delete',
'type' => 'button',
0 => [
'type' => 'delete', //all lower case will be shifted in the configuration file for better control and increased fault tolerance
'action' => route('admin.currencies.massdelete'),
'method' => 'DELETE'
]
],

View File

@ -13,13 +13,10 @@ use Webkul\Ui\DataGrid\Facades\DataGrid;
*/
class CustomerDataGrid
{
/**
* The CustomerDataGrid
* implementation.
*
* @var CustomerDataGrid
*/
/**
* The CustomerDataGrid implementation.
*/
public function createCustomerDataGrid()
{

View File

@ -11,14 +11,11 @@ use Webkul\Ui\DataGrid\Facades\DataGrid;
* @author Rahul Shukla <rahulshukla.symfony517@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class CustomerGroupDataGrid
{
/**
* The Customer Group Data
* Grid implementation.
*
* @var CustomerGroupDataGrid
* The Customer Group Data Grid implementation.
*/
public function createCustomerGroupDataGrid()
{
@ -56,8 +53,7 @@ class CustomerGroupDataGrid
'route' => 'admin.groups.edit',
'confirm_text' => 'Do you really want to edit this record?',
'icon' => 'icon pencil-lg-icon',
],
[
], [
'type' => 'Delete',
'route' => 'admin.groups.delete',
'confirm_text' => 'Do you really want to delete this record?',
@ -117,6 +113,7 @@ class CustomerGroupDataGrid
'label' => 'Name'
]
],
'operators' => [
'eq' => "=",
'lt' => "<",
@ -135,7 +132,6 @@ class CustomerGroupDataGrid
}
public function render() {
return $this->createCustomerGroupDataGrid()->render();
}
}

View File

@ -12,17 +12,12 @@ use Webkul\Ui\DataGrid\Facades\DataGrid;
* @author Rahul Shukla <rahulshukla.symfony517@webkul.com> @rahul-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class CustomerReviewDataGrid
{
/**
* The ProductReviewDataGrid
* implementation.
*
* @var CustomerReviewsDataGrid
* for Reviews
*/
/**
* The ProductReviewDataGrid implementation for Product Reviews
*/
public function createCustomerReviewDataGrid()
{
@ -34,12 +29,19 @@ class CustomerReviewDataGrid
'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',
// ],
0 => [
'type' => 'delete', //all lower case will be shifted in the configuration file for better control and increased fault tolerance
'action' => route('admin.customer.review.massdelete'),
'method' => 'DELETE'
], 1 => [
'type' => 'update', //all lower case will be shifted in the configuration file for better control and increased fault tolerance
'action' => route('admin.customer.review.massupdate'),
'method' => 'PUT',
'options' => [
0 => 'Disapprove',
1 => 'Approve',
]
]
],
'actions' => [

View File

@ -11,17 +11,12 @@ use Webkul\Ui\DataGrid\Facades\DataGrid;
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class ExchangeRatesDataGrid
{
/**
* The Data Grid implementation.
*
* @var ExchangeRatesDataGrid
* for Exchange Rates
* The Data Grid implementation for Exchange Rates
*/
public function createExchangeRatesDataGrid()
{

View File

@ -11,16 +11,12 @@ use Webkul\Ui\DataGrid\Facades\DataGrid;
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class InventorySourcesDataGrid
{
/**
* The Data Grid implementation.
*
* @var InventorySourcesDataGrid
* for Inventory Sources
*/
/**
* The Data Grid implementation for Inventory Sources
*/
public function createInventorySourcesDataGrid()
{
return DataGrid::make([
@ -93,7 +89,7 @@ class InventorySourcesDataGrid
], [
'name' => 'status',
'alias' => 'inventoryStatus',
'type' => 'string',
'type' => 'boolean',
'label' => 'Status',
'sortable' => true,
'wrapper' => function ($value) {
@ -124,6 +120,11 @@ class InventorySourcesDataGrid
'alias' => 'inventoryName',
'type' => 'string',
'label' => 'Name',
], [
'name' => 'status',
'alias' => 'inventoryStatus',
'type' => 'boolean',
'label' => 'Status',
],
],

View File

@ -11,16 +11,12 @@ use Webkul\Ui\DataGrid\Facades\DataGrid;
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class LocalesDataGrid
{
/**
* The Data Grid implementation.
*
* @var CountryDataGrid
* for countries
*/
/**
* The Data Grid implementation for countries
*/
public function createCountryDataGrid()
{

View File

@ -11,14 +11,11 @@ use Webkul\Ui\DataGrid\Facades\DataGrid;
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class NewsLetterDataGrid
{
/**
* The Data Grid implementation.
*
* @var newsletterDataGrid
* for orders
* The Data Grid implementation for orders
*/
public function newsLetterDataGrid()
{
@ -67,7 +64,7 @@ class NewsLetterDataGrid
], [
'name' => 'sublist.is_subscribed',
'alias' => 'issubs',
'type' => 'string',
'type' => 'boolean',
'label' => 'Subscribed',
'sortable' => true,
'wrapper' => function ($value) {
@ -94,7 +91,7 @@ class NewsLetterDataGrid
], [
'column' => 'sublist.is_subscribed',
'alias' => 'issubs',
'type' => 'string',
'type' => 'boolean',
'label' => 'Subscribed',
], [
'column' => 'sublist.email',

View File

@ -6,30 +6,25 @@ use Illuminate\View\View;
use Webkul\Ui\DataGrid\Facades\DataGrid;
/**
* orderDataGrid
* OrderDataGrid
*
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class OrderDataGrid
{
/**
* The Data Grid implementation.
*
* @var orderDataGrid
* for orders
* The Data Grid implementation for orders
*/
public function createOrderDataGrid()
{
return DataGrid::make([
return DataGrid::make([
'name' => 'orders',
'table' => 'orders as or',
'select' => 'or.id',
'perpage' => 10,
'aliased' => false,
//True in case of joins else aliasing key required on all cases
'aliased' => false, //True in case of joins else aliasing key required on all cases
'massoperations' =>[
// [
@ -47,19 +42,12 @@ class OrderDataGrid
// 'confirm_text' => 'Do you really want to view this record?',
'icon' => 'icon eye-icon',
'icon-alt' => 'View'
],
// [
// 'type' => 'Delete',
// 'route' => route('admin.datagrid.delete'),
// 'confirm_text' => 'Do you really want to do this?',
// 'icon' => 'icon trash-icon',
// ],
]
],
'join' => [],
//use aliasing on secodary columns if join is performed
'columns' => [
[
'name' => 'or.id',
@ -94,7 +82,7 @@ class OrderDataGrid
], [
'name' => 'or.created_at',
'alias' => 'createdat',
'type' => 'string',
'type' => 'datetime',
'label' => 'Order Date',
'sortable' => true,
], [
@ -140,10 +128,15 @@ class OrderDataGrid
'alias' => 'orstatus',
'type' => 'string',
'label' => 'Status'
], [
'column' => 'or.created_at',
'alias' => 'createdat',
'type' => 'datetime',
'label' => 'Order Date',
],
],
//don't use aliasing in case of searchables
//don't use aliasing in case of searchables
'searchable' => [
[
'column' => 'or.id',
@ -168,6 +161,7 @@ class OrderDataGrid
'like' => "like",
'nlike' => "not like",
],
// 'css' => []
]);
}

View File

@ -11,14 +11,11 @@ use Webkul\Ui\DataGrid\Facades\DataGrid;
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class OrderInvoicesDataGrid
{
/**
* The Order invoices Data Grid implementation.
*
* @var OrderInvoicesDataGrid
* for invoices of orders
* The Order invoices Data Grid implementation for invoices of orders
*/
public function createOrderInvoicesDataGrid()
{
@ -74,24 +71,25 @@ class OrderInvoicesDataGrid
'type' => 'number',
'label' => 'Order ID',
'sortable' => true
],
// [
// 'name' => 'inv.state',
// 'alias' => 'invstate',
// 'type' => 'string',
// 'label' => 'State',
// 'sortable' => false
// ],
[
], [
'name' => 'inv.state',
'alias' => 'invstate',
'type' => 'string',
'label' => 'State',
'sortable' => true
], [
'name' => 'inv.grand_total',
'alias' => 'invgrandtotal',
'type' => 'number',
'label' => 'Amount',
'sortable' => true
'sortable' => true,
'wrapper' => function ($value) {
return core()->formatBasePrice($value);
},
], [
'name' => 'inv.created_at',
'alias' => 'invcreated_at',
'type' => 'date',
'type' => 'datetime',
'label' => 'Invoice Date',
'sortable' => true
]
@ -103,6 +101,11 @@ class OrderInvoicesDataGrid
'alias' => 'invid',
'type' => 'number',
'label' => 'ID',
], [
'column' => 'inv.created_at',
'alias' => 'invcreated_at',
'type' => 'datetime',
'label' => 'Invoice Date',
]
],
//don't use aliasing in case of searchables

View File

@ -12,14 +12,11 @@ use DB;
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class OrderShipmentsDataGrid
{
/**
* The Order Shipments Data Grid implementation.
*
* @var OrderShipmentsDataGrid
* for shipments of orders
* The Order Shipments Data Grid implementation for shipments of orders
*/
public function createOrderShipmentsDataGrid()
{
@ -94,9 +91,9 @@ class OrderShipmentsDataGrid
], [
'name' => 'ship.created_at',
'alias' => 'shipdate',
'type' => 'string',
'type' => 'datetime',
'label' => 'Shipment Date',
'sortable' => false
'sortable' => true
]
],
@ -106,6 +103,11 @@ class OrderShipmentsDataGrid
'alias' => 'shipID',
'type' => 'number',
'label' => 'ID',
], [
'column' => 'ship.created_at',
'alias' => 'shipdate',
'type' => 'datetime',
'label' => 'Shipment Date',
]
],
//don't use aliasing in case of searchables

View File

@ -6,20 +6,19 @@ use Illuminate\View\View;
use Webkul\Ui\DataGrid\Facades\DataGrid;
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
*/
/**
* The Data Grid implementation for Products
*/
public function createProductDataGrid()
{
return DataGrid::make([
@ -27,31 +26,44 @@ class ProductDataGrid
'table' => 'products_grid as prods',
'select' => 'prods.product_id',
'perpage' => 10,
'aliased' => true, //use this with false as default and true in case of joins
'aliased' => false, //use this with false as default and true in case of joins
'massoperations' =>[
//check other grid for configuration and make of your own
'massoperations' => [
0 => [
'type' => 'delete', //all lower case will be shifted in the configuration file for better control and increased fault tolerance
'action' => route('admin.catalog.products.massdelete'),
'method' => 'DELETE'
],
1 => [
'type' => 'update', //all lower case will be shifted in the configuration file for better control and increased fault tolerance
'action' => route('admin.catalog.products.massupdate'),
'method' => 'PUT',
'options' => [
0 => 'In Active',
1 => 'Active',
]
]
],
'actions' => [
[
'type' => 'Edit',
'route' => 'admin.catalog.products.edit',
'confirm_text' => 'Do you really want to edit this record?',
'icon' => 'icon pencil-lg-icon',
// 'confirm_text' => trans('ui::app.datagrid.massaction.edit', ['resource' => 'product']),
'icon' => 'icon pencil-lg-icon'
], [
'type' => 'Delete',
'route' => 'admin.catalog.products.delete',
'confirm_text' => 'Do you really want to delete this record?',
'icon' => 'icon trash-icon',
],
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']),
'icon' => 'icon trash-icon'
]
],
'join' => [
],
//use aliasing on secodary columns if join is performed
'columns' => [
//name, alias, type, label, sortable
[
@ -81,7 +93,7 @@ class ProductDataGrid
], [
'name' => 'prods.status',
'alias' => 'ProductStatus',
'type' => 'string',
'type' => 'boolean',
'label' => 'Status',
'sortable' => true,
'wrapper' => function ($value) {
@ -136,6 +148,11 @@ class ProductDataGrid
'alias' => 'ProductType',
'type' => 'string',
'label' => 'Product Type',
], [
'name' => 'prods.status',
'alias' => 'ProductStatus',
'type' => 'boolean',
'label' => 'Status'
]
],
//don't use aliasing in case of searchables
@ -181,8 +198,6 @@ class ProductDataGrid
public function render()
{
return $this->createProductDataGrid()->render();
// return $this->getProducts();
}
public function export()

View File

@ -11,17 +11,11 @@ use Webkul\Ui\DataGrid\Facades\DataGrid;
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class RolesDataGrid
{
/**
* The Data Grid implementation.
*
* @var RolesDataGrid
* for Roles
* The Data Grid implementation for Roles
*/
public function createRolesDataGrid()
{

View File

@ -11,16 +11,12 @@ use Webkul\Ui\DataGrid\Facades\DataGrid;
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class SliderDataGrid
{
/**
* The Data Grid implementation.
*
* @var SliderDataGrid
* for Sliders
*/
/**
* The Data Grid implementation for Sliders
*/
public function createSliderDataGrid()
{

View File

@ -14,11 +14,9 @@ use Webkul\Ui\DataGrid\Facades\DataGrid;
class TaxCategoryDataGrid
{
/**
* The Tax Category Data
* Grid implementation.
*
* @var TaxCategoryDataGrid
* The Tax Category Data Grid implementation.
*/
public function createTaxCategoryDataGrid()
{

View File

@ -11,14 +11,11 @@ use Webkul\Ui\DataGrid\Facades\DataGrid;
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class TaxRateDataGrid
{
/**
* The Tax Category Data
* Grid implementation.
*
* @var TaxRateDataGrid
* The Tax Category Data Grid implementation.
*/
public function createTaxRateDataGrid()
{

View File

@ -11,16 +11,12 @@ use Webkul\Ui\DataGrid\Facades\DataGrid;
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class UserDataGrid
{
/**
* The Data Grid implementation.
*
* @var UserDataGrid
* for admin users
*/
/**
* The Data Grid implementation for admin users
*/
public function createUserDataGrid()
{
@ -96,6 +92,18 @@ class UserDataGrid
// 'wrapper' => function ($value, $object) {
// return '<a class="color-red">' . $object->Name . '</a>';
// },
], [
'name' => 'u.status',
'alias' => 'Status',
'type' => 'boolean',
'label' => 'Status',
'sortable' => true,
'wrapper' => function ($value) {
if($value == 1)
return "Active";
else
return "Inactive";
},
], [
'name' => 'u.email',
'alias' => 'Email',
@ -110,6 +118,7 @@ class UserDataGrid
'sortable' => true,
],
],
//don't use aliasing in case of filters
'filterable' => [
[
@ -126,14 +135,20 @@ class UserDataGrid
'column' => 'u.email',
'alias' => 'Email',
'type' => 'string',
'label' => 'Email',
'label' => 'Email'
], [
'column' => 'r.name',
'alias' => 'rolename',
'type' => 'string',
'label' => 'Role Name',
'label' => 'Role Name'
], [
'name' => 'u.status',
'alias' => 'Status',
'type' => 'boolean',
'label' => 'Status'
]
],
//don't use aliasing in case of searchables
'searchable' => [
[
@ -154,6 +169,7 @@ class UserDataGrid
'label' => 'Role Name',
]
],
'operators' => [
'eq' => "=",
'lt' => "<",
@ -165,15 +181,13 @@ class UserDataGrid
'like' => "like",
'nlike' => "not like",
],
// 'css' => []
// 'css' => []
]);
}
public function render() {
return $this->createUserDataGrid()->render();
}
}

View File

@ -90,6 +90,15 @@ Route::group(['middleware' => ['web']], function () {
'redirect' => 'admin.customer.review.index'
])->name('admin.customer.review.delete');
//mass destroy
Route::post('reviews/massdestroy', 'Webkul\Product\Http\Controllers\ReviewController@massDestroy')->defaults('_config', [
'redirect' => 'admin.customer.review.index'
])->name('admin.customer.review.massdelete');
//mass update
Route::post('reviews/massupdate', 'Webkul\Product\Http\Controllers\ReviewController@massUpdate')->defaults('_config', [
'redirect' => 'admin.customer.review.index'
])->name('admin.customer.review.massupdate');
// Customer Groups Routes
Route::get('groups', 'Webkul\Admin\Http\Controllers\Customer\CustomerGroupController@index')->defaults('_config',[
@ -197,8 +206,21 @@ Route::group(['middleware' => ['web']], function () {
'redirect' => 'admin.catalog.products.index'
])->name('admin.catalog.products.update');
//product delete
Route::get('/products/delete/{id}', 'Webkul\Product\Http\Controllers\ProductController@destroy')->name('admin.catalog.products.delete');
//product massaction
Route::post('products/massaction', 'Webkul\Product\Http\Controllers\ProductController@massActionHandler')->name('admin.catalog.products.massaction');
//product massdelete
Route::post('products/massdelete', 'Webkul\Product\Http\Controllers\ProductController@massDestroy')->defaults('_config', [
'redirect' => 'admin.catalog.products.index'
])->name('admin.catalog.products.massdelete');
//product massupdate
Route::post('products/massupdate', 'Webkul\Product\Http\Controllers\ProductController@massUpdate')->defaults('_config', [
'redirect' => 'admin.catalog.products.index'
])->name('admin.catalog.products.massupdate');
// Catalog Category Routes
Route::get('/categories', 'Webkul\Category\Http\Controllers\CategoryController@index')->defaults('_config', [
@ -247,7 +269,7 @@ Route::group(['middleware' => ['web']], function () {
Route::get('/attributes/delete/{id}', 'Webkul\Attribute\Http\Controllers\AttributeController@destroy')->name('admin.catalog.attributes.delete');
Route::delete('/attributes/massdelete', 'Webkul\Attribute\Http\Controllers\AttributeController@massDestroy')->name('admin.catalog.attributes.massdelete');
Route::post('/attributes/massdelete', 'Webkul\Attribute\Http\Controllers\AttributeController@massDestroy')->name('admin.catalog.attributes.massdelete');
// Catalog Family Routes
Route::get('/families', 'Webkul\Attribute\Http\Controllers\AttributeFamilyController@index')->defaults('_config', [
@ -274,29 +296,34 @@ Route::group(['middleware' => ['web']], function () {
});
// User Routes
//datagrid for backend users
Route::get('/users', 'Webkul\User\Http\Controllers\UserController@index')->defaults('_config', [
'view' => 'admin::users.users.index'
])->name('admin.users.index');
//create backend user get
Route::get('/users/create', 'Webkul\User\Http\Controllers\UserController@create')->defaults('_config', [
'view' => 'admin::users.users.create'
])->name('admin.users.create');
//create backend user post
Route::post('/users/create', 'Webkul\User\Http\Controllers\UserController@store')->defaults('_config', [
'redirect' => 'admin.users.index'
])->name('admin.users.store');
//delete backend user view
Route::get('/users/edit/{id}', 'Webkul\User\Http\Controllers\UserController@edit')->defaults('_config', [
'view' => 'admin::users.users.edit'
])->name('admin.users.edit');
//edit backend user submit
Route::put('/users/edit/{id}', 'Webkul\User\Http\Controllers\UserController@update')->defaults('_config', [
'redirect' => 'admin.users.index'
])->name('admin.users.update');
//delete backend user
Route::get('/users/delete/{id}', 'Webkul\User\Http\Controllers\UserController@destroy')->name('admin.users.delete');
// User Role Routes
Route::get('/roles', 'Webkul\User\Http\Controllers\RoleController@index')->defaults('_config', [
'view' => 'admin::users.roles.index'
@ -366,7 +393,7 @@ Route::group(['middleware' => ['web']], function () {
Route::get('/currencies/delete/{id}', 'Webkul\Core\Http\Controllers\CurrencyController@destroy')->name('admin.currencies.delete');
Route::any('/currencies/massdelete', 'Webkul\Core\Http\Controllers\CurrencyController@massDestroy')->name('admin.currencies.massdelete');
Route::post('/currencies/massdelete', 'Webkul\Core\Http\Controllers\CurrencyController@massDestroy')->name('admin.currencies.massdelete');
// Exchange Rates Routes

View File

@ -34,7 +34,8 @@ return [
'mass-ops' => [
'method-error' => 'Error! Wrong method detected, please check mass action configuration',
'delete-success' => 'Selected index of :resource were successfully deleted',
'partial-action' => 'Some actions were not performed due restricted system constraints on :resource'
'partial-action' => 'Some actions were not performed due restricted system constraints on :resource',
'update-success' => 'Selected index of :resource were successfully updated'
]
],
@ -45,7 +46,9 @@ return [
'name' => 'Name',
'email' => 'Email',
'password' => 'Password',
'confirm-password' => 'Confirm Password'
'confirm-password' => 'Confirm Password',
'change-password' => 'Change Account Password',
'current-password' => 'Current Password'
],
'users' => [
'forget-password' => [
@ -223,7 +226,8 @@ return [
'disabled' => 'Disabled',
'add-variant-title' => 'Add Variant',
'variant-already-exist-message' => 'Variant with same attribute options already exists.',
'add-image-btn-title' => 'Add Image'
'add-image-btn-title' => 'Add Image',
'mass-delete-success' => 'All the selected index of products have been deleted successfully'
],
'attributes' => [
'title' => 'Attributes',
@ -555,14 +559,17 @@ return [
'status' => 'Status',
'comment' => 'Comment'
],
'subscribers' => [
'title' => 'News Letter Subscribers',
'title-edit' => 'Edit News Letter Subscriber',
'email' => 'Email',
'is_subscribed' => 'Subscribed',
'edit-btn-title' => 'Update Subscriber',
'update-success' => 'You updated subscriber',
'update-failed' => 'Error! You cannot unsubscribed the subscriber'
'update-success' => 'Subscriber was successfully updated',
'update-failed' => 'Error! You cannot unsubscribe the subscriber',
'delete' => 'Subscriber was successfully deleted',
'delete-failed' => 'Erorr! Subscriber cannot be deleted'
]
],

View File

@ -44,7 +44,7 @@
</div>
</accordian>
<accordian :title="'{{ __('admin::app.account.password') }}'" :active="true">
<accordian :title="'{{ __('admin::app.account.change-password') }}'" :active="true">
<div slot="body">
<div class="control-group" :class="[errors.has('password') ? 'has-error' : '']">
<label for="password">{{ __('admin::app.account.password') }}</label>
@ -59,6 +59,16 @@
</div>
</div>
</accordian>
<accordian :title="'{{ __('admin::app.account.current-password') }}'" :active="true">
<div slot="body">
<div class="control-group" :class="[errors.has('current_password') ? 'has-error' : '']">
<label for="current_password">{{ __('admin::app.account.current-password') }}</label>
<input type="password" v-validate="'required|min:6'" class="control" id="current_password" name="current_password" data-vv-as="&quot;{{ __('admin::app.account.current-password') }}&quot;"/>
<span class="control-error" v-if="errors.has('current_password')">@{{ errors.first('current_password') }}</span>
</div>
</div>
</accordian>
</div>
</div>
</form>

View File

@ -1,7 +1,6 @@
<div class="aside-nav">
<ul>
@if (request()->route()->getName() != 'admin.configuration.index')
<?php $keys = explode('.', $menu->currentKey); ?>
@foreach(array_get($menu->items, current($keys) . '.children') as $item)
@ -15,11 +14,8 @@
</a>
</li>
@endforeach
@else
@foreach($config->items as $key => $item)
<li class="{{ $item['key'] == request()->route('slug') ? 'active' : '' }}">
<a href="{{ route('admin.configuration.index', $item['key']) }}">
{{ isset($item['name']) ? $item['name'] : '' }}
@ -29,9 +25,7 @@
@endif
</a>
</li>
@endforeach
@endif
</ul>
</div>

View File

@ -1,10 +1,8 @@
<div class="tabs">
<ul>
@if (request()->route()->getName() != 'admin.configuration.index')
<?php $keys = explode('.', $menu->currentKey); ?>
@foreach(array_get($menu->items, implode('.children.', array_slice($keys, 0, 2)) . '.children') as $item)
<li class="{{ $menu->getActive($item) }}">
<a href="{{ $item['url'] }}">
@ -16,19 +14,14 @@
@else
@if (array_get($config->items, request()->route('slug') . '.children'))
@foreach (array_get($config->items, request()->route('slug') . '.children') as $key => $item)
<li class="{{ $key == request()->route('slug2') ? 'active' : '' }}">
<a href="{{ route('admin.configuration.index', (request()->route('slug') . '/' . $key)) }}">
{{ $item['name'] }}
</a>
</li>
@endforeach
@endif
@endif
</ul>
</div>

View File

@ -27,13 +27,13 @@
<accordian :title="'{{ __('admin::app.settings.locales.general') }}'" :active="true">
<div slot="body">
<div class="control-group" :class="[errors.has('code') ? 'has-error' : '']">
<label for="code">{{ __('admin::app.settings.locales.code') }}</label>
<label for="code" class="required">{{ __('admin::app.settings.locales.code') }}</label>
<input v-validate="'required'" class="control" id="code" name="code" data-vv-as="&quot;{{ __('admin::app.settings.locales.code') }}&quot;" v-code/>
<span class="control-error" v-if="errors.has('code')">@{{ errors.first('code') }}</span>
</div>
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
<label for="name">{{ __('admin::app.settings.locales.name') }}</label>
<label for="name" class="required">{{ __('admin::app.settings.locales.name') }}</label>
<input v-validate="'required'" class="control" id="name" name="name" data-vv-as="&quot;{{ __('admin::app.settings.locales.name') }}&quot;"/>
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
</div>

View File

@ -27,7 +27,7 @@
<div slot="body">
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
<label for="name" class="required">{{ __('admin::app.users.users.name') }}</label>
<input type="text" v-validate="'required'" class="control" id="email" name="name" data-vv-as="&quot;{{ __('admin::app.users.users.name') }}&quot;"/>
<input type="text" v-validate="'required'" class="control" id="name" name="name" data-vv-as="&quot;{{ __('admin::app.users.users.name') }}&quot;"/>
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
</div>

View File

@ -28,7 +28,7 @@
<div slot="body">
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
<label for="name" class="required">{{ __('admin::app.users.users.name') }}</label>
<input type="text" v-validate="'required'" class="control" id="email" name="name" data-vv-as="&quot;{{ __('admin::app.users.users.name') }}&quot;" value="{{ $user->name }}"/>
<input type="text" v-validate="'required'" class="control" id="name" name="name" data-vv-as="&quot;{{ __('admin::app.users.users.name') }}&quot;" value="{{ $user->name }}"/>
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
</div>
@ -71,7 +71,15 @@
<div class="control-group">
<label for="status">{{ __('admin::app.users.users.status') }}</label>
<span class="checkbox">
<input type="checkbox" id="status" name="status" value="{{ $user->status }}" {{ $user->status ? 'checked' : '' }}>
<input type="checkbox" id="status" name="status"
{{-- @if($user->status == 0)
value="false"
@else
value="true"
@endif --}}
{{ $user->status ? 'checked' : '' }}>
<label class="checkbox-view" for="status"></label>
{{ __('admin::app.users.users.account-is-active') }}
</span>

View File

@ -152,12 +152,15 @@ class AttributeController extends Controller
public function massDestroy() {
$suppressFlash = false;
if(request()->isMethod('delete')) {
if(request()->isMethod('post')) {
$indexes = explode(',', request()->input('indexes'));
foreach($indexes as $key => $value) {
try {
$this->attribute->delete($value);
if(!$attribute->is_user_defined)
continue;
else
$this->attribute->delete($id);
} catch(\Exception $e) {
$suppressFlash = true;

View File

@ -143,7 +143,7 @@ class CurrencyController extends Controller
public function massDestroy() {
$suppressFlash = false;
if(request()->isMethod('delete')) {
if(request()->isMethod('post')) {
$indexes = explode(',', request()->input('indexes'));
foreach($indexes as $key => $value) {

View File

@ -74,9 +74,10 @@ class SubscriptionController extends Controller
$result = $subscriber->update($data);
if($result)
session()->flash('success', trans('admin::app.settings.subscribers.update-success'));
session()->flash('success', trans('admin::app.customers.subscribers.update-success'));
// session()->flash('success', 'admin::app.customers.subscribers.delete-success');
else
session()->flash('error', trans('admin::app.settings.subscribers.update-failed'));
session()->flash('error', trans('admin::app.customers.subscribers.update-failed'));
return redirect()->route($this->_config['redirect']);
}
@ -89,7 +90,10 @@ class SubscriptionController extends Controller
*/
public function destroy($id)
{
$this->subscribers->delete($id);
if($this->subscribers->delete($id))
session()->flash('success', trans('admin::app.customers.subscribers.delete'));
else
session()->flash('error', trans('admin::app.customers.subscribers.delete-failed'));
return redirect()->back();
}

View File

@ -44,5 +44,4 @@ class AccountController extends Controller
public function index() {
return view($this->_config['view']);
}
}

View File

@ -91,7 +91,6 @@ class CustomerController extends Controller
*/
public function edit()
{
$id = auth()->guard('customer')->user()->id;
$this->validate(request(), [
@ -100,7 +99,7 @@ class CustomerController extends Controller
'gender' => 'required',
'date_of_birth' => 'date',
'email' => 'email|unique:customers,email,'.$id,
'password' => 'confirmed|required_if:oldpassword,!=,null'
'password' => 'confirmed'
]);
$data = collect(request()->input())->except('_token')->toArray();

View File

@ -83,7 +83,6 @@ class RegistrationController extends Controller
return redirect()->route($this->_config['redirect']);
}
return redirect()->route($this->_config['redirect']);
} else {
session()->flash('error', trans('shop::app.customer.signup-form.failed'));

View File

@ -39,7 +39,7 @@ class SearchByAttributeCriteria extends AbstractProduct implements CriteriaInter
return $model
->leftJoin('product_attribute_values as pav', 'products.id', '=', 'pav.product_id')
->where('attribute_id', '=', $attribute->id)
->where('pav.attribute_id', '=', $attribute->id)
->where('products.parent_id', '=', null);
}
}

View File

@ -214,6 +214,68 @@ class ProductController extends Controller
return redirect()->back();
}
/**
* Mass Delete the products
*
* @return response
*/
public function massDestroy() {
$data = request()->all();
$productIds = explode(',', $data['indexes']);
if(count($productIds)) {
foreach($productIds as $productId) {
$product = $this->product->find($productId);
if(!is_null($product)) {
$product->delete();
}
}
}
session()->flash('success', trans('admin::app.catalog.products.mass-delete-success'));
return redirect()->route($this->_config['redirect']);
}
/**
* Mass updates the products
*
* @return response
*/
public function massUpdate() {
$data = request()->all();
$attribute = 'status';
$productIds = explode(',', $data['indexes']);
if(!isset($data['massaction-type'])) {
return redirect()->back();
}
if(count($productIds)) {
foreach($productIds as $productId) {
$product = $this->product->find($productId);
if($data['update-options'] == 0 && $data['selected-option-text'] == 'In Active') {
$result = $this->product->updateAttribute($product, $attribute, $data['update-options']);
if($result)
Event::fire('product.update.after', $product);
} else if($data['update-options'] == 1 && $data['selected-option-text'] == 'Active') {
$result = $this->product->updateAttribute($product, $attribute, $data['update-options']);
if($result)
Event::fire('product.update.after', $product);
}
}
}
session()->flash('success', trans('admin::app.catalog.products.mass-delete-success'));
return redirect()->route($this->_config['redirect']);
}
/*
* To be manually invoked when data is seeded into products
*/

View File

@ -106,4 +106,85 @@ class ReviewController extends Controller
return redirect()->back();
}
/**
* Mass delete the reviews on the products.
*
* @return response
*/
public function massDestroy() {
$suppressFlash = false;
if (request()->isMethod('post')) {
$data = request()->all();
$indexes = explode(',', request()->input('indexes'));
foreach($indexes as $key => $value) {
try {
$this->productReview->delete($value);
} catch(\Exception $e) {
$suppressFlash = true;
continue;
}
}
if(!$suppressFlash)
session()->flash('success', trans('admin::app.datagrid.mass-ops.delete-success', ['resource' => 'Reviews']));
else
session()->flash('info', trans('admin::app.datagrid.mass-ops.partial-action', ['resource' => 'Reviews']));
return redirect()->route($this->_config['redirect']);
} else {
session()->flash('error', trans('admin::app.datagrid.mass-ops.method-error'));
return redirect()->back();
}
}
/**
* Mass approve the reviews on the products.
*
* @return response
*/
public function massUpdate() {
$suppressFlash = false;
if (request()->isMethod('post')) {
$data = request()->all();
$indexes = explode(',', request()->input('indexes'));
foreach($indexes as $key => $value) {
$review = $this->productReview->findOneByField('id', $value);
try {
if($data['massaction-type'] == 1 && $data['update-options'] == 1 && $data['selected-option-text'] == 'Approve') {
$review->update(['status' => 'approved']);
} else if($data['massaction-type'] == 1 && $data['update-options'] == 0 && $data['selected-option-text'] == 'Disapprove') {
$review->update(['status' => 'pending']);
} else {
continue;
}
} catch(\Exception $e) {
$suppressFlash = true;
continue;
}
}
if(!$suppressFlash)
session()->flash('success', trans('admin::app.datagrid.mass-ops.update-success', ['resource' => 'Reviews']));
else
session()->flash('info', trans('admin::app.datagrid.mass-ops.partial-action', ['resource' => 'Reviews']));
return redirect()->route($this->_config['redirect']);
} else {
session()->flash('error', trans('admin::app.datagrid.mass-ops.method-error'));
return redirect()->back();
}
}
}

View File

@ -8,7 +8,7 @@ use Webkul\Product\Models\Product;
class ProductReview extends Model
{
protected $fillable = ['comment','title','rating','status','product_id','customer_id'];
protected $fillable = ['comment', 'title', 'rating', 'status', 'product_id', 'customer_id'];
/**
* Get the product attribute family that owns the product.

View File

@ -340,8 +340,8 @@ class ProductRepository extends Repository
]);
} else {
$this->attributeValue->update([
ProductAttributeValue::$attributeTypeFields[$attribute->type] => $data[$attribute->code]
], $attributeValue->id);
ProductAttributeValue::$attributeTypeFields[$attribute->type] => $data[$attribute->code]
], $attributeValue->id);
}
}
@ -350,6 +350,29 @@ class ProductRepository extends Repository
return $variant;
}
/**
* Change an attribute's value of the product
*
* @return boolean
*/
public function updateAttribute($product, $attribute, $value) {
$attribute = $this->attribute->findOneByField('code', 'status');
$attributeValue = $this->attributeValue->findOneWhere([
'product_id' => $product->id,
'attribute_id' => $attribute->id,
]);
$result = $this->attributeValue->update([
ProductAttributeValue::$attributeTypeFields[$attribute->type] => $value
], $attributeValue->id);
if($result)
return true;
else
return false;
}
/**
* @param array $data
* @param mixed $product
@ -480,15 +503,12 @@ class ProductRepository extends Repository
* @return Collection
*/
public function searchProductByAttribute($term) {
// $findIn = $this->breakTheTerm($term);
$this->pushCriteria(app(ActiveProductCriteria::class));
$this->pushCriteria(app(SearchByAttributeCriteria::class));
// $this->pushCriteria(app(SearchByCategoryCriteria::class));
return $this->scopeQuery(function($query) use($term) {
return $query->distinct()->addSelect('products.*')->where('pav.text_value', 'like', '%'.$term.'%');
// ->where('category_translations.name', 'like', '%'.'clothes'.'%');
})->get();
})->paginate(4);
}
/**

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/shop.js": "/js/shop.js",
"/css/shop.css": "/css/shop.css"
}
"/js/shop.js": "/js/shop.js?id=c6ba9f43bd31f175a665",
"/css/shop.css": "/css/shop.css?id=44608a4ce1658811733f"
}

View File

@ -37,10 +37,10 @@ use Webkul\Product\Repositories\SearchRepository as Search;
$results = $this->search->search(request()->all());
if($results) {
return view($this->_config['view'])->with('products', $results);
if($results->count()) {
return view($this->_config['view'])->with('results', $results);
} else {
return view($this->_config['view'])->with('products', null);
return view($this->_config['view'])->with('results', null);
}
}

View File

@ -78,27 +78,37 @@ class SubscriptionController extends Controller
if($unique()) {
$token = uniqid();
$result = false;
$result = $this->subscription->create([
'email' => $email,
'channel_id' => core()->getCurrentChannel()->id,
'is_subscribed' => 1,
'token' => $token
]);
if(!$result) {
session()->flash('error', trans('shop::app.subscription.not-subscribed'));
return redirect()->back();
}
$subscriptionData['email'] = $email;
$subscriptionData['token'] = $token;
Mail::send(new SubscriptionEmail($subscriptionData));
$mailSent = true;
session()->flash('success', trans('shop::app.subscription.subscribed'));
try {
session()->flash('success', trans('shop::app.subscription.subscribed'));
Mail::send(new SubscriptionEmail($subscriptionData));
} catch(\Exception $e) {
session()->flash('error', trans('shop::app.subscription.not-subscribed'));
$mailSent = false;
}
$result = false;
if($mailSent) {
$result = $this->subscription->create([
'email' => $email,
'channel_id' => core()->getCurrentChannel()->id,
'is_subscribed' => 1,
'token' => $token
]);
if(!$result) {
session()->flash('error', trans('shop::app.subscription.not-subscribed'));
return redirect()->back();
}
}
} else {
session()->flash('error', trans('shop::app.subscription.already'));
}
@ -114,6 +124,7 @@ class SubscriptionController extends Controller
public function unsubscribe($token) {
$subscriber = $this->subscription->findOneByField('token', $token);
if(isset($subscriber))
if($subscriber->count() > 0 && $subscriber->is_subscribed == 1 &&$subscriber->update(['is_subscribed' => 0])) {
session()->flash('info', trans('shop::app.subscription.unsubscribed'));
} else {

View File

@ -4,6 +4,8 @@ namespace Webkul\Shop\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Blade;
use Illuminate\Pagination\Paginator;
use Webkul\Shop\Http\Middleware\Locale;
use Webkul\Shop\Http\Middleware\Theme;
use Webkul\Shop\Http\Middleware\Currency;
@ -42,6 +44,9 @@ class ShopServiceProvider extends ServiceProvider
$this->app->register(ComposerServiceProvider::class);
$this->composeView();
Paginator::defaultView('shop::partials.pagination');
Paginator::defaultSimpleView('shop::partials.pagination');
}
/**
@ -56,7 +61,7 @@ class ShopServiceProvider extends ServiceProvider
if (!$themes->current() && \Config::get('themes.default')) {
$themes->set(\Config::get('themes.default'));
}
$this->registerConfig();
}
@ -79,7 +84,7 @@ class ShopServiceProvider extends ServiceProvider
$view->with('menu', $tree);
});
}
/**
* Register package config.
*

View File

@ -144,6 +144,13 @@ input {
margin-top: 90px;
}
//pagination
.pagination.shop{
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
//components
.bold {

View File

@ -46,7 +46,8 @@ return [
'not-subscribed' => 'You Cannot Be Subscribed To Subscription Emails, Try Again After Some time',
'already' => 'You Are Already Subscribed To Our Subscription List',
'unsubscribed' => 'You Are Unsubscribed From Bagisto Subscription Mails',
'already-unsub' => 'You Are Already Unsubscribed'
'already-unsub' => 'You Are Already Unsubscribed',
'not-subscribed' => 'Error! Mail Cannot Be Sent Currently, Please Try Again Later'
],
'search' => [
@ -176,7 +177,8 @@ return [
'delete' => 'Delete',
'make-default' => 'Make Default',
'default' => 'Default',
'contact' => 'Contact'
'contact' => 'Contact',
'confirm-delete' => 'Do you really want to delete this address?'
],
'create' => [

View File

@ -54,7 +54,7 @@
</span>
<span>
<a href="{{ route('address.delete', $address->id) }}" onclick="deleteAddress('Do you really want to do this?')">
<a href="{{ route('address.delete', $address->id) }}" onclick="deleteAddress('{{ __('shop::app.customer.account.address.index.confirm-delete') }}')">
{{ __('shop::app.customer.account.address.index.delete') }}
</a>
</span>

View File

@ -23,7 +23,7 @@
<div class="form-container">
<form action="{{ route('shop.subscribe') }}">
<div class="control-group" :class="[errors.has('email') ? 'has-error' : '']">
<input type="text" class="control subscribe-field" name="email" placeholder="Email Address" required><br/>
<input type="email" class="control subscribe-field" name="email" placeholder="Email Address" required><br/>
<button class="btn btn-md btn-primary">{{ __('shop::app.subscription.subscribe') }}</button>
</div>

View File

@ -0,0 +1,50 @@
@if ($paginator->hasPages())
<div class="pagination shop mt-50">
{{-- Previous Page Link --}}
@if($paginator->onFirstPage())
<a class="page-item previous">
<i class="icon angle-left-icon"></i>
</a>
@else
<a data-page="{{ urldecode($paginator->previousPageUrl()) }}" href="{{ urldecode($paginator->previousPageUrl()) }}" id="previous" class="page-item previous">
<i class="icon angle-left-icon"></i>
</a>
@endif
{{-- Pagination Elements --}}
@foreach ($elements as $element)
{{-- "Three Dots" Separator --}}
@if (is_string($element))
<a class="page-item disabled" aria-disabled="true">
{{ $element }}
</a>
@endif
{{-- Array Of Links --}}
@if (is_array($element))
@foreach ($element as $page => $url)
@if ($page == $paginator->currentPage())
<a class="page-item active">
{{ $page }}
</a>
@else
<a class="page-item as" href="{{ urldecode($url) }}">
{{ $page }}
</a>
@endif
@endforeach
@endif
@endforeach
{{-- Next Page Link --}}
@if ($paginator->hasMorePages())
<a href="{{ urldecode($paginator->nextPageUrl()) }}" data-page="{{ urldecode($paginator->nextPageUrl()) }}" id="next" class="page-item next">
<i class="icon angle-right-icon"></i>
</a>
@else
<a class="page-item next">
<i class="icon angle-right-icon"></i>
</a>
@endif
</div>
@endif

View File

@ -3,21 +3,16 @@
{!! view_render_event('bagisto.shop.products.review.before', ['product' => $product]) !!}
@if ($total = $reviewHelper->getTotalReviews($product))
<div class="product-ratings mb-10">
<span class="stars">
@for ($i = 1; $i <= round($reviewHelper->getAverageRating($product)); $i++)
<span class="icon star-icon"></span>
@endfor
</span>
<div class="total-reviews">
{{ __('shop::app.products.total-reviews', ['total' => $total]) }}
</div>
</div>
@endif

View File

@ -5,36 +5,37 @@
@endsection
@section('content-wrapper')
@if(!$products)
@if(!$results)
{{ __('shop::app.search.no-results') }}
@endif
<div class="main mb-30" style="min-height: 27vh;">
@if($products->isEmpty())
@if($results->isEmpty())
<div class="search-result-status">
<h2>{{ __('shop::app.products.whoops') }}</h2>
<span>{{ __('shop::app.search.no-results') }}</span>
</div>
@else
@if($products->count() == 1)
@if($results->count() == 1)
<div class="search-result-status mb-20">
<span><b>{{ $products->count() }} </b>{{ __('shop::app.search.found-result') }}</span>
<span><b>{{ $results->count() }} </b>{{ __('shop::app.search.found-result') }}</span>
</div>
@else
<div class="search-result-status mb-20">
<span><b>{{ $products->count() }} </b>{{ __('shop::app.search.found-results') }}</span>
<span><b>{{ $results->count() }} </b>{{ __('shop::app.search.found-results') }}</span>
</div>
@endif
{{-- @include ('shop::products.list.toolbar')
@inject ('toolbarHelper', 'Webkul\Product\Helpers\Toolbar') --}}
<div class="product-grid-4">
@foreach ($products as $product)
@include ('shop::products.list.card', ['product' => $product])
@foreach ($results as $product)
@include('shop::products.list.card', ['product' => $product])
@endforeach
</div>
@include('ui::datagrid.pagination')
@endif
</div>
@endsection

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/ui.js": "/js/ui.js?id=1fdce572fb02cd8c7dad",
"/css/ui.css": "/css/ui.css?id=e78eaaed7f89740f42d9"
"/css/ui.css": "/css/ui.css?id=287b4588ed3ee39d4587"
}

View File

@ -481,6 +481,21 @@ class DataGrid
}
}
/**
* To find the alias
* of the column and
* by taking the column
* name.
* @return string
*/
public function findType($column_alias) {
foreach($this->columns as $column) {
if($column->alias == $column_alias) {
return $column->type;
}
}
}
/**
* Parse the URL
* and get it ready
@ -546,7 +561,6 @@ class DataGrid
*
* @return QueryBuilder object
*/
private function getQueryWithFilters()
{
$parsed = $this->parse();
@ -560,7 +574,7 @@ class DataGrid
//case that don't need any resolving
$count_keys = count(array_keys($value));
if ($count_keys==1) {
if ($count_keys == 1) {
$this->query->orderBy(
str_replace('_', '.', array_keys($value)[0]),
array_values($value)[0]
@ -568,7 +582,7 @@ class DataGrid
} else {
throw new \Exception('Multiple Sort keys Found, Please Resolve the URL Manually');
}
} elseif ($key=="search") {
} elseif ($key == "search") {
$count_keys = count(array_keys($value));
if($count_keys==1)
@ -631,6 +645,8 @@ class DataGrid
} else {
// $column_name = $key;
$column_name = $this->findAlias($key);
$column_type = $this->findType($key);
if (array_keys($value)[0]=="like" || array_keys($value)[0]=="nlike") {
foreach ($value as $condition => $filter_value) {
$this->query->where(
@ -641,11 +657,19 @@ class DataGrid
}
} else {
foreach ($value as $condition => $filter_value) {
$this->query->where(
$column_name,
$this->operators[$condition],
$filter_value
);
if($column_type == 'datetime') {
$this->query->whereDate(
$column_name,
$this->operators[$condition],
$filter_value
);
} else {
$this->query->where(
$column_name,
$this->operators[$condition],
$filter_value
);
}
}
}
}
@ -749,11 +773,7 @@ class DataGrid
$this->getQueryWithFilters();
}
$this->results = $this->query->get();
if($pagination == true) {
$this->results = $this->query->paginate($this->perpage)->appends(request()->except('page'));
}
$this->results = $this->query->orderBy($this->select, 'desc')->paginate($this->perpage)->appends(request()->except('page'));
return $this->results;
@ -769,11 +789,7 @@ class DataGrid
$this->getQueryWithFilters();
}
$this->results = $this->query->get();
if($pagination == true) {
$this->results = $this->query->paginate($this->perpage)->appends(request()->except('page'));
}
$this->results = $this->query->orderBy($this->select, 'desc')->paginate($this->perpage)->appends(request()->except('page'));
return $this->results;
}

View File

@ -36,7 +36,5 @@ 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');
}
}

View File

@ -800,6 +800,7 @@ h2 {
@include border-radius(50px);
color: white;
padding: 8px;
white-space: nowrap;
&.badge-sm {
padding: 5px;

View File

@ -1,7 +1,5 @@
/* Data grid css starts here */
.grid-container {
user-select: none;
.filter-wrapper {
display: block;
box-sizing: border-box;
@ -50,7 +48,6 @@
display: inline-flex;
.more-filters {
margin-right: 5px;
.dropdown-toggle {
display: flex;
@ -79,6 +76,7 @@
}
}
}
.dropdown-list {
.dropdown-container {
ul {
@ -101,13 +99,14 @@
margin-bottom: 5px;
}
}
li {
select {
background: $color-white;
border: 2px solid $control-border-color;
border-radius: 3px;
height: 36px;
max-width: 100%;
width: 100%;
display: inline-block;
vertical-align: middle;
-webkit-transition: 0.2s
@ -119,12 +118,13 @@
margin-top: 10px;
margin-bottom: 5px;
}
input {
background: #fff;
border: 2px solid #c7c7c7;
border-radius: 3px;
height: 36px;
max-width: 100%;
width: 100%;
display: inline-block;
vertical-align: middle;
-webkit-transition: 0.2s
@ -137,6 +137,7 @@
margin-bottom: 5px;
}
}
.filter-condition-dropdown-string {
display: none;
}
@ -146,6 +147,9 @@
.filter-condition-dropdown-datetime {
display: none;
}
.filter-condition-dropdown-boolean {
display: none;
}
.filter-response-string {
display: none;

View File

@ -1,6 +1,14 @@
<?php
return [
'datagrid' => [
'actions' => 'Actions'
'actions' => 'Actions',
'massaction' => [
'mass-delete-confirm' => 'Do you really want to delete these selected :resource?',
'mass-update-status' => 'Do you really want to update status of these selected :resource?',
'delete' => 'Do you really want to delete this :resource?',
'edit' => 'Do you really want to edit this :resource?',
],
'no-records' => 'No Records Found',
'filter-fields-missing' => 'Some of the required field is null, please check column, condition and value properly'
]
];

View File

@ -49,6 +49,7 @@
<option value="neqs">Is not equal to</option>
</select>
</li>
{{-- suitable for numeric columns --}}
<li class="filter-condition-dropdown-number">
<select class="control filter-condition-select-number">
@ -61,6 +62,16 @@
<option value="lte">Less than equals to</option>
</select>
</li>
{{-- suitable for boolean columns --}}
<li class="filter-condition-dropdown-boolean">
<select class="control filter-condition-select-boolean">
<option selected disabled value="">Select Condition</option>
<option value="eq">Is equal to</option>
<option value="neqs">Is no equal to</option>
</select>
</li>
{{-- suitable for date/time columns --}}
<li class="filter-condition-dropdown-datetime">
<select class="control filter-condition-select-datetime">
@ -74,24 +85,29 @@
{{-- <option value="btw">Is Between</option> --}}
</select>
</li>
{{-- Response fields based on the type of columns to be filtered --}}
<li class="filter-response-string">
<input type="text" class="control response-string" placeholder="String Value here" value=""/>
</li>
<li class="filter-response-boolean">
<select class="control select-boolean">
<option selected disabled value="null">Select Condition</option>
<option value="true">Is True</option>
<option value="false">Is False</option>
<select class="control response-boolean">
<option selected disabled>Select Value</option>
<option value="1">True / Active</option>
<option value="0">False / Inactive</option>
</select>
</li>
<li class="filter-response-datetime">
{{-- use flatpickr here --}}
<input type="datetime-local" class="control response-datetime" placeholder="Value here" />
<input type="date" class="control response-datetime" placeholder="Date value here" />
</li>
<li class="filter-response-number">
<input type="text" class="control response-number" placeholder="Numeric Value here" value=""/>
<input type="text" class="control response-number" placeholder="Numeric Value here" value="" />
</li>
<li>
<button class="btn btn-sm btn-primary apply-filter">Apply</button>
</li>
@ -103,13 +119,13 @@
</div>
<div class="filter-row-two">
{{-- <span class="filter-one">
<span class="filter-name">
Stock
</span>
<span class="filter-value">
Available
<span class="icon cross-icon"></span>
</span>
<span class="filter-name">
Stock
</span>
<span class="filter-value">
Available
<span class="icon cross-icon"></span>
</span>
</span> --}}
</div>
</div>

View File

@ -24,7 +24,19 @@
let params;
$(document).ready(function() {
var actions = [];
@if(isset($massoperations) && count($massoperations))
const massactions = @json($massoperations);
for(var key in massactions) {
actions[key] = massactions[key].action;
// actions.push(massactions[key].action);
}
@endif
params = (new URL(document.location)).search;
if(params.length > 0) {
if(allFilters.length == 0) {
//call reverse url function
@ -66,44 +78,45 @@
if(typeValue == 'string') {
//default behaviour for strings
$('.filter-condition-dropdown-number').css('display','none');
$('.filter-condition-dropdown-datetime').css('display','none');
$('.filter-response-number').css('display','none');
$('.filter-response-datetime').css('display','none');
$('.filter-response-boolean').css('display','none');
$('.filter-condition-dropdown-number').css('display', 'none');
$('.filter-condition-dropdown-datetime').css('display', 'none');
$('.filter-condition-dropdown-boolean').css('display', 'none');
$('.filter-response-number').css('display', 'none');
$('.filter-response-datetime').css('display', 'none');
$('.filter-response-boolean').css('display', 'none');
//show the two wanted
$('.filter-condition-dropdown-string').css('display','inherit');
$('.filter-response-string').css('display','inherit');
}
else if(typeValue == 'boolean') {
$('.filter-condition-dropdown-string').css('display', 'inherit');
$('.filter-response-string').css('display', 'inherit');
} else if(typeValue == 'boolean') {
//hide unwanted
$('.filter-condition-dropdown-string').css('display','none');
$('.filter-condition-dropdown-number').css('display','none');
$('.filter-condition-dropdown-datetime').css('display','none');
$('.filter-response-string').css('display','none');
$('.filter-response-number').css('display','none');
$('.filter-response-datetime').css('display','none');
$('.filter-condition-dropdown-string').css('display', 'none');
$('.filter-condition-dropdown-number').css('display', 'none');
$('.filter-condition-dropdown-datetime').css('display', 'none');
$('.filter-response-string').css('display', 'none');
$('.filter-response-number').css('display', 'none');
$('.filter-response-datetime').css('display', 'none');
//only true or false for that column is needed as input
$('.filter-response-boolean').css('display','inherit');
}
else if(typeValue == 'datetime') {
$('.filter-condition-dropdown-boolean').css('display', 'inherit');
$('.filter-response-boolean').css('display', 'inherit');
} else if(typeValue == 'datetime') {
//hide unwanted
$('.filter-condition-dropdown-string').css('display','none');
$('.filter-condition-dropdown-number').css('display','none');
$('.filter-condition-dropdown-boolean').css('display','none');
$('.filter-response-string').css('display','none');
$('.filter-response-number').css('display','none');
$('.filter-response-boolean').css('display','none');
//show what is wanted
$('.filter-condition-dropdown-datetime').css('display','inherit');
$('.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');
$('.filter-condition-dropdown-boolean').css('display','none');
$('.filter-response-string').css('display','none');
$('.filter-response-datetime').css('display','none');
$('.filter-response-boolean').css('display','none');
@ -114,7 +127,6 @@
}
$('.apply-filter').on('click',function() {
params = (new URL(document.location)).search;
if(typeValue == 'number') {
@ -136,109 +148,152 @@
formURL(selectedColumn,conditionUsed,response,params,col_label);
}
if(typeValue == 'boolean') { //use select dropdown with two values true and false
// console.log('boolean');
var conditionUsed = $('.filter-condition-dropdown-boolean').find(':selected').val();
var response = $('.response-boolean').val();
console.log('boolean');
formURL(selectedColumn,conditionUsed,response,params,col_label);
}
});
});
//remove the filter and from clicking on cross icon on tag
$('.remove-filter').on('click', function() {
var id = $(this).parents('.filter-one').attr('id');
if(allFilters.length == 1) {
allFilters.pop();
var uri = window.location.href.toString();
if (uri.indexOf("?") > 0) {
var clean_uri = uri.substring(0, uri.indexOf("?"));
// window.history.replaceState({}, document.title, clean_uri);
document.location = clean_uri;
}
}
else {
allFilters.splice(id,1);
allFilters.splice(id, 1);
makeURL();
}
});
//Enable Mass Action Subsequency
var id=[]; //for getting the id of the selected fields
var y = parseInt(0);
@if(isset($massoperations) && count($massoperations))
//Enable Mass Action Subsequency
var id=[]; //for getting the id of the selected fields
var y = parseInt(0);
// master checkbox for selecting all entries
$("input[id=mastercheckbox]").change(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);
}
});
$(".massaction-type").change(function() {
selectedType = $("#massaction-type").find(":selected").val();
selectedTypeText = $("#massaction-type").find(":selected").text();
$('.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; });
//remove the hardcoding by using configuration
if(selectedType == 0 && selectedTypeText == 'delete') {
$('#update-options').css('display', 'none');
id = [];
$('#mass-action-form').attr('action', actions[0]);
} else if(selectedType == 1 && selectedTypeText == 'update') {
$('#update-options').css('display', '');
$('.mass-action').css('display','none');
$('.table-grid-header').css('display','');
$('#indexes').val('');
}
});
selectedOptionText = $("#option-type").find(":selected").text();
$('.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')) {
$(this).prop('checked',false);
$("input[id=selected-option-text]").val(selectedOptionText);
$('#mass-action-form').attr('action', actions[1]);
} else {
$('#update-options').css('display', 'none');
}
});
$('.table-grid-header').css('display','');
});
$("#option-type").click(function() {
selectedOption = $("#option-type").find(":selected").val();
selectedOptionText = $("#option-type").find(":selected").text();
$("input[class=indexers]").change(function() {
$("input[id=selected-option-text]").val(selectedOptionText);
});
if(this.checked) {
y = parseInt($(this).attr('id'));
id.push(y);
}
else {
y = parseInt($(this).attr('id'));
var index = id.indexOf(y);
id.splice(index,1);
}
// master checkbox for selecting all entries
$("input[id=mastercheckbox]").change(function() {
if($("input[id=mastercheckbox]").prop('checked') == true) {
selectedOption = $("#massaction-type").find(":selected").val();
if(id.length>0) {
$('.mass-action').css('display','');
$('.table-grid-header').css('display','none');
$('#indexes').val(id);
if(selectedOption == 0) {
$('#mass-action-form').attr('action', actions[0]);
} else if(selectedOption == 1) {
$('#mass-action-form').attr('action', actions[1]);
}
}else if(id.length == 0) {
$('.indexers').each(function() {
this.checked = true;
if(this.checked) {
y = parseInt($(this).attr('id'));
id.push(y);
}
});
$('.mass-action').css('display','none');
$('.table-grid-header').css('display','');
$('#indexes').val('');
$('.mass-action').css('display', '');
$('.table-grid-header').css('display', 'none');
$('#indexes').val(id);
} else if($("input[id=mastercheckbox]").prop('checked') == false) {
id = [];
$('#mass-action-form').attr('action', ''); //set no actions when no index is there
$('.indexers').each(function() { this.checked = false; });
$('.mass-action').css('display', 'none');
$('.table-grid-header').css('display', '');
$('#indexes').val('');
}
});
$('.massaction-remove').on('click', function() {
id = [];
$('#mass-action-form').attr('action', ''); //set no actions when no index is there
$('.mass-action').css('display', 'none');
if($('#mastercheckbox').prop('checked')) {
$('#mastercheckbox').prop('checked',false);
$('#mastercheckbox').prop('checked', false);
}
}
});
$("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) {
selectedOption = $("#massaction-type").find(":selected").val();
if(selectedOption == 0) {
$('#mass-action-form').attr('action', actions[0]);
} else if(selectedOption == 1) {
$('#mass-action-form').attr('action', actions[1]);
}
y = parseInt($(this).attr('id'));
id.push(y);
}
else {
y = parseInt($(this).attr('id'));
var index = id.indexOf(y);
id.splice(index, 1);
}
if (id.length > 0) {
$('.mass-action').css('display', '');
$('.table-grid-header').css('display', 'none');
$('#indexes').val(id);
} else if (id.length == 0) {
$('#mass-action-form').attr('action', ''); //set no actions when no index is there
$('.mass-action').css('display', 'none');
$('.table-grid-header').css('display', '');
$('#indexes').val('');
if ($('#mastercheckbox').prop('checked')) {
$('#mastercheckbox').prop('checked', false);
}
}
});
@endif
});
//make the url from the array and redirect
@ -246,25 +301,25 @@
if(allFilters.length>0 && repetition == false)
{
for(i=0;i<allFilters.length;i++) {
if(i==0){
if(i==0) {
url = '?' + allFilters[i].column + '[' + allFilters[i].cond + ']' + '=' + allFilters[i].val;
}
else
} else {
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 {
} else {
url = url + '&' + allFilters[i].column + '[' + allFilters[i].cond + ']' + '=' + allFilters[i].val;
}
}
document.location = url;
} else {
var uri = window.location.href.toString();
@ -276,8 +331,8 @@
//make the filter array from url after being redirected
function arrayFromUrl(urlstring) {
var obj={};
t = urlstring.slice(0,urlstring.length);
splitted = [];
moreSplitted = [];
@ -289,6 +344,7 @@
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;
@ -328,58 +384,51 @@
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">'+ 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="'+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);
}
}
}
//This is being used for validation of url params and making array of filters
function formURL(column, condition, response, urlparams,clabel) {
function formURL(column, condition, response, urlparams, clabel) {
/* validate the conditions here and do the replacements and
push here in the all filters array */
var obj1 = {};
console.log(allFilters.length);
if(column == "" || condition == "" || response == "") {
alert("Some of the required field is null, please check column, condition and value properly.");
// alert('Some of the required field is null, please check column, condition and value properly');
alert('{{ __('ui::app.datagrid.filter-fields-missing') }}');
return false;
}
else {
if(allFilters.length>0) {
} else {
if(allFilters.length > 0) {
//case for repeated filter
if(column != "sort" && column != "search") {
filter_repeated = 0;
for(j=0; j<allFilters.length; j++) {
if(allFilters[j].column == column && allFilters[j].cond == condition && allFilters[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) {
if(filter_repeated == 0) {
obj1.column = column;
obj1.cond = condition;
obj1.val = response;
@ -391,9 +440,10 @@
makeURL();
}
}
if(column == "sort") {
sort_exists = 0;
for(j=0;j<allFilters.length;j++) {
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) {
@ -405,8 +455,7 @@
makeURL();
}
else {
} else {
allFilters[j].column = column;
allFilters[j].cond = condition;
allFilters[j].val = "asc";
@ -414,8 +463,7 @@
makeURL();
}
}
else {
} else {
allFilters[j].column = column;
allFilters[j].cond = condition;
allFilters[j].val = response;
@ -426,22 +474,26 @@
}
}
}
if(column == "search") {
search_found = 0;
for(j=0;j<allFilters.length;j++) {
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<allFilters.length;j++) {
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;
@ -449,6 +501,7 @@
obj1.label = clabel;
allFilters.push(obj1);
obj1 = {};
makeURL();
}
}
@ -465,14 +518,14 @@
}
}
}
function confirm_click(message){
if (confirm(message)) {
//do the action required
return true;
} else {
return false;
}
}
</script>
@endpush
</div>

View File

@ -1,4 +1,8 @@
<div class="table">
{{-- @foreach($massoperations as $key => $value)
{{ $value['type'] }}
@endforeach
{{ dd($massoperations) }} --}}
<table class="{{ $css->table }}">
@include('ui::datagrid.table.head')
@include('ui::datagrid.table.body')

View File

@ -2,7 +2,7 @@
@if(count($results) == 0)
<tr>
<td colspan="{{ count($columns)+1 }}" style="text-align: center;">
No Records Found.
{{ __('ui::app.datagrid.no-records') }}
</td>
</tr>
@endif
@ -26,24 +26,24 @@
@endif
@endforeach
@if(count($actions))
<td class="action">
@foreach($actions as $action)
<a
href="{{ route($action['route'], $result->id) }}"
class="Action-{{ $action['type'] }}"
id="{{ $result->id }}"
@if(isset($action['confirm_text']))
onclick="return confirm_click('{{ $action['confirm_text'] }}');"
@endif
>
<i
@if(isset($action['icon-alt']))
title="{{ $action['icon-alt'] }}"
@endif
class="{{ $action['icon'] }}"></i>
</a>
@endforeach
</td>
<td class="action">
@foreach($actions as $action)
<a
href="{{ route($action['route'], $result->id) }}"
class="Action-{{ $action['type'] }}"
id="{{ $result->id }}"
@if(isset($action['confirm_text']))
onclick="return confirm_click('{{ $action['confirm_text'] }}');"
@endif
>
<i
@if(isset($action['icon-alt']))
title="{{ $action['icon-alt'] }}"
@endif
class="{{ $action['icon'] }}"></i>
</a>
@endforeach
</td>
@endif
</tr>
@endforeach

View File

@ -1,85 +1,52 @@
<thead>
@if(count($massoperations))
<tr class="mass-action" style="display: none; height:63px;">
<th colspan="{{ count($columns)+1 }}" style="width: 100%;">
<div class="mass-action-wrapper">
<span class="massaction-remove">
<span class="icon checkbox-dash-icon"></span>
</span>
@foreach($massoperations as $massoperation)
@if($massoperation['type'] == "button")
<form onsubmit="return confirm('Are You Sure?');"
@if(strtoupper($massoperation['method']) == "GET")
method="GET"
@else
method="POST"
@endif
action="{{ $massoperation['route'] }}">
{{ csrf_field() }}
@if(strtoupper($massoperation['method'])!= "GET" && strtoupper($massoperation['method'])!= "POST")
@method($massoperation['method'])
@endif
<input type="hidden" value="{{ $table }}" name="table_name">
<tr class="mass-action" style="display: none; height: 63px;">
<th colspan="10" style="width: 100%;">
<div class="mass-action-wrapper">
<span class="massaction-remove">
<span class="icon checkbox-dash-icon"></span>
</span>
<form method="POST" style="display: inline-flex;" id="mass-action-form">
@csrf()
<input type="hidden" id="indexes" name="indexes" value="">
<input class="btn btn-primary btn-sm" type="submit" value="Delete">
</form>
@elseif($massoperation['type'] == "select")
<form
@if(strtoupper($massoperation[ 'method'])=="GET" || strtoupper($massoperation[ 'method'])=="POST" )
method="{{ strtoupper($massoperation['method']) }}"
@else
method="POST"
@endif
action="{{ $massoperation['route'] }}">
{{ csrf_field() }}
@if(strtoupper($massoperation['method'])!= "GET" && strtoupper($massoperation['method'])!= "POST")
@method($massoperation['method'])
@endif
<input type="hidden" id="indexes" name="indexes" value="">
<select name="choices">
@foreach($massoperation['options'] as $option)
<option>{{ $option }}</option>
<div class="control-group">
<select class="control massaction-type" name="massaction-type" id="massaction-type">
@foreach($massoperations as $key => $massoperation)
<option @if($key == 0) selected @endif value="{{ $key }}">{{ $massoperation['type'] }}</option>
@endforeach
</select>
</div>
<input class="btn btn-primary btn-sm" type="submit" value="Submit">
</form>
@endif
@endforeach
</div>
</th>
</tr>
@foreach($massoperations as $key => $value)
@if($value['type'] == 'update')
<div class="control-group" style="display: none; margin-left: 10px;" id="update-options">
<select class="options control" name="update-options" id="option-type">
@foreach($value['options'] as $key => $value)
<option value="{{ $key }}" @if($key == 0) selected @endif>{{ $value }}</option>
@endforeach
</select>
<input type="hidden" name="selected-option-text" id="selected-option-text" value="">
</div>
@endif
@endforeach
<input type="submit" class="btn btn-sm btn-primary" style="margin-left: 10px;">
</form>
</div>
</th>
</tr>
@endif
<tr class="table-grid-header">
@if(count($massoperations))
<th>
<span class="checkbox">
<input type="checkbox" id="mastercheckbox">
<label class="checkbox-view" for="checkbox"></label>
</span>
</th>
<th>
<span class="checkbox">
<input type="checkbox" id="mastercheckbox">
<label class="checkbox-view" for="checkbox"></label>
</span>
</th>
@endif
@foreach ($columns as $column)
@if($column->sortable == "true")

View File

@ -22,4 +22,4 @@ mix.js(
if (mix.inProduction()) {
mix.version();
}
}

View File

@ -2,6 +2,11 @@
namespace Webkul\User\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Webkul\User\Http\Controllers\Controller;
use Hash;
/**
* Admin user account controller
*
@ -53,10 +58,17 @@ class AccountController extends Controller
$this->validate(request(), [
'name' => 'required',
'email' => 'email|unique:admins,email,' . $user->id,
'password' => 'nullable|confirmed'
'password' => 'nullable|min:6|confirmed',
'current_password' => 'required|min:6'
]);
$data = request()->all();
$data = request()->input();
if(!Hash::check($data['current_password'], auth()->guard('admin')->user()->password)) {
session()->flash('warning', 'Current password does not match.');
return redirect()->back();
}
if(!$data['password'])
unset($data['password']);

View File

@ -63,12 +63,21 @@ class SessionController extends Controller
]);
$remember = request('remember');
if (! auth()->guard('admin')->attempt(request(['email', 'password']), $remember)) {
if (!auth()->guard('admin')->attempt(request(['email', 'password']), $remember)) {
session()->flash('error', 'Please check your credentials and try again.');
return back();
}
if (auth()->guard('admin')->user()->status == 0) {
session()->flash('warning', 'Your account is yet to be activated, please contact administrator.');
auth()->guard('admin')->logout();
return redirect()->route('admin.session.create');
}
return redirect()->intended(route($this->_config['redirect']));
}

View File

@ -88,7 +88,7 @@ class UserController extends Controller
public function store(UserForm $request)
{
$data = request()->all();
if(isset($data['password']) && $data['password'])
$data['password'] = bcrypt($data['password']);
@ -125,11 +125,17 @@ class UserController extends Controller
{
$data = request()->all();
if(!$data['password'])
if (!$data['password'])
unset($data['password']);
else
$data['password'] = bcrypt($data['password']);
if (isset($data['status'])) {
$data['status'] = 1;
} else {
$data['status'] = 0;
}
$this->admin->update($data, $id);
session()->flash('success', 'User updated successfully.');

View File

@ -29,10 +29,11 @@ class UserForm extends FormRequest
'name' => 'required',
'email' => 'email|unique:admins,email',
'password' => 'nullable|confirmed',
'status' => 'sometimes',
'role_id' => 'required'
];
if($this->method() == 'PUT') {
if ($this->method() == 'PUT') {
$this->rules['email'] = 'email|unique:admins,email,' . $this->route('id');
}