Merge pull request #339 from bagisto/jitendra

Jitendra
This commit is contained in:
JItendra Singh 2018-12-19 15:07:19 +05:30 committed by GitHub
commit aa99c6ace8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 45 additions and 15 deletions

View File

@ -46,6 +46,8 @@ class ConfigurationController extends Controller
{ {
$this->middleware('admin'); $this->middleware('admin');
$this->coreConfig = $coreConfig;
$this->_config = request('_config'); $this->_config = request('_config');
$this->prepareConfigTree(); $this->prepareConfigTree();
@ -77,9 +79,11 @@ class ConfigurationController extends Controller
*/ */
public function index() public function index()
{ {
if(!request()->route('slug') && !request()->route('slug2')) $slugs = $this->getDefaultConfigSlugs();
return redirect()->route('admin.configuration.index', $this->getDefaultConfigSlugs());
if(count($slugs)) {
return redirect()->route('admin.configuration.index', $slugs);
}
return view($this->_config['view'], ['config' => $this->configTree]); return view($this->_config['view'], ['config' => $this->configTree]);
} }
@ -91,12 +95,32 @@ class ConfigurationController extends Controller
*/ */
public function getDefaultConfigSlugs() public function getDefaultConfigSlugs()
{ {
$slugs = [];
if(!request()->route('slug')) {
$firstItem = current($this->configTree->items); $firstItem = current($this->configTree->items);
$secondItem = current($firstItem['children']); $secondItem = current($firstItem['children']);
$slugs = explode('.', $secondItem['key']); $temp = explode('.', $secondItem['key']);
return ['slug' => current($slugs), 'slug2' => end($slugs)]; $slugs = [
'slug' => current($temp),
'slug2' => end($temp)
];
} else {
if(!request()->route('slug2')) {
$secondItem = current($this->configTree->items[request()->route('slug')]['children']);
$temp = explode('.', $secondItem['key']);
$slugs = [
'slug' => current($temp),
'slug2' => end($temp)
];
}
}
return $slugs;
} }
/** /**
@ -110,6 +134,6 @@ class ConfigurationController extends Controller
session()->flash('success', 'Shipping Method is created successfully'); session()->flash('success', 'Shipping Method is created successfully');
return redirect()->route($this->_config['redirect']); return redirect()->back();
} }
} }

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?id=ec33679ba3719e48cea6", "/js/shop.js": "/js/shop.js?id=c6ba9f43bd31f175a665",
"/css/shop.css": "/css/shop.css?id=585481fe8a712f48839d" "/css/shop.css": "/css/shop.css?id=44608a4ce1658811733f"
} }

View File

@ -29,8 +29,8 @@ input {
font-family: 'Montserrat', sans-serif; font-family: 'Montserrat', sans-serif;
} }
.btn.btn-primary{ .btn {
border-radius: 0px; border-radius: 0px !important;
} }
//margin bottom classes //margin bottom classes

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", "/js/ui.js": "/js/ui.js?id=1fdce572fb02cd8c7dad",
"/css/ui.css": "/css/ui.css?id=d5cf31c4af2f6b204753" "/css/ui.css": "/css/ui.css?id=287b4588ed3ee39d4587"
} }

View File

@ -109,6 +109,11 @@ h2 {
color: #ffffff; color: #ffffff;
} }
&.btn-black {
background: #000;
color: #ffffff;
}
&:disabled, &:disabled,
&[disabled="disabled"], &[disabled="disabled"],
&[disabled="disabled"]:hover, &[disabled="disabled"]:hover,
@ -832,6 +837,7 @@ h2 {
.image-wrapper { .image-wrapper {
margin-bottom: 20px; margin-bottom: 20px;
margin-top: 10px;
display: inline-block; display: inline-block;
width: 100%; width: 100%;