FEATURE #1435: add login and layout of new admin theme

This commit is contained in:
Michal Kváček
2016-08-16 16:07:14 +02:00
parent aa462c2454
commit fc1141184c
97 changed files with 94901 additions and 105 deletions
+1 -1
View File
@@ -265,7 +265,7 @@ Route::group([
// display login form
Route::get('admin/login', function () {
return view('admin.loginForm.form');
return view('admin.loginForm');
})
->name('loginForm');
+82
View File
@@ -0,0 +1,82 @@
<?php
namespace App\MenuPresenters;
use Pingpong\Menus\MenuItem;
use Pingpong\Menus\Presenters\Presenter;
class MetismenuPresenter extends Presenter
{
/**
* {@inheritdoc }
*/
public function getOpenTagWrapper()
{
return PHP_EOL . '<ul class="nav metismenu" id="sidebar-menu">' . PHP_EOL;
}
/**
* {@inheritdoc }
*/
public function getCloseTagWrapper()
{
return PHP_EOL . '</ul>' . PHP_EOL;
}
/**
* {@inheritdoc }
*/
public function getMenuWithoutDropdownWrapper($item)
{
return '<li' . $this->getActiveState($item) . '><a href="' . $item->getUrl() . '">' . $item->getIcon() . ' ' . $item->title . '</a></li>' . PHP_EOL;
}
/**
* {@inheritdoc }
*/
public function getActiveState(MenuItem $item)
{
$active = ' class="active open"';
if (empty($item->getChilds())) {
// for direct menu input return if page is active
return \Request::is($item->getRequest()) ? $active : null;
} else {
// on nested menu inputs loop over children and in case any of them is active, mark active also root level
foreach ($item->getChilds() as $child) {
if ($this->getActiveState($child)) {
return $active;
}
}
}
return null;
}
/**
* {@inheritdoc }
*/
public function getDividerWrapper()
{
return '<li class="divider"></li>' . PHP_EOL;
}
public function getMultiLevelDropdownWrapper($item)
{
return $this->getMenuWithDropDownWrapper($item);
}
/**
* {@inheritdoc }
*/
public function getMenuWithDropDownWrapper($item)
{
$active = $this->getActiveState($item);
return '<li>
<a ' . $active . ' href="#">' . $item->getIcon() . ' ' . $item->title . ' <i class="fa arrow"></i></a>
<ul>
' . $this->getChildMenuItems($item) . '
</ul>
</li>' . PHP_EOL;
}
}