Merge branch 'master' into rest-api

This commit is contained in:
Devansh 2022-01-13 15:51:48 +05:30
commit e481a6caa2
24 changed files with 190 additions and 113 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,5 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1 4L23 4" stroke="#3C41FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M1 12L23 12" stroke="#3C41FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M1 20L23 20" stroke="#3C41FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 416 B

View File

@ -1,4 +1,4 @@
{
"/js/admin.js": "/js/admin.js?id=5c6abf6523a851d5945d",
"/css/admin.css": "/css/admin.css?id=60a5ed09e7683012cba6"
"/css/admin.css": "/css/admin.css?id=ff3e93242515474ea08b"
}

View File

@ -0,0 +1,5 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1 4L23 4" stroke="#3C41FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M1 12L23 12" stroke="#3C41FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M1 20L23 20" stroke="#3C41FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 416 B

View File

@ -12,7 +12,7 @@ $btn-primary-bg: #0041FF;
$btn-danger-bg: red;
// Cards
$card-title: #a2a2a2;
$card-title: #3a3a3a;
$card-background: $white;
// Dashboard

View File

@ -511,7 +511,24 @@
.card-title {
color: rgba(255,255,255,.8);
}
.card-info {
.card-info {
ul {
li {
.description {
margin-top: 10px;
.name {
color: rgba(255,255,255,.8);
}
.info {
color: rgba(255,255,255,.8);
margin-top: 5px;
}
}
}
}
.no-result-found {
p {
color: rgba(255,255,255,.8);
@ -522,12 +539,15 @@
.dashboard-stats {
.dashboard-card {
background: #071e37;
box-shadow: 0 5px 10px 2px rgb(0 0 0 / 80%);
box-shadow: 0 5px 10px 2px rgb(0 0 0 / 80%);
.title{
color: rgba(255,255,255,.8);
}
.data {
color: $white;
.progress {
color: rgba(255,255,255,.8);
color: rgba(255,255,255,.8);
}
}
}
@ -584,11 +604,6 @@
cursor: default;
}
// .btn.btn-primary {
// background: rgba(255, 255, 255, 0.8);
// color: $black;
// }
.flatpickr-calendar {
background: transparent;
opacity: 0;

View File

@ -71,11 +71,11 @@
margin-top: 10px;
.name {
color: rgba(255,255,255,0.8);
color: #3a3a3a;
}
.info {
color: rgba(255,255,255,0.8);
color: #3a3a3a;
margin-top: 5px;
}
}
@ -98,7 +98,7 @@
p {
margin: 0;
color: #a2a2a2;
color: #3a3a3a;
}
}
}

View File

@ -743,16 +743,17 @@ body {
.page-header {
.control-group {
width: 330px;
width: 100% !important;
display: block;
margin-bottom: 0;
margin-left: 0px;
padding: 0px;
margin-top: 16px;
margin-top: 40px;
}
.page-title {
float: left;
width: 100%;
.back-link {
margin-top: 0px;
@ -761,16 +762,18 @@ body {
}
.page-action {
float: right;
position: absolute;
right: 10px;
margin-top: 0px;
.export-import{
margin-top: -10px;
margin-top: -15px;
}
button{
position: absolute;
right: 9px;
top: 16px;
right: 2px;
top: 0px;
}
* {
@ -810,12 +813,12 @@ body {
.page-header {
.control-group {
width: 385px;
width: 100% !important;
display: block;
margin-bottom: 0;
margin-left: 0px;
padding: 0px;
margin-top: 16px;
margin-top: 40px;
}
}
}
@ -830,12 +833,12 @@ body {
.page-header {
.control-group {
width: 350px;
width: 100% !important;
display: block;
margin-bottom: 0;
margin-left: 0px;
padding: 0px;
margin-top: 16px;
margin-top: 40px;
}
}
}
@ -850,12 +853,12 @@ body {
.page-header {
.control-group {
width: 295px;
width: 100% !important;
display: block;
margin-bottom: 0;
margin-left: 0px;
padding: 0px;
margin-top: 16px;
margin-top: 40px;
}
}
}

View File

@ -1,5 +1,5 @@
@import "colors";
$toggleSize: 24px;
$toggleSize: 31px;
$toggleMargin: -25px 10px;
$toggleLine: 2px;
$toggleColor: #3c41ff;
@ -40,8 +40,11 @@ $toggleColor: #3c41ff;
}
.nav-toggle {
$offset: $toggleSize * 0.5;
background-image: url(./../images/hamburger.svg);
background-repeat: no-repeat;
background-size: cover;
position: relative;
top: 8px;
width: $toggleSize;
height: $toggleSize;
margin: $toggleMargin;
@ -50,26 +53,6 @@ $toggleColor: #3c41ff;
&:hover {
cursor: pointer;
}
&:before, &:after {
content: "";
position: absolute;
top: #{$toggleSize - $toggleLine / 2};
left: 0;
transform: translate(0, 0);
width: 100%;
height: $toggleLine;
background: $toggleColor;
transition: transform .3s ease, box-shadow .3s ease;
}
&:before {
box-shadow: 0 #{$offset / 1.5} 0 0 $toggleColor;
}
&:after {
box-shadow: 0 #{-$offset / 1.5} 0 0 $toggleColor;
}
}
.close {

View File

@ -4,6 +4,23 @@
{{ __('admin::app.cms.pages.edit-title') }}
@stop
@push('css')
<style>
@media only screen and (max-width: 768px){
.content-container .content .page-header .page-action {
position: absolute !important;
right: 10px !important;
}
.content-container .content .page-header .page-action button {
position: relative;
right: 0px !important;
top: 0px !important;
}
}
</style>
@endpush
@section('content')
<div class="content">
@php

View File

@ -10,7 +10,8 @@
@media only screen and (max-width: 768px){
.content-container .content .page-header .page-title .control-group .control{
width: 94%;
width: 100% !important;
margin-top:-25px !important;
}
}

View File

@ -84,7 +84,14 @@ class Core
*
* @var \Webkul\Core\Models\Channel
*/
private static $channel;
protected static $channel;
/**
* Currency.
*
* @var \Webkul\Core\Models\Currency
*/
protected static $currency;
/**
* Register your core config keys here which you don't want to
@ -397,6 +404,31 @@ class Core
return request()->get('customer_group');
}
/**
* Set currency.
*
* @param string $currencyCode
* @return void
*/
public function setCurrency($currencyCode)
{
$currency = $this->currencyRepository->findOneByField('code', $currencyCode);
self::$currency = $currency ?: $this->getChannelBaseCurrency();
}
/**
* Get currency.
*
* Will return null if not set.
*
* @return \Webkul\Core\Models\Currency
*/
public function getCurrency()
{
return self::$currency;
}
/**
* Returns all currencies.
*
@ -488,6 +520,8 @@ class Core
/**
* Returns current channel's currency model.
*
* Will fallback to base currency if not set.
*
* @return \Webkul\Core\Contracts\Currency
*/
public function getCurrentCurrency()
@ -498,13 +532,7 @@ class Core
return $currency;
}
if ($currencyCode = session()->get('currency')) {
if ($currency = $this->currencyRepository->findOneByField('code', $currencyCode)) {
return $currency;
}
}
return $currency = $this->getChannelBaseCurrency();
return $currency = $this->getCurrency() ?: $this->getChannelBaseCurrency();
}
/**

View File

@ -8,36 +8,43 @@ use Webkul\Core\Repositories\CurrencyRepository;
class Currency
{
/**
* @var CurrencyRepository
* Currency repository instance.
*
* @var \Webkul\Core\Repositories\CurrencyRepository
*/
protected $currency;
protected $currencyRepository;
/**
* @param \Webkul\Core\Repositories\CurrencyRepository $locale
* Create a middleware instance.
*
* @param \Webkul\Core\Repositories\CurrencyRepository $currencyRepository
* @return void
*/
public function __construct(CurrencyRepository $currency)
public function __construct(CurrencyRepository $currencyRepository)
{
$this->currency = $currency;
$this->currencyRepository = $currencyRepository;
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$currencyCode = request()->get('currency');
if ($currencyCode = request()->get('currency')) {
if ($this->currencyRepository->findOneByField('code', $currencyCode)) {
core()->setCurrency($currencyCode);
if ($currency = $currencyCode) {
if ($this->currency->findOneByField('code', $currency)) {
session()->put('currency', $currency);
session()->put('currency', $currencyCode);
}
} else {
if (! session()->get('currency')) {
session()->put('currency', core()->getChannelBaseCurrencyCode());
if ($currencyCode = session()->get('currency')) {
core()->setCurrency($currencyCode);
} else {
core()->setCurrency(core()->getChannelBaseCurrencyCode());
}
}
@ -45,4 +52,4 @@ class Currency
return $next($request);
}
}
}

View File

@ -2,44 +2,47 @@
namespace Webkul\Shop\Http\Middleware;
use Webkul\Core\Repositories\LocaleRepository;
use Closure;
use Webkul\Core\Repositories\LocaleRepository;
class Locale
{
/**
* @var LocaleRepository
* Locale repository instance.
*
* @var \Webkul\Core\Repositories\LocaleRepository
*/
protected $locale;
protected $localeRepository;
/**
* @param \Webkul\Core\Repositories\LocaleRepository $locale
* Create a middleware instance.
*
* @param \Webkul\Core\Repositories\LocaleRepository $localeRepository
* @return void
*/
public function __construct(LocaleRepository $locale)
public function __construct(LocaleRepository $localeRepository)
{
$this->locale = $locale;
$this->localeRepository = $localeRepository;
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$locale = core()->getRequestedLocaleCode('locale', false);
if ($localeCode = core()->getRequestedLocaleCode('locale', false)) {
if ($this->localeRepository->findOneByField('code', $localeCode)) {
app()->setLocale($localeCode);
if ($locale) {
if ($this->locale->findOneByField('code', $locale)) {
app()->setLocale($locale);
session()->put('locale', $locale);
session()->put('locale', $localeCode);
}
} else {
if ($locale = session()->get('locale')) {
app()->setLocale($locale);
if ($localeCode = session()->get('locale')) {
app()->setLocale($localeCode);
} else {
app()->setLocale(core()->getDefaultChannel()->default_locale->code);
}

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/ui.js": "/js/ui.js?id=2f9fabd43a584c291335",
"/css/ui.css": "/css/ui.css?id=9dd6a42456cc75479c1d"
"/js/ui.js": "/js/ui.js?id=99de3c7f62be5fb50eaf",
"/css/ui.css": "/css/ui.css?id=9cef07f6a1ec08c925f2"
}

View File

@ -799,7 +799,6 @@ h5 {
margin-left: -34px;
pointer-events: none;
position: absolute;
left: 70%;
top: 51%;
}

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 +1 @@
(()=>{"use strict";var e,r,t,o={},n={};function i(e){var r=n[e];if(void 0!==r)return r.exports;var t=n[e]={id:e,exports:{}};return o[e].call(t.exports,t,t.exports,i),t.exports}i.m=o,e=[],i.O=(r,t,o,n)=>{if(!t){var f=1/0;for(c=0;c<e.length;c++){for(var[t,o,n]=e[c],l=!0,u=0;u<t.length;u++)(!1&n||f>=n)&&Object.keys(i.O).every((e=>i.O[e](t[u])))?t.splice(u--,1):(l=!1,n<f&&(f=n));if(l){e.splice(c--,1);var a=o();void 0!==a&&(r=a)}}return r}n=n||0;for(var c=e.length;c>0&&e[c-1][2]>n;c--)e[c]=e[c-1];e[c]=[t,o,n]},i.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return i.d(r,{a:r}),r},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(e,o){if(1&o&&(e=this(e)),8&o)return e;if("object"==typeof e&&e){if(4&o&&e.__esModule)return e;if(16&o&&"function"==typeof e.then)return e}var n=Object.create(null);i.r(n);var f={};r=r||[null,t({}),t([]),t(t)];for(var l=2&o&&e;"object"==typeof l&&!~r.indexOf(l);l=t(l))Object.getOwnPropertyNames(l).forEach((r=>f[r]=()=>e[r]));return f.default=()=>e,i.d(n,f),n},i.d=(e,r)=>{for(var t in r)i.o(r,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},i.e=()=>Promise.resolve(),i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={929:0,166:0,362:0};i.O.j=r=>0===e[r];var r=(r,t)=>{var o,n,[f,l,u]=t,a=0;if(f.some((r=>0!==e[r]))){for(o in l)i.o(l,o)&&(i.m[o]=l[o]);if(u)var c=u(i)}for(r&&r(t);a<f.length;a++)n=f[a],i.o(e,n)&&e[n]&&e[n][0](),e[f[a]]=0;return i.O(c)},t=self.webpackChunk=self.webpackChunk||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})()})();
(()=>{"use strict";var e,r,t,o={},n={};function i(e){var r=n[e];if(void 0!==r)return r.exports;var t=n[e]={id:e,exports:{}};return o[e].call(t.exports,t,t.exports,i),t.exports}i.m=o,e=[],i.O=(r,t,o,n)=>{if(!t){var f=1/0;for(c=0;c<e.length;c++){for(var[t,o,n]=e[c],l=!0,u=0;u<t.length;u++)(!1&n||f>=n)&&Object.keys(i.O).every((e=>i.O[e](t[u])))?t.splice(u--,1):(l=!1,n<f&&(f=n));if(l){e.splice(c--,1);var a=o();void 0!==a&&(r=a)}}return r}n=n||0;for(var c=e.length;c>0&&e[c-1][2]>n;c--)e[c]=e[c-1];e[c]=[t,o,n]},i.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return i.d(r,{a:r}),r},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(e,o){if(1&o&&(e=this(e)),8&o)return e;if("object"==typeof e&&e){if(4&o&&e.__esModule)return e;if(16&o&&"function"==typeof e.then)return e}var n=Object.create(null);i.r(n);var f={};r=r||[null,t({}),t([]),t(t)];for(var l=2&o&&e;"object"==typeof l&&!~r.indexOf(l);l=t(l))Object.getOwnPropertyNames(l).forEach((r=>f[r]=()=>e[r]));return f.default=()=>e,i.d(n,f),n},i.d=(e,r)=>{for(var t in r)i.o(r,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},i.e=()=>Promise.resolve(),i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={929:0,166:0,362:0};i.O.j=r=>0===e[r];var r=(r,t)=>{var o,n,[f,l,u]=t,a=0;if(f.some((r=>0!==e[r]))){for(o in l)i.o(l,o)&&(i.m[o]=l[o]);if(u)var c=u(i)}for(r&&r(t);a<f.length;a++)n=f[a],i.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return i.O(c)},t=self.webpackChunk=self.webpackChunk||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})()})();

View File

@ -1,10 +1,10 @@
{
"/js/velocity-core.js": "/js/velocity-core.js?id=03a0210d750dd5a7a25a",
"/js/velocity.js": "/js/velocity.js?id=3ede5db1d647d2cbb3d2",
"/js/manifest.js": "/js/manifest.js?id=0632f4b734c0b094a611",
"/js/manifest.js": "/js/manifest.js?id=49cba5d7f2bde965afa8",
"/js/components.js": "/js/components.js?id=553ee40489a7d7ae4060",
"/css/velocity.css": "/css/velocity.css?id=5c9e937a8ad9844d7158",
"/css/velocity-admin.css": "/css/velocity-admin.css?id=301f732acd63a842dc52",
"/css/velocity.css": "/css/velocity.css?id=755b0b94684ca8baea5d",
"/css/velocity-admin.css": "/css/velocity-admin.css?id=9148ecc25c73e398cd16",
"/images/Camera.svg": "/images/Camera.svg?id=b2fd2f9e17e1ccee96e2",
"/images/icon-search.svg": "/images/icon-search.svg?id=a5f38a895551b8a015b2"
}

View File

@ -1,6 +1,6 @@
.velocity-icon {
width: 60px;
height: 55px;
width: 48px;
height: 48px;
display: inline-block;
background-size: cover;
background-image: url("../images/Icon-Velocity.svg");

View File

@ -13,13 +13,24 @@
@push('css')
<style>
@media only screen and (max-width: 768px){
.content-container .content .page-header .page-title{
margin-bottom: 30px !important;
.content-container .content .page-header .page-title {
float: left;
width: 100%;
margin-bottom: 12px;
}
.content-container .content .page-header .page-action button {
position: absolute;
right: 2px;
top: -124px !important;
}
.content-container .content .page-header .control-group {
margin-top:16px !important;
}
}
</style>
@endpush