Ver código fonte

Intégration AdminLTE

master
Guillaume 3 anos atrás
pai
commit
53a9366d9e
9 arquivos alterados com 1048 adições e 95 exclusões
  1. +0
    -12
      assets/app.js
  2. +1
    -3
      assets/apps/backend/common/app.common.js
  3. +0
    -11
      assets/bootstrap.js
  4. +0
    -3
      assets/styles/app.css
  5. +3
    -1
      package.json
  6. +18
    -24
      src/Controller/Admin/DashboardController.php
  7. +0
    -6
      src/Controller/Admin/PageCrudController.php
  8. +10
    -4
      webpack.config.js
  9. +1016
    -31
      yarn.lock

+ 0
- 12
assets/app.js Ver arquivo

@@ -1,12 +0,0 @@
/*
* Welcome to your app's main JavaScript file!
*
* We recommend including the built version of this JavaScript file
* (and its CSS file) in your base layout (base.html.twig).
*/

// any CSS you import will output into a single css file (app.css in this case)
import './styles/app.css';

// start the Stimulus application
import './bootstrap';

+ 1
- 3
assets/apps/backend/common/app.common.js Ver arquivo

@@ -10,6 +10,4 @@ import './common.scss';
import './common.js';

// start the Stimulus application
//import './bootstrap';

alert('Yo !') ;
//import './bootstrap';

+ 0
- 11
assets/bootstrap.js Ver arquivo

@@ -1,11 +0,0 @@
import { startStimulusApp } from '@symfony/stimulus-bridge';

// Registers Stimulus controllers from controllers.json and in the controllers/ directory
export const app = startStimulusApp(require.context(
'@symfony/stimulus-bridge/lazy-controller-loader!./controllers',
true,
/\.(j|t)sx?$/
));

// register any custom, 3rd party controllers here
// app.register('some_controller_name', SomeImportedController);

+ 0
- 3
assets/styles/app.css Ver arquivo

@@ -1,3 +0,0 @@
body {
background-color: lightgray;
}

+ 3
- 1
package.json Ver arquivo

@@ -21,5 +21,7 @@
"watch": "encore dev --watch",
"build": "encore production --progress"
},
"dependencies": {}
"dependencies": {
"adminlte": "^2.4.1"
}
}

+ 18
- 24
src/Controller/Admin/DashboardController.php Ver arquivo

@@ -8,16 +8,32 @@ use App\Entity\Site\Page;
use App\Entity\User\GroupUser;
use App\Entity\User\User;
use EasyCorp\Bundle\EasyAdminBundle\Config\Assets;
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
use EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem;
use Lc\SovBundle\Controller\Admin\DashboardController as LcDashboardController;

class DashboardController extends LcDashboardController
{

public function configureAssets(): Assets
public function configureMenuItems(): iterable
{
$submenuUser = [
MenuItem::linkToCrud('Utilisateurs', '', User::class),
MenuItem::linkToCrud('Groupes d\'utilisateurs', '', GroupUser::class),
];

yield MenuItem::linkToDashboard('Tableau de bord', 'circle');
yield MenuItem::subMenu('Utilisateurs', 'user')->setSubItems($submenuUser);
yield MenuItem::linkToCrud('Pages', 'copy', Page::class);
yield MenuItem::linkToCrud('TVA', 'circle', TaxRate::class);
/*
MenuItem::section('Blog'),
MenuItem::linkToCrud('Categories', 'fa fa-tags', Category::class),
MenuItem::linkToCrud('Blog Posts', 'fa fa-file-text', BlogPost::class),

return parent::configureAssets(); // TODO: Change the autogenerated stub
MenuItem::section('Users'),
MenuItem::linkToCrud('Comments', 'fa fa-comment', Comment::class),
MenuItem::linkToCrud('Users', 'fa fa-user', User::class),*/
}

/*public function configureMenuItems(): iterable
@@ -111,26 +127,4 @@ class DashboardController extends LcDashboardController
yield MenuItem::linkToCrud('Statuts de commande', 'fas fa-shopping-basket', OrderStatus::class)->setPermission('ROLE_SUPER_ADMIN');
*/

public function configureMenuItems(): iterable
{
$submenuUser = [
MenuItem::linkToCrud('Utilisateurs', '', User::class),
MenuItem::linkToCrud('Groupes d\'utilisateurs', '', GroupUser::class),
];

yield MenuItem::linkToDashboard('Tableau de bord', 'home');
yield MenuItem::subMenu('Utilisateurs', 'users')->setSubItems($submenuUser);
yield MenuItem::linkToCrud('Pages', 'tags', Page::class);
yield MenuItem::linkToCrud('TVA', 'user', TaxRate::class);

/*
MenuItem::section('Blog'),
MenuItem::linkToCrud('Categories', 'fa fa-tags', Category::class),
MenuItem::linkToCrud('Blog Posts', 'fa fa-file-text', BlogPost::class),

MenuItem::section('Users'),
MenuItem::linkToCrud('Comments', 'fa fa-comment', Comment::class),
MenuItem::linkToCrud('Users', 'fa fa-user', User::class),*/
}

}

+ 0
- 6
src/Controller/Admin/PageCrudController.php Ver arquivo

@@ -19,12 +19,6 @@ class PageCrudController extends AbstractCrudController
return Page::class;
}

public function configureAssets(Assets $assets): Assets
{
$assets->addWebpackEncoreEntry('tabler') ;
return parent::configureAssets($assets); // TODO: Change the autogenerated stub
}

public function configureFields(string $pageName): iterable
{
return [

+ 10
- 4
webpack.config.js Ver arquivo

@@ -17,12 +17,18 @@ Encore
//.setManifestKeyPrefix('build/')
.enableSassLoader()
.addAliases({
'adminlte': path.resolve(__dirname, './node_modules/admin-lte/dist/js/adminlte.min.js'),
'jquery': path.join(__dirname, 'node_modules/jquery/src/jquery'),
'adminlte-js': path.resolve(__dirname, 'node_modules/admin-lte/dist/js/adminlte.min.js'),
'adminlte-css': path.resolve(__dirname, 'node_modules/admin-lte/dist/css/adminlte.min.css'),
'fontawesome-css': path.resolve(__dirname, 'node_modules/admin-lte/plugins/fontawesome-free/css/all.css'),

/*'adminlte': path.resolve(__dirname, './node_modules/admin-lte/dist/js/adminlte.min.js'),
'adminltePlugin': path.resolve(__dirname, './node_modules/admin-lte/plugins/'),
'admin-lte-css': path.resolve(__dirname, './node_modules/admin-lte/dist/css/adminlte.css'),
'core-js': path.resolve(__dirname, './node_modules/core-js'),
'jquery': path.join(__dirname, 'node_modules/jquery/src/jquery'),
'select2': path.join(__dirname, 'node_modules/select2/dist/js/select2.js'),
'select2-css': path.join(__dirname, 'node_modules/select2/dist/css/select2.min.css'),
'select2-css': path.join(__dirname, 'node_modules/select2/dist/css/select2.min.css'),*/
//'select2-bootstrap-theme': path.join(__dirname, 'node_modules/select2-bootstrap-5-theme/dist/select2-bootstrap-5-theme.min.css')
})

@@ -34,8 +40,8 @@ Encore
*/
//.addEntry('backend-common', './assets/apps/backend/common/app.common.js')
//.addEntry('jquery', './node_modules/jquery/dist/jquery.slim.js')
.addEntry('common', './Lc/SovBundle/Resources/assets/apps/common/app.common.js')
.addEntry('tabler', './Lc/SovBundle/Resources/assets/apps/tabler/app.tabler.js')
.addEntry('backend-common', './Lc/SovBundle/Resources/assets/apps/backend-common/app.common.js')
//.addEntry('tabler', './Lc/SovBundle/Resources/assets/apps/tabler/app.tabler.js')
//.addEntry('easyadmin', './vendor/easycorp/easyadmin-bundle/assets/js/app.js')

// enables the Symfony UX Stimulus bridge (used in assets/bootstrap.js)

+ 1016
- 31
yarn.lock
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


Carregando…
Cancelar
Salvar