Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdminLTE 3 implementation #5989

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"php": "^7.3",
"doctrine/common": "^2.7",
"doctrine/inflector": "^1.1",
"knplabs/knp-menu": "^3.1",
"knplabs/knp-menu-bundle": "^3.0",
"sonata-project/block-bundle": "^4.0",
"knplabs/knp-menu": "^2.0 || ^3.1",
"knplabs/knp-menu-bundle": "^2.3 || ^3.0",
"sonata-project/block-bundle": "^3.18.3 || ^4.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why these changes ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is draft. I need it for working demo for now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is draft. I need it for working demo for now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, sorry for the too early review. 😅

"sonata-project/doctrine-extensions": "^1.4",
"sonata-project/exporter": "^2.1",
"sonata-project/form-extensions": "^1.1.2",
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/action_create_edit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ options for the group itself.
- ``fields``: The fields in your form group (you should NOT override this
unless you know what you're doing).
- ``box_class``: The class for your form group box in the admin; by default,
the value is set to ``box box-primary``.
the value is set to ``card card-primary``.
- ``description``: A text shown at the top of the form group.
- ``translation_domain``: The translation domain for the form group title
(the Admin translation domain is used by default).
Expand All @@ -137,7 +137,7 @@ To specify options, do as follows::
->tab('General') // the tab call is optional
->with('Addresses', [
'class' => 'col-md-8',
'box_class' => 'box box-solid box-danger',
'box_class' => 'card card-solid card-danger',
'description' => 'Lorem ipsum',
// ...
])
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/action_show.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ When adding a group to your show page, you may specify some options for the grou
- ``fields``: the fields in your group (you should NOT override this unless
you know what you're doing).
- ``box_class``: the class for your group box in the admin; by default,
the value is set to ``box box-primary``.
the value is set to ``card card-primary``.
- ``description``: to complete
- ``translation_domain``: to complete

Expand All @@ -45,7 +45,7 @@ To specify options, do as follow::
->tab('General') // the tab call is optional
->with('Addresses', [
'class' => 'col-md-8',
'box_class' => 'box box-solid box-danger',
'box_class' => 'card card-solid card-danger',
'description' => 'Lorem ipsum',
])
->add('title')
Expand Down
36 changes: 18 additions & 18 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function getConfigTreeBuilder()
->info("Label Catalogue used for admin services if one isn't provided.")
->end()
->scalarNode('default_icon')
->defaultValue('<i class="fa fa-folder"></i>')
->defaultValue('<i class="nav-icon fa fa-folder"></i>')
->info("Icon used for admin services if one isn't provided.")
->end()
->integerNode('dropdown_number_groups_per_colums')->defaultValue(2)->end()
Expand Down Expand Up @@ -199,7 +199,7 @@ public function getConfigTreeBuilder()
->children()
->scalarNode('label')->end()
->scalarNode('label_catalogue')->end()
->scalarNode('icon')->defaultValue('<i class="fa fa-folder"></i>')->end()
->scalarNode('icon')->defaultValue('<i class="nav-icon fa fa-folder"></i>')->end()
->scalarNode('on_top')->defaultFalse()->info('Show menu item in side dashboard menu without treeview')->end()
->scalarNode('keep_open')->defaultFalse()->info('Keep menu group always open')->end()
->scalarNode('provider')->end()
Expand Down Expand Up @@ -375,27 +375,26 @@ public function getConfigTreeBuilder()
->children()
->arrayNode('stylesheets')
->defaultValue([
'bundles/sonatacore/vendor/bootstrap/dist/css/bootstrap.min.css',
'bundles/sonatacore/vendor/components-font-awesome/css/font-awesome.min.css',
'bundles/sonatacore/vendor/ionicons/css/ionicons.min.css',
'bundles/sonataadmin/vendor/admin-lte/dist/css/AdminLTE.min.css',
'bundles/sonataadmin/vendor/admin-lte/dist/css/skins/skin-black.min.css',
'bundles/sonataadmin/vendor/bootstrap/dist/css/bootstrap.min.css',
'bundles/sonataadmin/vendor/components-font-awesome/css/font-awesome.min.css',
'bundles/sonataadmin/vendor/ionicons/css/ionicons.min.css',
'bundles/sonataadmin/vendor/admin-lte/dist/css/adminlte.min.css',
'bundles/sonataadmin/vendor/iCheck/skins/square/blue.css',

'bundles/sonatacore/vendor/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css',
'bundles/sonataadmin/vendor/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css',

'bundles/sonataadmin/vendor/jqueryui/themes/base/jquery-ui.css',

'bundles/sonatacore/vendor/select2/select2.css',
'bundles/sonatacore/vendor/select2-bootstrap-css/select2-bootstrap.min.css',
'bundles/sonataadmin/vendor/select2/select2.css',
'bundles/sonataadmin/vendor/select2-bootstrap-css/select2-bootstrap.min.css',

'bundles/sonataadmin/vendor/x-editable/dist/bootstrap3-editable/css/bootstrap-editable.css',

'bundles/sonataadmin/css/styles.css',
'bundles/sonataadmin/css/layout.css',
'bundles/sonataadmin/css/tree.css',

'bundles/sonatacore/css/flashmessage.css',
'bundles/sonataadmin/css/flashmessage.css',
])
->prototype('scalar')->end()
->end()
Expand All @@ -411,26 +410,27 @@ public function getConfigTreeBuilder()
->end()
->arrayNode('javascripts')
->defaultValue([
'bundles/sonatacore/vendor/jquery/dist/jquery.min.js',
'bundles/sonataadmin/vendor/jquery/dist/jquery.min.js',
'bundles/sonataadmin/vendor/jquery.scrollTo/jquery.scrollTo.min.js',

'bundles/sonataadmin/vendor/jqueryui/ui/minified/jquery-ui.min.js',
'bundles/sonataadmin/vendor/jqueryui/ui/minified/i18n/jquery-ui-i18n.min.js',

'bundles/sonatacore/vendor/moment/min/moment.min.js',
'bundles/sonataadmin/vendor/moment/min/moment.min.js',

'bundles/sonatacore/vendor/bootstrap/dist/js/bootstrap.min.js',
'bundles/sonataadmin/vendor/popper.js/dist/umd/popper.js',
'bundles/sonataadmin/vendor/bootstrap/dist/js/bootstrap.min.js',

'bundles/sonatacore/vendor/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js',
'bundles/sonataadmin/vendor/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js',

'bundles/sonataadmin/vendor/jquery-form/jquery.form.js',
'bundles/sonataadmin/jquery/jquery.confirmExit.js',

'bundles/sonataadmin/vendor/x-editable/dist/bootstrap3-editable/js/bootstrap-editable.min.js',

'bundles/sonatacore/vendor/select2/select2.min.js',
'bundles/sonataadmin/vendor/select2/select2.min.js',

'bundles/sonataadmin/vendor/admin-lte/dist/js/app.min.js',
'bundles/sonataadmin/vendor/admin-lte/dist/js/adminlte.min.js',
'bundles/sonataadmin/vendor/iCheck/icheck.min.js',
'bundles/sonataadmin/vendor/slimScroll/jquery.slimscroll.min.js',
'bundles/sonataadmin/vendor/waypoints/lib/jquery.waypoints.min.js',
Expand All @@ -443,7 +443,7 @@ public function getConfigTreeBuilder()
'bundles/sonataadmin/treeview.js',
'bundles/sonataadmin/sidebar.js',

'bundles/sonatacore/js/base.js',
'bundles/sonataadmin/js/base.js',
])
->prototype('scalar')->end()
->end()
Expand Down
2 changes: 1 addition & 1 deletion src/Mapper/BaseGroupedMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function with($name, array $options = [])
// 'label' => $this->admin->getLabelTranslatorStrategy()->getLabel($name, $this->getName(), 'group'),
'translation_domain' => null,
'name' => $name,
'box_class' => 'box box-primary',
'box_class' => 'card card-primary card-outline',
'empty_message' => 'message_form_group_empty',
'empty_message_translation_domain' => 'SonataAdminBundle',
];
Expand Down
28 changes: 28 additions & 0 deletions src/Resources/public/css/flashmessage.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.read-more-state {
display: none;
}

.read-more-target {
opacity: 0;
display: none;
max-height: 0;
font-size: 0;
transition: .40s ease;
}

.read-more-state:checked ~ .read-more-wrap .read-more-target {
opacity: 1;
display: block;
font-size: inherit;
max-height: 999em;
}

.read-more-trigger {
cursor: pointer;
margin: auto;
}

.alert .read-more-trigger {
position: relative;
left: calc(50% - 1rem);
}
2 changes: 1 addition & 1 deletion src/Resources/public/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ body > .header .logo {
}

.main-header {
height: 50px;
height: 57px;
}

.logo img {
Expand Down
27 changes: 27 additions & 0 deletions src/Resources/public/js/base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
jQuery(document).ready(function() {
SonataCore.remove_iCheck_in_flashmessage();
SonataCore.addFlashmessageListener();
});

var SonataCore = {
remove_iCheck_in_flashmessage: () => {
jQuery('.read-more-state').iCheck('destroy');
},
addFlashmessageListener: () => {
document.querySelectorAll('.read-more-state').forEach((element) => {
element.addEventListener('change', (event) => {
let label = document.querySelector('label[for="' + element.id + '"]')
let labelMore = label.querySelector('.more')
let labelLess = label.querySelector('.less')

if (event.target.checked) {
labelMore.classList.add('hide')
labelLess.classList.remove('hide')
} else {
labelMore.classList.remove('hide')
labelLess.classList.add('hide')
}
});
})
}
};
Binary file added src/Resources/public/logo_title_xl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Resources/public/logo_title_xs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions src/Resources/public/vendor/admin-lte/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to commit all the admin-lte files ?
Can't we declare the dependency in the composer.json or something ?
Could we use https://packagist.org/packages/almasaeed2010/adminlte ?

"presets": [
[
"@babel/preset-env",
{
"loose": true,
"modules": false
}
]
],
"plugins": [
"@babel/plugin-external-helpers"
]
}
43 changes: 0 additions & 43 deletions src/Resources/public/vendor/admin-lte/.bower.json

This file was deleted.

13 changes: 13 additions & 0 deletions src/Resources/public/vendor/admin-lte/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# https://github.com/browserslist/browserslist#readme

>= 1%
last 1 major version
not dead
Chrome >= 45
Firefox >= 38
Edge >= 12
Explorer >= 10
iOS >= 9
Safari >= 9
Android >= 4.4
Opera >= 30
2 changes: 1 addition & 1 deletion src/Resources/public/vendor/admin-lte/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014-2017 Abdullah Almsaeed
Copyright (c) 2014-2018 almasaeed2010

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
Loading