-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f4016de
commit 2905170
Showing
35 changed files
with
459 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
composer.phar | ||
composer.lock | ||
.DS_Store | ||
.idea | ||
/.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<div class="navbar-default sidebar" role="navigation"> | ||
<div class="sidebar-nav navbar-collapse"> | ||
<ul class="nav" id="side-menu"> | ||
@foreach(AdminNavigation::getRootSection()->getPages() as $item) | ||
<li @if($item->isActive())class="active"@endif> | ||
<a href="{{ $item->getUrl() }}"> | ||
{!! $item->getIcon() !!} | ||
<span class="mm-text">{!! $item->getName() !!}</span> | ||
</a> | ||
</li> | ||
@endforeach | ||
|
||
@foreach(AdminNavigation::getRootSection()->getSections() as $section) | ||
@include('cms::navigation.sections', ['section' => $section]) | ||
@endforeach | ||
</ul> | ||
</div> | ||
</div> |
23 changes: 23 additions & 0 deletions
23
resources/views/default/_partials/navigation/sections.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@if(count($section) > 0 or $section->hasSections()) | ||
<li class="mm-dropdown @if($section->isActive()) open @endif"> | ||
<a href="#"> | ||
{!! $section->getIcon() !!} | ||
<span class="mm-text">{!! $section->getName() !!}</span> | ||
</a> | ||
<ul> | ||
@foreach($section as $item) | ||
<?php if($item->isHidden()) continue; ?> | ||
<li @if ($item->isActive())class="active"@endif> | ||
<a href="{{ $item->getUrl() }}"> | ||
{!! $item->getIcon() !!} | ||
<span class="mm-text">{!! $item->getName() !!}</span> | ||
</a> | ||
</li> | ||
@endforeach | ||
|
||
@foreach($section->getSections() as $sub_section ) | ||
@include('cms::navigation.sections', ['section' => $sub_section]) | ||
@endforeach | ||
</ul> | ||
</li> | ||
@endif |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
<?php | ||
|
||
namespace SleepingOwl\Admin\Commands; | ||
|
||
use App; | ||
use Illuminate\Console\Command; | ||
use Illuminate\Filesystem\Filesystem; | ||
use Symfony\Component\Console\Input\InputOption; | ||
use SleepingOwl\Admin\Providers\SleepingOwlServiceProvider; | ||
|
||
class InstallCommand extends Command | ||
{ | ||
|
||
/** | ||
* The console command name. | ||
* @var string | ||
*/ | ||
protected $name = 'sleepingowl:install'; | ||
|
||
/** | ||
* The console command description. | ||
* @var string | ||
*/ | ||
protected $description = 'Install the SleepingOwl Admin package'; | ||
|
||
/** | ||
* @var Filesystem | ||
*/ | ||
protected $files; | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @param Filesystem $files | ||
*/ | ||
public function fire(Filesystem $files) | ||
{ | ||
$this->files = $files; | ||
|
||
$title = $this->option('title'); | ||
|
||
$this->call('vendor:publish', ['--provider' => SleepingOwlServiceProvider::class]); | ||
|
||
$this->publishConfig($title); | ||
|
||
$this->createBootstrapDirectory(); | ||
$this->createNavigationFile(); | ||
$this->createBootstrapFile(); | ||
$this->createRoutesFile(); | ||
$this->createPublicDefaultStructure(); | ||
} | ||
|
||
/** | ||
* Create bootstrap directory | ||
*/ | ||
protected function createBootstrapDirectory() | ||
{ | ||
$directory = config('sleeping_owl.bootstrapDirectory'); | ||
|
||
if (! is_dir($directory)) { | ||
$this->files->makeDirectory($directory, 0755, true, true); | ||
$this->line('<info>Admin bootstrap directory was created:</info> '.str_replace(base_path(), '', $directory)); | ||
} | ||
} | ||
|
||
/** | ||
* Create default menu file | ||
*/ | ||
protected function createNavigationFile() | ||
{ | ||
$file = config('sleeping_owl.bootstrapDirectory').'/navigation.php'; | ||
|
||
if (! file_exists($file)) { | ||
$contents = $this->files->get(__DIR__.'/stubs/navigation.stub'); | ||
$this->files->put($file, $contents); | ||
$this->line('<info>Menu file was created:</info> '.str_replace(base_path(), '', $file)); | ||
} | ||
} | ||
|
||
/** | ||
* Create default bootstrap file | ||
*/ | ||
protected function createBootstrapFile() | ||
{ | ||
$file = config('sleeping_owl.bootstrapDirectory').'/bootstrap.php'; | ||
if (! file_exists($file)) { | ||
$contents = $this->files->get(__DIR__.'/stubs/bootstrap.stub'); | ||
$this->files->put($file, $contents); | ||
$this->line('<info>Bootstrap file was created:</info> '.str_replace(base_path(), '', $file)); | ||
} | ||
} | ||
|
||
/** | ||
* Create default routes file | ||
*/ | ||
protected function createRoutesFile() | ||
{ | ||
$file = config('sleeping_owl.bootstrapDirectory').'/routes.php'; | ||
if (! file_exists($file)) { | ||
$contents = $this->files->get(__DIR__.'/stubs/routes.stub'); | ||
$this->files->put($file, $contents); | ||
$this->line('<info>Bootstrap file was created:</info> '.str_replace(base_path(), '', $file)); | ||
} | ||
} | ||
|
||
/** | ||
* Create public default structure | ||
*/ | ||
protected function createPublicDefaultStructure() | ||
{ | ||
$uploadsDirectory = public_path('images/uploads'); | ||
if (! is_dir($uploadsDirectory)) { | ||
$this->files->makeDirectory($uploadsDirectory, 0755, true, true); | ||
} | ||
} | ||
|
||
/** | ||
* Publish package config | ||
* | ||
* @param string|null $title | ||
*/ | ||
protected function publishConfig($title = null) | ||
{ | ||
$file = config_path('sleeping_owl.php'); | ||
|
||
if (! is_null($title)) { | ||
$contents = $this->files->get($file); | ||
$contents = str_replace('Sleeping Owl administrator', $title, $contents); | ||
$this->files->put($file, $contents); | ||
} | ||
} | ||
|
||
/** | ||
* Get the console command options. | ||
* @return array | ||
*/ | ||
protected function getOptions() | ||
{ | ||
return [ | ||
[ | ||
'title', | ||
null, | ||
InputOption::VALUE_REQUIRED, | ||
'Title for admin module.' | ||
], | ||
]; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
/* | ||
* Describe you custom displays, columns and form items here. | ||
* | ||
* Display::register('customDisplay', '\Foo\Bar\MyCustomDisplay'); | ||
* | ||
* Column::register('customColumn', '\Foo\Bar\MyCustomColumn'); | ||
* | ||
* FormItem::register('customElement', \Foo\Bar\MyCustomElement::class); | ||
* | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
return [ | ||
[ | ||
'name' => 'Dashboard', | ||
'icon' => 'dashboard', | ||
'url' => route('admin.dashboard'), | ||
] | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
|
||
Route::get('', ['as' => 'admin.dashboard', function () { | ||
$content = 'Define your dashboard here.'; | ||
return AdminSection::view($content, 'Dashboard'); | ||
}]); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace SleepingOwl\Admin\Facades; | ||
|
||
use Illuminate\Support\Facades\Facade; | ||
|
||
class AdminNavigation extends Facade | ||
{ | ||
|
||
/** | ||
* @return string | ||
*/ | ||
protected static function getFacadeAccessor() | ||
{ | ||
return 'sleeping_owl.navigation'; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.