From 13ae5d58c0ea3f9a15380e98fc6d481d47ea0770 Mon Sep 17 00:00:00 2001 From: jitendra Date: Tue, 23 Oct 2018 17:15:44 +0530 Subject: [PATCH] Dashboard completed --- app/Http/Kernel.php | 13 +- config/database.php | 2 +- .../Customer/CustomerController.php | 2 +- .../Http/Controllers/DashboardController.php | 273 +++++- packages/Webkul/Admin/src/Http/routes.php | 9 +- .../Admin/src/Mail/NewInvoiceNotification.php | 2 +- .../Admin/src/Mail/NewOrderNotification.php | 2 +- .../src/Mail/NewShipmentNotification.php | 2 +- .../Resources/assets/js/components/date.vue | 10 +- .../assets/js/components/datetime.vue | 41 +- .../Admin/src/Resources/assets/sass/app.scss | 417 ++++----- .../Admin/src/Resources/lang/en/app.php | 29 +- .../Resources/views/dashboard/index.blade.php | 835 +++++++++--------- .../views/layouts/anonymous-master.blade.php | 2 + packages/Webkul/Core/src/Core.php | 73 ++ .../Webkul/Core/src/Eloquent/Repository.php | 36 +- .../Webkul/Customer/src/Models/Customer.php | 4 +- .../Notifications/CustomerResetPassword.php | 7 +- .../Product/src/Models/ProductInventory.php | 22 +- .../Webkul/Sales/src/Models/OrderItem.php | 1 + packages/Webkul/Shop/src/Http/routes.php | 2 +- .../emails/admin/forget-password.blade.php | 34 + .../emails/customer/forget-password.blade.php | 34 + .../views/emails/layouts/master.blade.php | 0 .../views/emails/sales/new-invoice.blade.php | 0 .../views/emails/sales/new-order.blade.php | 0 .../views/emails/sales/new-shipment.blade.php | 0 .../Resources/assets/images/Icon-Calendar.svg | 16 + .../assets/images/Icon-Graph-Green.svg | 14 + .../assets/images/Icon-Graph-Red.svg | 14 + .../Resources/assets/images/Profile-Pic.svg | 15 + .../Resources/assets/images/limited-icon.svg | 39 + .../Ui/src/Resources/assets/sass/app.scss | 13 + .../Ui/src/Resources/assets/sass/icons.scss | 24 + .../src/Notifications/AdminResetPassword.php | 8 +- 35 files changed, 1228 insertions(+), 767 deletions(-) create mode 100644 packages/Webkul/Shop/src/Resources/views/emails/admin/forget-password.blade.php create mode 100644 packages/Webkul/Shop/src/Resources/views/emails/customer/forget-password.blade.php rename packages/Webkul/{Admin => Shop}/src/Resources/views/emails/layouts/master.blade.php (100%) rename packages/Webkul/{Admin => Shop}/src/Resources/views/emails/sales/new-invoice.blade.php (100%) rename packages/Webkul/{Admin => Shop}/src/Resources/views/emails/sales/new-order.blade.php (100%) rename packages/Webkul/{Admin => Shop}/src/Resources/views/emails/sales/new-shipment.blade.php (100%) create mode 100644 packages/Webkul/Ui/src/Resources/assets/images/Icon-Calendar.svg create mode 100644 packages/Webkul/Ui/src/Resources/assets/images/Icon-Graph-Green.svg create mode 100644 packages/Webkul/Ui/src/Resources/assets/images/Icon-Graph-Red.svg create mode 100644 packages/Webkul/Ui/src/Resources/assets/images/Profile-Pic.svg create mode 100644 packages/Webkul/Ui/src/Resources/assets/images/limited-icon.svg diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 05992519f..6ca0cbdf5 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -14,12 +14,10 @@ class Kernel extends HttpKernel * @var array */ protected $middleware = [ - \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class, - \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, - \App\Http\Middleware\TrimStrings::class, - \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, - \App\Http\Middleware\TrustProxies::class, - // \Illuminate\Session\Middleware\StartSession::class, + \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class, + \App\Http\Middleware\EncryptCookies::class, + \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, + \Illuminate\Session\Middleware\StartSession::class, ]; /** @@ -29,9 +27,6 @@ class Kernel extends HttpKernel */ protected $middlewareGroups = [ 'web' => [ - \App\Http\Middleware\EncryptCookies::class, - \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, - \Illuminate\Session\Middleware\StartSession::class, \Illuminate\Session\Middleware\AuthenticateSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class, \App\Http\Middleware\VerifyCsrfToken::class, diff --git a/config/database.php b/config/database.php index e486bd20d..71280b1b1 100644 --- a/config/database.php +++ b/config/database.php @@ -50,7 +50,7 @@ return [ 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', 'prefix' => '', - 'strict' => true, + 'strict' => false, 'engine' => 'InnoDB ROW_FORMAT=DYNAMIC', ], diff --git a/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerController.php b/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerController.php index 0fbe05caa..01aeac0ae 100644 --- a/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerController.php @@ -73,7 +73,7 @@ class CustomerController extends Controller { $customerGroup = $this->customerGroup->all(); - return view($this->_config['view'],compact('customerGroup')); + return view($this->_config['view'], compact('customerGroup')); } /** diff --git a/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php b/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php index 5bee6cde8..bee17a769 100644 --- a/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php @@ -5,6 +5,12 @@ namespace Webkul\Admin\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Http\Response; use Illuminate\Routing\Controller; +use Illuminate\Support\Facades\DB; +use Carbon\Carbon; +use Webkul\Sales\Repositories\OrderRepository as Order; +use Webkul\Sales\Repositories\OrderItemRepository as OrderItem; +use Webkul\Customer\Repositories\CustomerRepository as Customer; +use Webkul\Product\Repositories\ProductInventoryRepository as ProductInventory; /** * Dashboard controller @@ -21,14 +27,275 @@ class DashboardController extends Controller */ protected $_config; - public function __construct() + /** + * OrderRepository object + * + * @var array + */ + protected $order; + + /** + * OrderItemRepository object + * + * @var array + */ + protected $orderItem; + + /** + * CustomerRepository object + * + * @var array + */ + protected $customer; + + /** + * ProductInventoryRepository object + * + * @var array + */ + protected $productInventory; + + /** + * string object + * + * @var array + */ + protected $startDate; + + /** + * string object + * + * @var array + */ + protected $lastStartDate; + + /** + * string object + * + * @var array + */ + protected $endDate; + + /** + * string object + * + * @var array + */ + protected $lastEndDate; + + /** + * Create a new controller instance. + * + * @param Webkul\Sales\Repositories\OrderRepository $order + * @param Webkul\Sales\Repositories\OrderItemRepository $orderItem + * @param Webkul\Customer\Repositories\CustomerRepository $customer + * @param Webkul\Product\Repositories\ProductInventoryRepository $productInventory + * @return void + */ + public function __construct( + Order $order, + OrderItem $orderItem, + Customer $customer, + ProductInventory $productInventory + ) { $this->_config = request('_config'); $this->middleware('admin'); + + $this->order = $order; + + $this->orderItem = $orderItem; + + $this->customer = $customer; + + $this->productInventory = $productInventory; } + + public function getPercentageChange($previous, $current) + { + if(!$previous) + return $current ? 100 : 0; + + return ($current - $previous) / $previous * 100; + } + + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ public function index() { - return view('admin::dashboard.index'); + $this->setStartEndDate(); + + $statistics = [ + 'total_customers' => [ + 'previous' => $previous = $this->customer->scopeQuery(function($query) { + return $query->where('customers.created_at', '>=', $this->lastStartDate) + ->where('customers.created_at', '<=', $this->lastEndDate); + })->count(), + 'current' => $current = $this->customer->scopeQuery(function($query) { + return $query->where('customers.created_at', '>=', $this->startDate) + ->where('customers.created_at', '<=', $this->endDate); + })->count(), + 'progress' => $this->getPercentageChange($previous, $current) + ], + 'total_orders' => [ + 'previous' => $previous = $this->order->scopeQuery(function($query) { + return $query->where('orders.created_at', '>=', $this->lastStartDate) + ->where('orders.created_at', '<=', $this->lastEndDate); + })->count(), + 'current' => $current = $this->order->scopeQuery(function($query) { + return $query->where('orders.created_at', '>=', $this->startDate) + ->where('orders.created_at', '<=', $this->endDate); + })->count(), + 'progress' => $this->getPercentageChange($previous, $current) + ], + 'total_sales' => [ + 'previous' => $previous = $this->order->scopeQuery(function($query) { + return $query->where('orders.created_at', '>=', $this->lastStartDate) + ->where('orders.created_at', '<=', $this->lastEndDate); + })->sum('base_grand_total'), + 'current' => $current = $this->order->scopeQuery(function($query) { + return $query->where('orders.created_at', '>=', $this->startDate) + ->where('orders.created_at', '<=', $this->endDate); + })->sum('base_grand_total'), + 'progress' => $this->getPercentageChange($previous, $current) + ], + 'avg_sales' => [ + 'previous' => $previous = $this->order->scopeQuery(function($query) { + return $query->where('orders.created_at', '>=', $this->lastStartDate) + ->where('orders.created_at', '<=', $this->lastEndDate); + })->avg('base_grand_total'), + 'current' => $current = $this->order->scopeQuery(function($query) { + return $query->where('orders.created_at', '>=', $this->startDate) + ->where('orders.created_at', '<=', $this->endDate); + })->avg('base_grand_total'), + 'progress' => $this->getPercentageChange($previous, $current) + ], + 'top_selling_categories' => $this->getTopSellingCategories(), + 'top_selling_products' => $this->getTopSellingProducts(), + 'customer_with_most_sales' => $this->getCustomerWithMostSales(), + 'stock_threshold' => $this->getStockThreshold(), + ]; + + foreach (core()->getTimeInterval($this->startDate, $this->endDate) as $interval) { + $statistics['sale_graph']['label'][] = $interval['start']->format('d M'); + + $total = number_format($this->order->scopeQuery(function($query) use($interval) { + return $query->where('orders.created_at', '>=', $interval['start']) + ->where('orders.created_at', '<=', $interval['end']); + })->sum('base_grand_total'), 2); + + $statistics['sale_graph']['total'][] = $total; + $statistics['sale_graph']['formated_total'][] = core()->formatBasePrice($total); + } + + return view($this->_config['view'], compact('statistics'))->with(['startDate' => $this->startDate, 'endDate' => $this->endDate]); } -} + + /** + * Returns the list of top selling categories + * + * @return mixed + */ + public function getTopSellingCategories() + { + return $this->orderItem->getModel() + ->leftJoin('products', 'order_items.product_id', 'products.id') + ->leftJoin('product_categories', 'products.id', 'product_categories.product_id') + ->leftJoin('categories', 'product_categories.category_id', 'categories.id') + ->leftJoin('category_translations', 'categories.id', 'category_translations.category_id') + ->where('category_translations.locale', app()->getLocale()) + ->where('order_items.created_at', '>=', $this->startDate) + ->where('order_items.created_at', '<=', $this->endDate) + ->addSelect(DB::raw('SUM(qty_ordered) as total_qty_ordered')) + ->addSelect(DB::raw('COUNT(products.id) as total_products')) + ->addSelect('order_items.id', 'categories.id as category_id', 'category_translations.name') + ->groupBy('category_id') + ->orderBy('total_qty_ordered', 'DESC') + ->limit(5) + ->get(); + } + + /** + * Return stock threshold. + * + * @return mixed + */ + public function getStockThreshold() + { + return $this->productInventory->getModel() + ->leftJoin('products', 'product_inventories.product_id', 'products.id') + ->select(DB::raw('SUM(qty) as total_qty')) + ->addSelect('product_inventories.product_id') + ->where('products.type', '!=', 'configurable') + ->groupBy('product_id') + ->orderBy('total_qty', 'ASC') + ->limit(5) + ->get(); + } + + /** + * Returns top selling products + * @return mixed + */ + public function getTopSellingProducts() + { + return $this->orderItem->getModel() + ->select(DB::raw('SUM(qty_ordered) as total_qty_ordered')) + ->addSelect('id', 'product_id', 'product_type', 'name') + ->where('order_items.created_at', '>=', $this->startDate) + ->where('order_items.created_at', '<=', $this->endDate) + ->whereNull('parent_id') + ->groupBy('product_id') + ->orderBy('total_qty_ordered', 'DESC') + ->limit(5) + ->get(); + } + + /** + * Returns top selling products + * + * @return mixed + */ + public function getCustomerWithMostSales() + { + return $this->order->getModel() + ->select(DB::raw('SUM(base_grand_total) as total_base_grand_total')) + ->addSelect(DB::raw('COUNT(id) as total_orders')) + ->addSelect('id', 'customer_id', 'customer_email', 'customer_first_name', 'customer_last_name') + ->where('orders.created_at', '>=', $this->startDate) + ->where('orders.created_at', '<=', $this->endDate) + ->groupBy('customer_email') + ->orderBy('total_base_grand_total', 'DESC') + ->limit(5) + ->get(); + } + + /** + * Sets start and end date + * + * @return void + */ + public function setStartEndDate() + { + $this->startDate = request()->get('start') + ? Carbon::createFromTimeString(request()->get('start') . " 00:00:01") + : Carbon::createFromTimeString(Carbon::now()->subDays(30)->format('Y-m-d') . " 00:00:01"); + + $this->endDate = request()->get('end') + ? Carbon::createFromTimeString(request()->get('end') . " 23:59:59") + : Carbon::now(); + + if($this->endDate > Carbon::now()) + $this->endDate = Carbon::now(); + + $this->lastStartDate = clone $this->startDate; + $this->lastEndDate = clone $this->endDate; + + $this->lastStartDate->subDays($this->lastStartDate->diffInDays($this->lastEndDate)); + $this->lastEndDate->subDays($this->lastStartDate->diffInDays($this->lastEndDate)); + } +} \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Http/routes.php b/packages/Webkul/Admin/src/Http/routes.php index c3e8114de..f806753ac 100644 --- a/packages/Webkul/Admin/src/Http/routes.php +++ b/packages/Webkul/Admin/src/Http/routes.php @@ -37,17 +37,15 @@ Route::group(['middleware' => ['web']], function () { ])->name('admin.session.destroy'); // Dashboard Route - Route::get('dashboard', 'Webkul\Admin\Http\Controllers\DashboardController@index')->name('admin.dashboard.index'); + Route::get('dashboard', 'Webkul\Admin\Http\Controllers\DashboardController@index')->defaults('_config', [ + 'view' => 'admin::dashboard.index' + ])->name('admin.dashboard.index'); //Customers Management Routes Route::get('customers', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@index')->defaults('_config', [ 'view' => 'admin::customers.index' ])->name('admin.customer.index'); - Route::get('customers/orders', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@index')->defaults('_config',[ - 'view' => 'admin::customers.orders.index' - ])->name('admin.customer.orders.index'); - Route::get('customers/create', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@create')->defaults('_config',[ 'view' => 'admin::customers.create' ])->name('admin.customer.create'); @@ -448,7 +446,6 @@ Route::group(['middleware' => ['web']], function () { Route::put('/tax-categories/edit/{id}', 'Webkul\Tax\Http\Controllers\TaxCategoryController@update')->defaults('_config', [ 'redirect' => 'admin.tax-categories.index' ])->name('admin.tax-categories.update'); - //tax category ends diff --git a/packages/Webkul/Admin/src/Mail/NewInvoiceNotification.php b/packages/Webkul/Admin/src/Mail/NewInvoiceNotification.php index 9f760be4e..c1f2078ef 100644 --- a/packages/Webkul/Admin/src/Mail/NewInvoiceNotification.php +++ b/packages/Webkul/Admin/src/Mail/NewInvoiceNotification.php @@ -46,6 +46,6 @@ class NewInvoiceNotification extends Mailable return $this->to($order->customer_email, $order->customer_full_name) ->subject(trans('admin::app.mail.invoice.subject', ['order_id' => $order->id])) - ->view('admin::emails.sales.new-invoice'); + ->view('shop::emails.sales.new-invoice'); } } diff --git a/packages/Webkul/Admin/src/Mail/NewOrderNotification.php b/packages/Webkul/Admin/src/Mail/NewOrderNotification.php index 51940d1a8..daa5c7a2d 100644 --- a/packages/Webkul/Admin/src/Mail/NewOrderNotification.php +++ b/packages/Webkul/Admin/src/Mail/NewOrderNotification.php @@ -43,6 +43,6 @@ class NewOrderNotification extends Mailable { return $this->to($this->order->customer_email, $this->order->customer_full_name) ->subject(trans('admin::app.mail.order.subject')) - ->view('admin::emails.sales.new-order'); + ->view('shop::emails.sales.new-order'); } } diff --git a/packages/Webkul/Admin/src/Mail/NewShipmentNotification.php b/packages/Webkul/Admin/src/Mail/NewShipmentNotification.php index 5c8717581..34c89da2d 100644 --- a/packages/Webkul/Admin/src/Mail/NewShipmentNotification.php +++ b/packages/Webkul/Admin/src/Mail/NewShipmentNotification.php @@ -46,6 +46,6 @@ class NewShipmentNotification extends Mailable return $this->to($order->customer_email, $order->customer_full_name) ->subject(trans('admin::app.mail.shipment.subject', ['order_id' => $order->id])) - ->view('admin::emails.sales.new-shipment'); + ->view('shop::emails.sales.new-shipment'); } } diff --git a/packages/Webkul/Admin/src/Resources/assets/js/components/date.vue b/packages/Webkul/Admin/src/Resources/assets/js/components/date.vue index 36c254218..25924a3d7 100644 --- a/packages/Webkul/Admin/src/Resources/assets/js/components/date.vue +++ b/packages/Webkul/Admin/src/Resources/assets/js/components/date.vue @@ -22,12 +22,16 @@ }, mounted () { + var this_this = this; + var element = this.$el.getElementsByTagName('input')[0]; this.datepicker = new Flatpickr( element, { - allowInput: true, - altFormat: 'Y-m-d H:i:s', - dateFormat: 'Y-m-d H:i:s' + altFormat: 'Y-m-d', + dateFormat: 'Y-m-d', + onChange: function(selectedDates, dateStr, instance) { + this_this.$emit('onChange', dateStr) + }, }); } }; diff --git a/packages/Webkul/Admin/src/Resources/assets/js/components/datetime.vue b/packages/Webkul/Admin/src/Resources/assets/js/components/datetime.vue index 772f04d09..d4e3f8f99 100644 --- a/packages/Webkul/Admin/src/Resources/assets/js/components/datetime.vue +++ b/packages/Webkul/Admin/src/Resources/assets/js/components/datetime.vue @@ -10,25 +10,30 @@ import Flatpickr from "flatpickr"; export default { - props: { - name: String, - value: String - }, + props: { + name: String, + value: String + }, - data() { - return { - datepicker: null - }; - }, + data() { + return { + datepicker: null + }; + }, - mounted() { - var element = this.$el.getElementsByTagName("input")[0]; - this.datepicker = new Flatpickr(element, { - allowInput: true, - altFormat: "Y-m-d H:i:s", - dateFormat: "Y-m-d H:i:s", - enableTime: true - }); - } + mounted() { + var this_this = this; + + var element = this.$el.getElementsByTagName("input")[0]; + this.datepicker = new Flatpickr(element, { + allowInput: true, + altFormat: "Y-m-d H:i:s", + dateFormat: "Y-m-d H:i:s", + enableTime: true, + onChange: function(selectedDates, dateStr, instance) { + this_this.$emit('onChange', dateStr) + }, + }); + } }; \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/assets/sass/app.scss b/packages/Webkul/Admin/src/Resources/assets/sass/app.scss index 43653f4a7..50054105a 100644 --- a/packages/Webkul/Admin/src/Resources/assets/sass/app.scss +++ b/packages/Webkul/Admin/src/Resources/assets/sass/app.scss @@ -258,273 +258,174 @@ body { // admin dashboard css -.dashboard-content { +.dashboard { - .dashboard-stats { - display: flex; - + .page-header { + margin-bottom: 0 !important; + padding-bottom: 15px; + border-bottom: 1px solid $border-color; } - .graph-category { - display: flex; - margin-top: 25px; + .page-content { + margin-top: 15px; + } + + .card { + height: 445px; + background: #FFFFFF; + border: 1px solid #E7E7E7; + box-shadow: 0 5px 10px 2px rgba(0,0,0,0.08); + border-radius: 2px; + padding: 20px 0px 0px 20px; + + .card-title { + font-size: 14px; + color: #A2A2A2; + letter-spacing: -0.26px; + text-transform: uppercase; + } + + .card-info { + width: 100%; + height: 100%; + display: inline-block; + + &.center { + text-align: center; + } + + ul { + li { + border-bottom: 1px solid $border-color; + width: 100%; + display: inline-block; + padding: 10px 0; + position: relative; + + .image { + height: 60px; + width: 60px; + float: left; + margin-right: 15px; + + &.product { + background: #F2F2F2; + } + + img { + width: 100%; + } + } + + .description { + margin-top: 10px; + + .name { + color: #0041FF; + } + + .info { + color: #3A3A3A; + margin-top: 5px; + } + } + + .icon.angle-right-icon { + position: absolute; + right: 30px; + top: 50%; + margin-top: -8px; + } + + &:last-child { + border-bottom: 0; + } + } + } + + .no-result-found { + margin-top: 146px; + + p { + margin: 0; + color: #A2A2A2; + } + } + } + } + + .dashboard-stats { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); + grid-auto-rows: auto; + grid-column-gap: 30px; + grid-row-gap: 15px; + + .dashboard-card { + height: 100px; + background: #FFFFFF; + border: 1px solid #E7E7E7; + box-shadow: 0 5px 10px 2px rgba(0,0,0,0.08); + border-radius: 5px; + position: relative; + padding: 15px; + + + .title { + font-size: 14px; + color: #A2A2A2; + text-transform: uppercase; + } + + .data { + padding-top: 3px; + font-size: 32px; + color: #0041FF; + + .progress { + font-size: 14px; + color: #8E8E8E; + float: right; + margin-top: 9px; + + .icon { + vertical-align: middle; + } + } + } + } + } + + .graph-stats { + margin-top: 30px; + width: 100%; + display: inline-block; + + .left-card-container { + float: left; + width: 75%; + padding-right: 9px; + } + + .right-card-container { + float: left; + width: 25%; + padding-left: 21px; + } } .sale-stock { - display: flex; - margin-top: 25px; + width: 100%; + display: inline-block; + display: grid; + grid-template-columns: repeat(auto-fill, minmax(435px, 1fr)); + grid-auto-rows: auto; + grid-column-gap: 30px; + grid-row-gap: 15px; + margin-top: 30px; } - } - // admin dashboard css ends here - - -// admin dashboard component -.dashboard-card { - height: 100px; - width: 22%; - background: #FFFFFF; - border: 1px solid #E7E7E7; - box-shadow: 0 5px 10px 2px rgba(0,0,0,0.08); - border-radius: 5px; - - .visitor-content { - padding: 15px; - - .title { - - span { - padding-top:10px; - font-size: 14px; - color: #A2A2A2; - letter-spacing: -0.26px; - } - } - - .data { - padding-top: 3px; - - span { - font-size: 32px; - color: #0041FF; - letter-spacing: -0.6px; - - img { - margin-left: 75px; - height: 24px; - width:24px; - } - } - - span.right { - padding-top: 12px; - float: right; - font-size: 14px; - color: #8E8E8E; - letter-spacing: -0.7px; - } - } - } -} - -.dashboard-card:nth-last-child(1) { - margin-left: 30px; -} - -.dashboard-card:nth-last-child(2) { - margin-left: 30px; -} - -.dashboard-card:nth-last-child(3) { - margin-left: 30px; -} - - -.dashboard-graph { - height: 413px; - width: 70.5%; - background: #FFFFFF; - border: 1px solid #E7E7E7; - box-shadow: 0 5px 10px 2px rgba(0,0,0,0.08); - border-radius: 2px; -} - -.sale { - height: 465px; - width: 30.1%; - background: #FFFFFF; - border: 1px solid #E7E7E7; - box-shadow: 0 5px 10px 2px rgba(0,0,0,0.08); - border-radius: 2px; - - .top-sale { - margin-left: 20px; - margin-top: 27px; - - .title { - - span { - font-size: 14px; - color: #A2A2A2; - letter-spacing: -0.26px; - } - } - - .sale-info { - - ul { - - li { - - .pro-attribute{ - display: flex; - margin-top: 10px; - - .pro-img { - height: 60px; - width: 60px; - border: 1px solid green; - } - - .product-description { - margin-left: 15px; - margin-top: 8px; - width: 75%; - - .product-name { - - span { - font-size: 14px; - color: #0041FF; - letter-spacing: -0.26px; - } - - .right-side { - float: right; - margin-top: 10px; - height: 20px; - width: 20px; - } - } - - .product-info { - - span { - font-size: 14px; - color: #3A3A3A; - letter-spacing: -0.26px; - } - } - } - } - - .horizontal-rule { - border: .5px solid #A2A2A2; - opacity: 0.2; - margin-top: 10px; - } - } - - li:last-child { - .horizontal-rule { - display: none; - } - } - } - } - } -} - -.sale:nth-last-child(1) { - margin-left: 31px; -} - -.sale:nth-last-child(2) { - margin-left: 31px; -} -// admin dashboard css ends here - -.performing-category { - height: 413px; - width: 22%; - margin-left: 30px; - background: #FFFFFF; - border: 1px solid #E7E7E7; - box-shadow: 0 5px 10px 2px rgba(0,0,0,0.08); - border-radius: 2px; - - .category { - margin-left: 20px; - margin-top: 20px; - - .title { - - span { - font-size: 14px; - color: #A2A2A2; - letter-spacing: -0.26px; - } - } - - .category-info { - margin-top: 30px; - - - ul { - - li { - - .category-list { - margin-top: 10px; - - .cat-name { - - span { - font-size: 16px; - color: #0041FF; - letter-spacing: -0.3px; - - } - - .right-side { - float: right; - margin-right: 12px; - margin-top: 10px; - height: 20px; - width: 20px; - } - } - - .product-info { - margin-top: 5px; - - span { - font-size: 16px; - color: #3A3A3A; - letter-spacing: -0.3px; - } - } - - .horizon-rule { - margin-top: 8px; - border: .7px solid #D8D8D8; - } - } - } - - li:last-child { - - .category-list { - .horizon-rule { - display: none; - } - } - } - } - } - } -} // customer oder css for admin start here .sale-container { diff --git a/packages/Webkul/Admin/src/Resources/lang/en/app.php b/packages/Webkul/Admin/src/Resources/lang/en/app.php index 5e4fd888e..41b26ad75 100644 --- a/packages/Webkul/Admin/src/Resources/lang/en/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/en/app.php @@ -7,7 +7,25 @@ return [ 'state' => 'State' ], 'dashboard' => [ - 'title' => 'Dashboard' + 'title' => 'Dashboard', + 'from' => 'From', + 'to' => 'To', + 'total-customers' => 'Total Customers', + 'total-orders' => 'Total Orders', + 'total-sale' => 'Total Sale', + 'average-sale' => 'Average Order Sale', + 'increased' => ':progress% Increased', + 'decreased' => ':progress% Decreased', + 'sales' => 'Sales', + 'top-performing-categories' => 'Top Performing Categories', + 'product-count' => ':count Products', + 'top-selling-products' => 'Top Selling Products', + 'sale-count' => ':count Sales', + 'customer-with-most-sales' => 'Customer With Most Sales', + 'order-count' => ':count Orders', + 'revenue' => 'Revenue :total', + 'stock-threshold' => 'Stock Threshold', + 'qty-left' => ':qty Left', ], 'account' => [ 'title' => 'My Account', @@ -32,6 +50,8 @@ return [ 'title' => 'Reset Password', 'title' => 'Reset Password', 'email' => 'Registered Email', + 'password' => 'Password', + 'confirm-password' => 'Confirm Password', 'back-link-title' => 'Back to Sign In', 'submit-btn-title' => 'Reset Password' ], @@ -457,6 +477,13 @@ return [ 'summary' => 'Summary of Shipment', 'carrier' => 'Carrier', 'tracking-number' => 'Tracking Number' + ], + 'forget-password' => [ + 'dear' => 'Dear :name', + 'info' => 'You are receiving this email because we received a password reset request for your account.', + 'reset-password' => 'Reset Password', + 'final-summary' => 'If you did not request a password reset, no further action is required.', + 'thanks' => 'Thanks!' ] ] ]; \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/dashboard/index.blade.php b/packages/Webkul/Admin/src/Resources/views/dashboard/index.blade.php index 59ae4e5ba..60be3a496 100644 --- a/packages/Webkul/Admin/src/Resources/views/dashboard/index.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/dashboard/index.blade.php @@ -5,497 +5,452 @@ @stop @section('content-wrapper') -
-

Dashboard

- -
+ +
+ + +
-
-
- NEW VISITORS -
-
- 450 - - - - - 12.5% Increased - -
+
+ {{ __('admin::app.dashboard.total-customers') }} +
+ +
+ {{ $statistics['total_customers']['current'] }} + + + @if ($statistics['total_customers']['progress'] < 0) + + {{ __('admin::app.dashboard.decreased', [ + 'progress' => -number_format($statistics['total_customers']['progress'], 1) + ]) + }} + @else + + {{ __('admin::app.dashboard.increased', [ + 'progress' => number_format($statistics['total_customers']['progress'], 1) + ]) + }} + @endif +
-
-
- NEW VISITORS -
-
- 450 - - - - - 12.5% Increased - -
+
+ {{ __('admin::app.dashboard.total-orders') }} +
+ +
+ {{ $statistics['total_orders']['current'] }} + + + @if ($statistics['total_orders']['progress'] < 0) + + {{ __('admin::app.dashboard.decreased', [ + 'progress' => -number_format($statistics['total_orders']['progress'], 1) + ]) + }} + @else + + {{ __('admin::app.dashboard.increased', [ + 'progress' => number_format($statistics['total_orders']['progress'], 1) + ]) + }} + @endif +
-
-
- NEW VISITORS -
-
- 450 - - - - - 12.5% Increased - -
+
+ {{ __('admin::app.dashboard.total-sale') }} +
+ +
+ {{ core()->formatBasePrice($statistics['total_sales']['current']) }} + + + @if ($statistics['total_sales']['progress'] < 0) + + {{ __('admin::app.dashboard.decreased', [ + 'progress' => -number_format($statistics['total_sales']['progress'], 1) + ]) + }} + @else + + {{ __('admin::app.dashboard.increased', [ + 'progress' => number_format($statistics['total_sales']['progress'], 1) + ]) + }} + @endif +
-
-
- NEW VISITORS -
-
- 450 - - - - - 12.5% Increased - -
+
+ {{ __('admin::app.dashboard.average-sale') }} +
+ +
+ {{ core()->formatBasePrice($statistics['avg_sales']['current']) }} + + + @if ($statistics['avg_sales']['progress'] < 0) + + {{ __('admin::app.dashboard.decreased', [ + 'progress' => -number_format($statistics['avg_sales']['progress'], 1) + ]) + }} + @else + + {{ __('admin::app.dashboard.increased', [ + 'progress' => number_format($statistics['avg_sales']['progress'], 1) + ]) + }} + @endif +
- - - -
-
-
-
+
-
-
-
- TOP PERFORMING CATEGORIES +
+
+
+ {{ __('admin::app.dashboard.sales') }}
-
- -
    +
    -
  • -
    -
    - Men - -
    -
    - 250 Products . 290 Sales -
    -
    -
    -
    -
  • - -
  • -
    -
    - Women - -
    -
    - 375 Products . 350 Sales -
    -
    -
    -
    -
  • - -
  • -
    -
    - Electronics - -
    -
    - 200 Products . 214 Sales -
    -
    -
    -
    -
  • - -
  • -
    -
    - Accessories - -
    -
    - 180 Products . 180 Sales -
    -
    -
    -
    -
  • -
+ +
+ +
+
+
+ {{ __('admin::app.dashboard.top-performing-categories') }} +
+ +
+ + + @if (!count($statistics['top_selling_categories'])) + +
+ + +

{{ __('admin::app.common.no-result-found') }}

+ +
+ + @endif +
+
+
+
+ @inject ('productImageHelper', 'Webkul\Product\Helpers\ProductImage') +
-
-
-
- TOP SELLING PRODUCTS -
+
+
+ {{ __('admin::app.dashboard.top-selling-products') }} +
-
- + + @if (!count($statistics['top_selling_products'])) + +
+ + +

{{ __('admin::app.common.no-result-found') }}

+ +
+ + @endif
-
-
-
- CUSTOMERS WITH MOST SALES -
- -
-
    -
  • -
    -
    - -
    -
    -
    - Emma Wagner - -
    -
    - 24 Orders . Revenue $450.00 -
    -
    -
    -
    -
    -
  • - -
  • -
    -
    - -
    -
    -
    - Emma Wagner - -
    -
    - 24 Orders . Revenue $450.00 -
    -
    -
    -
    -
    -
  • - -
  • -
    -
    - -
    -
    -
    - Emma Wagner - -
    -
    - 24 Orders . Revenue $450.00 -
    -
    -
    -
    -
    -
  • - -
  • -
    -
    - -
    -
    -
    - Emma Wagner - -
    -
    - 24 Orders . Revenue $450.00 -
    -
    - -
    -
    -
    -
  • - -
  • -
    -
    - -
    -
    -
    - Emma Wagner - -
    -
    - 24 Orders . Revenue $450.00 -
    -
    - -
    -
    -
    -
  • -
-
+
+
+ {{ __('admin::app.dashboard.customer-with-most-sales') }}
+ +
+ + + @if (!count($statistics['customer_with_most_sales'])) + +
+ + +

{{ __('admin::app.common.no-result-found') }}

+ +
+ + @endif +
+
-
-
-
- TOP SELLING PRODUCTS -
- -
-
    -
  • -
    -
    - -
    -
    -
    - Men's Olive Denim Jacket - -
    -
    - 7 left -
    -
    -
    -
    -
    -
  • - -
  • -
    -
    - -
    -
    -
    - Apple iPhone 8 Plus - 64GB - - -
    -
    - 250 Sales . In Stock - 500 -
    -
    -
    -
    -
    -
  • - -
  • -
    -
    - -
    -
    -
    - Long Lenngth Printed Shrug - -
    -
    - 250 Products . In Stock - 500 -
    -
    - -
    -
    -
    -
  • - -
  • -
    -
    - -
    -
    -
    - Black Round Neck T-Shirt for Men - - -
    -
    - 250 Products . In Stock - 500 -
    -
    - -
    -
    -
    -
  • - -
  • -
    -
    - -
    -
    -
    - Men's Linnen Shirt -Regular Fit - -
    -
    - 250 Products . In Stock - 500 -
    -
    - -
    -
    -
    -
  • -
-
+
+
+ {{ __('admin::app.dashboard.stock-threshold') }}
+ +
+ + + @if (!count($statistics['stock_threshold'])) + +
+ + +

{{ __('admin::app.common.no-result-found') }}

+ +
+ + @endif +
+
- - -
- - @stop + +@push('scripts') + + + + + + + +@endpush \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/layouts/anonymous-master.blade.php b/packages/Webkul/Admin/src/Resources/views/layouts/anonymous-master.blade.php index 07e0c7e52..9fef717d7 100644 --- a/packages/Webkul/Admin/src/Resources/views/layouts/anonymous-master.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/layouts/anonymous-master.blade.php @@ -7,6 +7,8 @@ + + diff --git a/packages/Webkul/Core/src/Core.php b/packages/Webkul/Core/src/Core.php index 26126db19..e4e0b21cb 100644 --- a/packages/Webkul/Core/src/Core.php +++ b/packages/Webkul/Core/src/Core.php @@ -512,4 +512,77 @@ class Core return $collection; } + + /** + * Returns time intervals + * + * @return array + */ + public function getTimeInterval($startDate, $endDate) { + $timeIntervals = []; + + $totalDays = $startDate->diffInDays($endDate); + $totalMonths = $startDate->diffInMonths($endDate); + + $startWeekDay = Carbon::createFromTimeString($this->xWeekRange($startDate, 0) . ' 00:00:01'); + $endWeekDay = Carbon::createFromTimeString($this->xWeekRange($endDate, 1) . ' 23:59:59'); + $totalWeeks = $startWeekDay->diffInWeeks($endWeekDay); + + if($totalMonths > 5) { + for ($i = 0; $i < $totalMonths; $i++) { + $date = clone $startDate; + $date->addMonths($i); + + $start = Carbon::createFromTimeString($date->format('Y-m-d') . ' 00:00:01'); + $end = $totalMonths - 1 == $i + ? $endDate + : Carbon::createFromTimeString($date->format('Y-m-d') . ' 23:59:59'); + + $timeIntervals[] = ['start' => $start, 'end' => $end, 'formatedDate' => $date->format('M')]; + } + } elseif($totalWeeks > 6) { + for ($i = 0; $i < $totalWeeks; $i++) { + $date = clone $startDate; + $date->addWeeks($i); + + $start = $i == 0 + ? $startDate + : Carbon::createFromTimeString($this->xWeekRange($date, 0) . ' 00:00:01'); + $end = $totalWeeks - 1 == $i + ? $endDate + : Carbon::createFromTimeString($this->xWeekRange($date, 1) . ' 23:59:59'); + + $timeIntervals[] = ['start' => $start, 'end' => $end, 'formatedDate' => $date->format('d M')]; + } + } else { + for ($i = 0; $i < $totalDays; $i++) { + $date = clone $startDate; + $date->addDays($i); + + $start = Carbon::createFromTimeString($date->format('Y-m-d') . ' 00:00:01'); + $end = Carbon::createFromTimeString($date->format('Y-m-d') . ' 23:59:59'); + + $timeIntervals[] = ['start' => $start, 'end' => $end, 'formatedDate' => $date->format('d M')]; + } + } + + return $timeIntervals; + } + + /** + * @return string + */ + public function xWeekRange($date, $day) { + $ts = strtotime($date); + + if(!$day) { + $start = (date('D', $ts) == 'Sun') ? $ts : strtotime('last sunday', $ts); + + return date('Y-m-d', $start); + } else { + $end = (date('D', $ts) == 'Sat') ? $ts : strtotime('next saturday', $ts); + + return date('Y-m-d', $end); + } + } } \ No newline at end of file diff --git a/packages/Webkul/Core/src/Eloquent/Repository.php b/packages/Webkul/Core/src/Eloquent/Repository.php index 07d2d7401..30add72fa 100644 --- a/packages/Webkul/Core/src/Eloquent/Repository.php +++ b/packages/Webkul/Core/src/Eloquent/Repository.php @@ -87,7 +87,41 @@ abstract class Repository extends BaseRepository { */ public function count() { - return $this->model->count(); + $this->applyCriteria(); + $this->applyScope(); + + $total = $this->model->count(); + $this->resetModel(); + + return $total; + } + + /** + * @return mixed + */ + public function sum($columns) + { + $this->applyCriteria(); + $this->applyScope(); + + $sum = $this->model->sum($columns); + $this->resetModel(); + + return $sum; + } + + /** + * @return mixed + */ + public function avg($columns) + { + $this->applyCriteria(); + $this->applyScope(); + + $avg = $this->model->avg($columns); + $this->resetModel(); + + return $avg; } /** diff --git a/packages/Webkul/Customer/src/Models/Customer.php b/packages/Webkul/Customer/src/Models/Customer.php index bb6589d57..5f9676bbb 100644 --- a/packages/Webkul/Customer/src/Models/Customer.php +++ b/packages/Webkul/Customer/src/Models/Customer.php @@ -18,9 +18,9 @@ class Customer extends Authenticatable protected $table = 'customers'; - protected $fillable = ['first_name', 'last_name', 'gender', 'date_of_birth','phone','email','password','customer_group_id','subscribed_to_news_letter']; + protected $fillable = ['first_name', 'last_name', 'gender', 'date_of_birth', 'phone', 'email', 'password', 'customer_group_id', 'subscribed_to_news_letter']; - protected $hidden = ['password','remember_token']; + protected $hidden = ['password', 'remember_token']; protected $with = ['customerGroup']; diff --git a/packages/Webkul/Customer/src/Notifications/CustomerResetPassword.php b/packages/Webkul/Customer/src/Notifications/CustomerResetPassword.php index 3c1517058..9db9e27ae 100644 --- a/packages/Webkul/Customer/src/Notifications/CustomerResetPassword.php +++ b/packages/Webkul/Customer/src/Notifications/CustomerResetPassword.php @@ -21,8 +21,9 @@ class CustomerResetPassword extends ResetPassword } return (new MailMessage) - ->line('You are receiving this email because we received a password reset request for your account.') - ->action('Reset Password', route('customer.reset-password.create', $this->token)) - ->line('If you did not request a password reset, no further action is required.'); + ->view('shop::emails.customer.forget-password')->with([ + 'user_name' => $notifiable->name, + 'token' => $this->token + ]); } } diff --git a/packages/Webkul/Product/src/Models/ProductInventory.php b/packages/Webkul/Product/src/Models/ProductInventory.php index 1bf30ebca..f76ba89a5 100644 --- a/packages/Webkul/Product/src/Models/ProductInventory.php +++ b/packages/Webkul/Product/src/Models/ProductInventory.php @@ -10,19 +10,7 @@ class ProductInventory extends Model public $timestamps = false; protected $fillable = ['qty', 'product_id', 'inventory_source_id']; - - /** - * Use by cart for - * checking the - * inventory source - * status - * - * @return Collection - */ - // public function checkInventoryStatus() { - // return $this->leftjoin('inventory_sources', 'inventory_sources.id', 'inventory_source_id')->select('status')->where('status', '=','1'); - // } - + /** * Get the product attribute family that owns the product. */ @@ -30,4 +18,12 @@ class ProductInventory extends Model { return $this->belongsTo(InventorySource::class); } + + /** + * Get the product that owns the product inventory. + */ + public function product() + { + return $this->belongsTo(Product::class); + } } \ No newline at end of file diff --git a/packages/Webkul/Sales/src/Models/OrderItem.php b/packages/Webkul/Sales/src/Models/OrderItem.php index 08ad131cb..ee4ca55b2 100644 --- a/packages/Webkul/Sales/src/Models/OrderItem.php +++ b/packages/Webkul/Sales/src/Models/OrderItem.php @@ -4,6 +4,7 @@ namespace Webkul\Sales\Models; use Illuminate\Database\Eloquent\Model; use Webkul\Sales\Contracts\OrderItem as OrderItemContract; +use Webkul\Product\Models\Product; class OrderItem extends Model implements OrderItemContract { diff --git a/packages/Webkul/Shop/src/Http/routes.php b/packages/Webkul/Shop/src/Http/routes.php index 2cdafeb71..5ee8b6e4d 100644 --- a/packages/Webkul/Shop/src/Http/routes.php +++ b/packages/Webkul/Shop/src/Http/routes.php @@ -80,7 +80,7 @@ Route::group(['middleware' => ['web', 'theme', 'locale', 'currency']], function //Reset Password create Route::get('/reset-password/{token}', 'Webkul\Customer\Http\Controllers\ResetPasswordController@create')->defaults('_config', [ 'view' => 'shop::customers.signup.reset-password' - ])->name('password.reset'); + ])->name('customer.reset-password.create'); Route::post('/reset-password', 'Webkul\Customer\Http\Controllers\ResetPasswordController@store')->defaults('_config', [ 'redirect' => 'customer.session.index' diff --git a/packages/Webkul/Shop/src/Resources/views/emails/admin/forget-password.blade.php b/packages/Webkul/Shop/src/Resources/views/emails/admin/forget-password.blade.php new file mode 100644 index 000000000..c49b5d23b --- /dev/null +++ b/packages/Webkul/Shop/src/Resources/views/emails/admin/forget-password.blade.php @@ -0,0 +1,34 @@ +@component('admin::emails.layouts.master') +
+ + + +
+ +
+
+

+ {{ __('admin::app.mail.forget-password.dear', ['name' => $user_name]) }}, +

+ +

+ {{ __('admin::app.mail.forget-password.info') }} +

+ +

+ + {{ __('admin::app.mail.forget-password.reset-password') }} + +

+ +

+ {{ __('admin::app.mail.forget-password.final-summary') }} +

+ +

+ {{ __('admin::app.mail.forget-password.thanks') }} +

+ +
+
+@endcomponent \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/emails/customer/forget-password.blade.php b/packages/Webkul/Shop/src/Resources/views/emails/customer/forget-password.blade.php new file mode 100644 index 000000000..df29b6c93 --- /dev/null +++ b/packages/Webkul/Shop/src/Resources/views/emails/customer/forget-password.blade.php @@ -0,0 +1,34 @@ +@component('admin::emails.layouts.master') +
+ + + +
+ +
+
+

+ {{ __('admin::app.mail.forget-password.dear', ['name' => $user_name]) }}, +

+ +

+ {{ __('admin::app.mail.forget-password.info') }} +

+ +

+ + {{ __('admin::app.mail.forget-password.reset-password') }} + +

+ +

+ {{ __('admin::app.mail.forget-password.final-summary') }} +

+ +

+ {{ __('admin::app.mail.forget-password.thanks') }} +

+ +
+
+@endcomponent \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/emails/layouts/master.blade.php b/packages/Webkul/Shop/src/Resources/views/emails/layouts/master.blade.php similarity index 100% rename from packages/Webkul/Admin/src/Resources/views/emails/layouts/master.blade.php rename to packages/Webkul/Shop/src/Resources/views/emails/layouts/master.blade.php diff --git a/packages/Webkul/Admin/src/Resources/views/emails/sales/new-invoice.blade.php b/packages/Webkul/Shop/src/Resources/views/emails/sales/new-invoice.blade.php similarity index 100% rename from packages/Webkul/Admin/src/Resources/views/emails/sales/new-invoice.blade.php rename to packages/Webkul/Shop/src/Resources/views/emails/sales/new-invoice.blade.php diff --git a/packages/Webkul/Admin/src/Resources/views/emails/sales/new-order.blade.php b/packages/Webkul/Shop/src/Resources/views/emails/sales/new-order.blade.php similarity index 100% rename from packages/Webkul/Admin/src/Resources/views/emails/sales/new-order.blade.php rename to packages/Webkul/Shop/src/Resources/views/emails/sales/new-order.blade.php diff --git a/packages/Webkul/Admin/src/Resources/views/emails/sales/new-shipment.blade.php b/packages/Webkul/Shop/src/Resources/views/emails/sales/new-shipment.blade.php similarity index 100% rename from packages/Webkul/Admin/src/Resources/views/emails/sales/new-shipment.blade.php rename to packages/Webkul/Shop/src/Resources/views/emails/sales/new-shipment.blade.php diff --git a/packages/Webkul/Ui/src/Resources/assets/images/Icon-Calendar.svg b/packages/Webkul/Ui/src/Resources/assets/images/Icon-Calendar.svg new file mode 100644 index 000000000..1d5ab01f3 --- /dev/null +++ b/packages/Webkul/Ui/src/Resources/assets/images/Icon-Calendar.svg @@ -0,0 +1,16 @@ + + + + Icon-Calendar + Created with Sketch. + + + + + + + + + + + \ No newline at end of file diff --git a/packages/Webkul/Ui/src/Resources/assets/images/Icon-Graph-Green.svg b/packages/Webkul/Ui/src/Resources/assets/images/Icon-Graph-Green.svg new file mode 100644 index 000000000..ba589b67d --- /dev/null +++ b/packages/Webkul/Ui/src/Resources/assets/images/Icon-Graph-Green.svg @@ -0,0 +1,14 @@ + + + + Icon-Graph-Green + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/packages/Webkul/Ui/src/Resources/assets/images/Icon-Graph-Red.svg b/packages/Webkul/Ui/src/Resources/assets/images/Icon-Graph-Red.svg new file mode 100644 index 000000000..5458a660f --- /dev/null +++ b/packages/Webkul/Ui/src/Resources/assets/images/Icon-Graph-Red.svg @@ -0,0 +1,14 @@ + + + + Icon-Graph-Red + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/packages/Webkul/Ui/src/Resources/assets/images/Profile-Pic.svg b/packages/Webkul/Ui/src/Resources/assets/images/Profile-Pic.svg new file mode 100644 index 000000000..737ae019a --- /dev/null +++ b/packages/Webkul/Ui/src/Resources/assets/images/Profile-Pic.svg @@ -0,0 +1,15 @@ + + + + Profile-Pic + Created with Sketch. + + + + + + + + + + \ No newline at end of file diff --git a/packages/Webkul/Ui/src/Resources/assets/images/limited-icon.svg b/packages/Webkul/Ui/src/Resources/assets/images/limited-icon.svg new file mode 100644 index 000000000..f58960031 --- /dev/null +++ b/packages/Webkul/Ui/src/Resources/assets/images/limited-icon.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/Webkul/Ui/src/Resources/assets/sass/app.scss b/packages/Webkul/Ui/src/Resources/assets/sass/app.scss index b29b258c2..32ec03dbd 100644 --- a/packages/Webkul/Ui/src/Resources/assets/sass/app.scss +++ b/packages/Webkul/Ui/src/Resources/assets/sass/app.scss @@ -462,6 +462,19 @@ h2 { } } + &.date, &.datetime { + &::after { + background-image: url("../images/Icon-Calendar.svg"); + width: 24px; + height: 24px; + content: ''; + display: inline-block; + vertical-align: middle; + margin-left: -34px; + margin-top: 2px; + } + } + .control-info { display: block; font-style: italic; diff --git a/packages/Webkul/Ui/src/Resources/assets/sass/icons.scss b/packages/Webkul/Ui/src/Resources/assets/sass/icons.scss index ae5feb753..16bce6270 100644 --- a/packages/Webkul/Ui/src/Resources/assets/sass/icons.scss +++ b/packages/Webkul/Ui/src/Resources/assets/sass/icons.scss @@ -190,6 +190,30 @@ height: 13px; } +.profile-pic-icon { + background-image: url("../images/Profile-Pic.svg"); + width: 60px; + height: 60px; +} + +.graph-up-icon { + background-image: url("../images/Icon-Graph-Green.svg"); + width: 24px; + height: 24px; +} + +.graph-down-icon { + background-image: url("../images/Icon-Graph-Red.svg"); + width: 24px; + height: 24px; +} + +.no-result-icon { + background-image: url("../images/limited-icon.svg"); + width: 52px; + height: 47px; +} + .active { .dashboard-icon { background-image: url("../images/Icon-Dashboard-Active.svg"); diff --git a/packages/Webkul/User/src/Notifications/AdminResetPassword.php b/packages/Webkul/User/src/Notifications/AdminResetPassword.php index cd359c198..38fdf556b 100644 --- a/packages/Webkul/User/src/Notifications/AdminResetPassword.php +++ b/packages/Webkul/User/src/Notifications/AdminResetPassword.php @@ -7,7 +7,6 @@ use Illuminate\Auth\Notifications\ResetPassword; class AdminResetPassword extends ResetPassword { - /** * Build the mail representation of the notification. * @@ -21,8 +20,9 @@ class AdminResetPassword extends ResetPassword } return (new MailMessage) - ->line('You are receiving this email because we received a password reset request for your account.') - ->action('Reset Password', route('admin.reset-password.create', $this->token)) - ->line('If you did not request a password reset, no further action is required.'); + ->view('shop::emails.admin.forget-password')->with([ + 'user_name' => $notifiable->name, + 'token' => $this->token + ]); } }