FEATURE #1365: add some basic layout to admin interface

Admin interface now has some sidebar and content area. Sidebar was supposed to be "dropdown-on-click", however I have not acomplished it yet.
This commit is contained in:
Michal Kváček
2016-01-21 16:02:38 +01:00
parent b258233497
commit 1d33157892
7 changed files with 118 additions and 13 deletions
@@ -0,0 +1,63 @@
<?php
namespace App\MenuPresenters;
use Pingpong\Menus\Presenters\Presenter;
class FoundationMenuPresenter extends Presenter
{
/**
* {@inheritdoc }
*/
public function getOpenTagWrapper()
{
return PHP_EOL . '<ul class="vertical menu-bar icon-left">' . 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>';
}
/**
* {@inheritdoc }
*/
public function getActiveState($item)
{
return \Request::is($item->getRequest()) ? ' class="active"' : null;
}
/**
* {@inheritdoc }
*/
public function getDividerWrapper()
{
return '<li class="divider"></li>';
}
/**
* {@inheritdoc }
*/
public function getMenuWithDropDownWrapper($item)
{
return '<li class="has-dropdown">
<a href="#">
'.$item->getIcon().' '.$item->title.'
</a>
<ul class="dropdown">
'.$this->getChildMenuItems($item).'
</ul>
</li>' . PHP_EOL;
;
}
}
+6 -1
View File
@@ -25,7 +25,12 @@ class AdminProvider extends ServiceProvider
* WARNING: MenuBuilder::route() does not seem to work,
* nor route() helper function. We need to use action() helper instaed.
*/
$menu->url(action('Admin\\Dashboard@getIndex'), trans('admin/mainMenu.dashboard'));
$menu->url(action('Admin\Dashboard@getIndex'), trans('admin/mainMenu.dashboard'), 1, ['icon' => 'fa fa-dashboard']);
$menu->dropdown(trans('admin/mainMenu.userManagement'), function($sub) {
$sub->url(action('Admin\UserManagement@getNewUser'), trans('admin/mainMenu.newUser'), 1, ['icon' => 'fa fa-user-plus']);
$sub->url(action('Admin\UsersManagement@getOverview', ['state' => 'all']), trans('admin/mainMenu.usersOverview'), 2, ['icon' => 'fa fa-users']);
}, ['icon' => 'fa fa-users']);
});
// create menu with user profile