Browse Source

Gestion config artgris

tags/0.1
Fab 3 years ago
parent
commit
7edef1bce9
8 changed files with 264 additions and 253 deletions
  1. +166
    -161
      Controller/Admin/AbstractCrudController.php
  2. +42
    -41
      Controller/Admin/DashboardController.php
  3. +1
    -1
      Field/CollectionField.php
  4. +1
    -1
      Field/FileManagerField.php
  5. +2
    -2
      Field/GalleryManagerField.php
  6. +6
    -4
      Resources/views/adminlte/crud/_form.html.twig
  7. +42
    -41
      Resources/views/adminlte/crud/form_theme.html.twig
  8. +4
    -2
      Resources/views/adminlte/layout.html.twig

+ 166
- 161
Controller/Admin/AbstractCrudController.php View File

@@ -55,12 +55,13 @@ abstract class AbstractCrudController extends EaAbstractCrudController
protected $translatorAdmin;

public function __construct(
SessionInterface $session,
RequestStack $request,
EntityManager $em,
Environment $twig,
TranslatorAdmin $translatorAdmin
) {
SessionInterface $session,
RequestStack $request,
EntityManager $em,
Environment $twig,
TranslatorAdmin $translatorAdmin
)
{
$this->session = $session;
$this->request = $request;
$this->em = $em;
@@ -73,78 +74,78 @@ abstract class AbstractCrudController extends EaAbstractCrudController
/* Translatable */
if ($this->isInstanceOf(TranslatableInterface::class)) {
$actions->update(
Crud::PAGE_INDEX,
Action::EDIT,
function (Action $action) {
$action->setTemplatePath('@LcSov/adminlte/crud/action/translatable.html.twig');
Crud::PAGE_INDEX,
Action::EDIT,
function (Action $action) {
$action->setTemplatePath('@LcSov/adminlte/crud/action/translatable.html.twig');

return $action;
}
return $action;
}
);
}

/* Boutons des actions dans les listes */
$actionsArray[Crud::PAGE_INDEX] = [
Action::NEW => [
'icon' => 'plus',
'label' => $this->translatorAdmin->transAction('create'),
'add_class' => 'btn-sm'
],
Action::EDIT => [
'class' => 'btn btn-sm btn-primary',
'icon' => 'edit',
'label' => false,
'html_attributes' => array(
'data-toggle' => 'tooltip',
'title' => $this->translatorAdmin->transAction('edit')
)
],
Action::DELETE => [
'icon' => 'trash',
'dropdown' => true,
'label' => $this->translatorAdmin->transAction('delete')
],
Action::BATCH_DELETE => [
'class' => 'btn btn-sm btn-danger',
'icon' => 'trash',
'label' => $this->translatorAdmin->transAction('delete')
],
Action::NEW => [
'icon' => 'plus',
'label' => $this->translatorAdmin->transAction('create'),
'add_class' => 'btn-sm'
],
Action::EDIT => [
'class' => 'btn btn-sm btn-primary',
'icon' => 'edit',
'label' => false,
'html_attributes' => array(
'data-toggle' => 'tooltip',
'title' => $this->translatorAdmin->transAction('edit')
)
],
Action::DELETE => [
'icon' => 'trash',
'dropdown' => true,
'label' => $this->translatorAdmin->transAction('delete')
],
Action::BATCH_DELETE => [
'class' => 'btn btn-sm btn-danger',
'icon' => 'trash',
'label' => $this->translatorAdmin->transAction('delete')
],
];

/* Boutons des actions dans l'édition */

$actionSaveAndReturn = [
'add_class' => 'float-right',
'icon' => 'check',
'label' => $this->translatorAdmin->transAction('save_and_return')
'add_class' => 'float-right',
'icon' => 'check',
'label' => $this->translatorAdmin->transAction('save_and_return')
];
$actionIndex = [
'icon' => 'chevron-left',
'class' => 'btn btn-link',
'label' => $this->translatorAdmin->transAction('back_index')
'icon' => 'chevron-left',
'class' => 'btn btn-link',
'label' => $this->translatorAdmin->transAction('back_index')
];

$actionsArray[Crud::PAGE_EDIT] = [
Action::SAVE_AND_CONTINUE => [
'class' => 'btn btn-info float-right',
'label' => $this->translatorAdmin->transAction('save_and_continue')
],
Action::DELETE => [
'icon' => 'trash',
'class' => 'btn btn-outline-danger action-delete',
'label' => $this->translatorAdmin->transAction('delete')
],
Action::SAVE_AND_RETURN => $actionSaveAndReturn,
Action::INDEX => $actionIndex,
Action::SAVE_AND_CONTINUE => [
'class' => 'btn btn-info float-right',
'label' => $this->translatorAdmin->transAction('save_and_continue')
],
Action::DELETE => [
'icon' => 'trash',
'class' => 'btn btn-outline-danger action-delete',
'label' => $this->translatorAdmin->transAction('delete')
],
Action::SAVE_AND_RETURN => $actionSaveAndReturn,
Action::INDEX => $actionIndex,
];

$actionsArray[Crud::PAGE_NEW] = [
Action::SAVE_AND_ADD_ANOTHER => [
'class' => 'btn btn-info float-right',
'label' => $this->translatorAdmin->transAction('save_and_add_another')
],
Action::SAVE_AND_RETURN => $actionSaveAndReturn,
Action::INDEX => $actionIndex,
Action::SAVE_AND_ADD_ANOTHER => [
'class' => 'btn btn-info float-right',
'label' => $this->translatorAdmin->transAction('save_and_add_another')
],
Action::SAVE_AND_RETURN => $actionSaveAndReturn,
Action::INDEX => $actionIndex,
];

$actions->add(Crud::PAGE_EDIT, Action::INDEX);
@@ -153,9 +154,9 @@ abstract class AbstractCrudController extends EaAbstractCrudController

if ($this->isInstanceOf(SortableInterface::class)) {
$sortAction = Action::new('sort', $this->translatorAdmin->transAction('sort'), 'fa fa-sort')
->linkToCrudAction('sort')
->setCssClass('btn btn-sm btn-success')
->createAsGlobalAction();
->linkToCrudAction('sort')
->setCssClass('btn btn-sm btn-success')
->createAsGlobalAction();

$actions->add(Crud::PAGE_INDEX, $sortAction);
}
@@ -163,24 +164,24 @@ abstract class AbstractCrudController extends EaAbstractCrudController

if ($this->isInstanceOf(TreeInterface::class)) {
$indexChildAction = Action::new(
'index_children',
$this->translatorAdmin->transAction('index_children'),
'fa fa-list'
'index_children',
$this->translatorAdmin->transAction('index_children'),
'fa fa-list'
)
->linkToCrudAction(Action::INDEX)
->setLabel('')
->setHtmlAttributes(array('data-toggle' => 'tooltip', 'title' => 'Afficher les enfants'))
->setTemplatePath('@LcSov/adminlte/crud/action/index_children.html.twig')
->setCssClass('btn btn-sm btn-success');
->linkToCrudAction(Action::INDEX)
->setLabel('')
->setHtmlAttributes(array('data-toggle' => 'tooltip', 'title' => 'Afficher les enfants'))
->setTemplatePath('@LcSov/adminlte/crud/action/index_children.html.twig')
->setCssClass('btn btn-sm btn-success');

$backParentAction = Action::new(
'index_parent',
$this->translatorAdmin->transAction('index_parent'),
'fa fa-chevron-left'
'index_parent',
$this->translatorAdmin->transAction('index_parent'),
'fa fa-chevron-left'
)
->linkToCrudAction(Action::INDEX)
->setCssClass('btn btn-sm btn-info')
->createAsGlobalAction();
->linkToCrudAction(Action::INDEX)
->setCssClass('btn btn-sm btn-info')
->createAsGlobalAction();

$actions->add(Crud::PAGE_INDEX, $backParentAction);
$actions->add(Crud::PAGE_INDEX, $indexChildAction);
@@ -193,35 +194,35 @@ abstract class AbstractCrudController extends EaAbstractCrudController
foreach ($actionsArray as $crudActionName => $actionsStyle) {
foreach ($actionsStyle as $actionName => $button) {
$actions->update(
$crudActionName,
$actionName,
function (Action $action) use ($button) {
if (isset($button['add_class'])) {
$action->addCssClass($button['add_class']);
}

if (isset($button['class'])) {
$action->setCssClass($button['class']);
}

if (isset($button['icon'])) {
$action->setIcon('fa fa-' . $button['icon']);
}

if (isset($button['label'])) {
$action->setLabel($button['label']);
}

if (isset($button['dropdown']) && $button['dropdown']) {
$action->addCssClass('in-dropdown');
}

if (isset($button['html_attributes']) && $button['html_attributes']) {
$action->setHtmlAttributes($button['html_attributes']);
}

return $action;
$crudActionName,
$actionName,
function (Action $action) use ($button) {
if (isset($button['add_class'])) {
$action->addCssClass($button['add_class']);
}

if (isset($button['class'])) {
$action->setCssClass($button['class']);
}

if (isset($button['icon'])) {
$action->setIcon('fa fa-' . $button['icon']);
}

if (isset($button['label'])) {
$action->setLabel($button['label']);
}

if (isset($button['dropdown']) && $button['dropdown']) {
$action->addCssClass('in-dropdown');
}

if (isset($button['html_attributes']) && $button['html_attributes']) {
$action->setHtmlAttributes($button['html_attributes']);
}

return $action;
}
);
}
}
@@ -261,7 +262,7 @@ abstract class AbstractCrudController extends EaAbstractCrudController
$this->session->set($paramSessionListMaxResults, $requestListMaxResults);
}
$maxResults = $this->session->get($paramSessionListMaxResults) ? $this->session->get(
$paramSessionListMaxResults
$paramSessionListMaxResults
) : 30;

$crud->setPaginatorPageSize($maxResults);
@@ -269,26 +270,28 @@ abstract class AbstractCrudController extends EaAbstractCrudController

public function configureFields(string $pageName): iterable
{
$seoPanel = $confPanel = array();

if ($this->isInstanceOf(SortableInterface::class)) {
$seoPanel = [
FormField::addPanel('seo')->setTemplateName('crud/field/generic'),
TextField::new('metaTitle')->setLabel('Meta Title')->setHelp(
'Affiché dans les résultats de recherche Google'
FormField::addPanel('seo')->setTemplateName('crud/field/generic'),
TextField::new('metaTitle')->setLabel('Meta Title')->setHelp(
'Affiché dans les résultats de recherche Google'
)->hideOnIndex(),
TextareaField::new('metaDescription')->setLabel('Meta description')->setHelp(
'Affiché dans les résultats de recherche Google'
)->hideOnIndex(),
CollectionField::new('oldUrls')
->setFormTypeOption('entry_type', TextType::class)->setLabel(
'Anciennes urls du document'
)->hideOnIndex(),
TextareaField::new('metaDescription')->setLabel('Meta description')->setHelp(
'Affiché dans les résultats de recherche Google'
)->hideOnIndex(),
CollectionField::new('oldUrls')
->setFormTypeOption('entry_type', TextType::class)->setLabel(
'Anciennes urls du document'
)->hideOnIndex(),
];
}

if ($this->isInstanceOf(DevAliasInterface::class)) {
$confPanel = [
FormField::addPanel('configuration')->setTemplateName('crud/field/generic'),
TextField::new('devAlias')->hideOnIndex(),
FormField::addPanel('configuration')->setTemplateName('crud/field/generic'),
TextField::new('devAlias')->hideOnIndex(),
];
}

@@ -310,9 +313,9 @@ abstract class AbstractCrudController extends EaAbstractCrudController

$fields = FieldCollection::new($this->configureFields(Crud::PAGE_INDEX));
$filters = $this->get(FilterFactory::class)->create(
$context->getCrud()->getFiltersConfig(),
$fields,
$context->getEntity()
$context->getCrud()->getFiltersConfig(),
$fields,
$context->getEntity()
);
$queryBuilder = $this->createIndexQueryBuilder($context->getSearch(), $context->getEntity(), $fields, $filters);
$paginator = $this->get(PaginatorFactory::class)->create($queryBuilder);
@@ -321,16 +324,16 @@ abstract class AbstractCrudController extends EaAbstractCrudController
$this->get(EntityFactory::class)->processFieldsForAll($entities, $fields);

$sortableForm = $this->createFormBuilder(array('entities', $paginator->getResults()))
->add(
'entities',
CollectionType::class,
array(
'required' => true,
'allow_add' => true,
'entry_type' => PositionType::class,
)
->add(
'entities',
CollectionType::class,
array(
'required' => true,
'allow_add' => true,
'entry_type' => PositionType::class,
)
->getForm();
)
->getForm();

$entityManager = $this->getDoctrine()->getManagerForClass($this->getEntityFqcn());
$repository = $entityManager->getRepository($this->getEntityFqcn());
@@ -357,26 +360,26 @@ abstract class AbstractCrudController extends EaAbstractCrudController
}

$url = $this->get(AdminUrlGenerator::class)
->setAction(Action::INDEX)
->generateUrl();
->setAction(Action::INDEX)
->generateUrl();
$this->addFlash('success', $this->translatorAdmin->transFlashMessage('sort'), array());

return $this->redirect($url);
}

$responseParameters = $this->configureResponseParameters(
KeyValueStore::new(
[
'pageName' => Crud::PAGE_INDEX,
'templatePath' => '@LcSov/adminlte/crud/sort.html.twig',
'entities' => $entities,
'paginator' => $paginator,
'global_actions' => array(),
'batch_actions' => array(),
'filters' => $filters,
'sortable_form' => $sortableForm,
]
)
KeyValueStore::new(
[
'pageName' => Crud::PAGE_INDEX,
'templatePath' => '@LcSov/adminlte/crud/sort.html.twig',
'entities' => $entities,
'paginator' => $paginator,
'global_actions' => array(),
'batch_actions' => array(),
'filters' => $filters,
'sortable_form' => $sortableForm,
]
)
);
$responseParameters->set('fields', $this->configureFields('index'));
$event = new AfterCrudActionEvent($context, $responseParameters);
@@ -389,16 +392,17 @@ abstract class AbstractCrudController extends EaAbstractCrudController
}

public function createIndexQueryBuilder(
SearchDto $searchDto,
EntityDto $entityDto,
FieldCollection $fields,
FilterCollection $filters
): QueryBuilder {
SearchDto $searchDto,
EntityDto $entityDto,
FieldCollection $fields,
FilterCollection $filters
): QueryBuilder
{
$queryBuilder = parent::createIndexQueryBuilder(
$searchDto,
$entityDto,
$fields,
$filters
$searchDto,
$entityDto,
$fields,
$filters
);

if ($this->isInstanceOf(TreeInterface::class)) {
@@ -416,16 +420,17 @@ abstract class AbstractCrudController extends EaAbstractCrudController
}

public function createSortQueryBuilder(
SearchDto $searchDto,
EntityDto $entityDto,
FieldCollection $fields,
FilterCollection $filters
): QueryBuilder {
SearchDto $searchDto,
EntityDto $entityDto,
FieldCollection $fields,
FilterCollection $filters
): QueryBuilder
{
$queryBuilder = parent::createIndexQueryBuilder(
$searchDto,
$entityDto,
$fields,
$filters
$searchDto,
$entityDto,
$fields,
$filters
);

if ($this->isInstanceOf(TreeInterface::class)) {

+ 42
- 41
Controller/Admin/DashboardController.php View File

@@ -23,14 +23,14 @@ class DashboardController extends AbstractDashboardController
public function configureDashboard(): Dashboard
{
return Dashboard::new()
// the name visible to end users
->setTitle('LA CLIC !')
// you can include HTML contents too (e.g. to link to an image)
->setTitle('<img src="assets/img/laclic.png" width="100px">')
// the path defined in this method is passed to the Twig asset() function
->setFaviconPath('favicon.svg')
// the domain used by default is 'messages'
->setTranslationDomain('admin');
// the name visible to end users
->setTitle('LA CLIC !')
// you can include HTML contents too (e.g. to link to an image)
->setTitle('<img src="assets/img/laclic.png" width="100px">')
// the path defined in this method is passed to the Twig asset() function
->setFaviconPath('favicon.svg')
// the domain used by default is 'messages'
->setTranslationDomain('admin');
}

public function configureAssets(): Assets
@@ -41,6 +41,8 @@ class DashboardController extends AbstractDashboardController
$assets->addWebpackEncoreEntry('adminlte-index');
$assets->addWebpackEncoreEntry('adminlte-form');
$assets->addWebpackEncoreEntry('adminlte-sort');
$assets->addWebpackEncoreEntry('adminlte-field-collection');
$assets->addWebpackEncoreEntry('adminlte-field-filemanager');

return $assets;
}
@@ -51,22 +53,22 @@ class DashboardController extends AbstractDashboardController
// user menu with some menu items already created ("sign out", "exit impersonation", etc.)
// if you prefer to create the user menu from scratch, use: return UserMenu::new()->...
return parent::configureUserMenu($user)
// use the given $user object to get the user name
->setName($user->getName())
// use this method if you don't want to display the name of the user
//->displayUserName(false)
->displayUserAvatar(false)
// you can also pass an email address to use gravatar's service
->setGravatarEmail($user->getEmail())
// use the given $user object to get the user name
->setName($user->getName())
// use this method if you don't want to display the name of the user
//->displayUserName(false)
->displayUserAvatar(false)
// you can also pass an email address to use gravatar's service
->setGravatarEmail($user->getEmail())

// you can use any type of menu item, except submenus
->setMenuItems(
[
//MenuItem::linkToRoute('My Profile', 'fa fa-id-card', '', ['...' => '...']),
MenuItem::linkToLogout('Déconnexion', 'sign-out-alt'),
//MenuItem::linkToLogout('Déconnexion', 'sign-out-alt')
]
);
// you can use any type of menu item, except submenus
->setMenuItems(
[
//MenuItem::linkToRoute('My Profile', 'fa fa-id-card', '', ['...' => '...']),
MenuItem::linkToLogout('Déconnexion', 'sign-out-alt'),
//MenuItem::linkToLogout('Déconnexion', 'sign-out-alt')
]
);
}

public function configureCrud(): Crud
@@ -74,24 +76,23 @@ class DashboardController extends AbstractDashboardController
$crud = Crud::new();

return $crud
->overrideTemplates(
[
'layout' => '@LcSov/adminlte/layout.html.twig',
'main_menu' => '@LcSov/adminlte/block/menu.html.twig',
'crud/index' => '@LcSov/adminlte/crud/index.html.twig',
'crud/paginator' => '@LcSov/adminlte/crud/paginator.html.twig',
'crud/edit' => '@LcSov/adminlte/crud/edit.html.twig',
'crud/new' => '@LcSov/adminlte/crud/new.html.twig',
'flash_messages' => '@LcSov/adminlte/block/flash_messages.html.twig',
]
)
->setFormThemes(
[
'@LcSov/adminlte/crud/form_theme.html.twig',
'@FOSCKEditor/Form/ckeditor_widget.html.twig'
]
)
;
->overrideTemplates(
[
'layout' => '@LcSov/adminlte/layout.html.twig',
'main_menu' => '@LcSov/adminlte/block/menu.html.twig',
'crud/index' => '@LcSov/adminlte/crud/index.html.twig',
'crud/paginator' => '@LcSov/adminlte/crud/paginator.html.twig',
'crud/edit' => '@LcSov/adminlte/crud/edit.html.twig',
'crud/new' => '@LcSov/adminlte/crud/new.html.twig',
'flash_messages' => '@LcSov/adminlte/block/flash_messages.html.twig',
]
)
->setFormThemes(
[
'@LcSov/adminlte/crud/form_theme.html.twig',
'@FOSCKEditor/Form/ckeditor_widget.html.twig'
]
);
}

}

+ 1
- 1
Field/CollectionField.php View File

@@ -26,7 +26,7 @@ class CollectionField implements FieldInterface
->setLabel($label)
->setTemplatePath('@LcSov/adminlte/crud/field/collection.html.twig')
->setFormType(CollectionType::class)
->addWebpackEncoreEntries('adminlte-field-collection')
/*->addWebpackEncoreEntries('adminlte-field-collection')*/
->setFormTypeOption('allow_add', true)
->setFormTypeOption('allow_delete', true)
->setFormTypeOption('entry_options', array('label' => false))

+ 1
- 1
Field/FileManagerField.php View File

@@ -23,7 +23,7 @@ final class FileManagerField implements FieldInterface
->setProperty($propertyName)
->setLabel($label)
->setTemplatePath('@LcSov/adminlte/crud/field/file.html.twig')
->addWebpackEncoreEntries('adminlte-field-filemanager')
/*->addWebpackEncoreEntries('adminlte-field-filemanager')*/
->setCustomOption('managerDir', 'file')
->setCustomOption('type', 'file')
->setFormType(FileManagerType::class)

+ 2
- 2
Field/GalleryManagerField.php View File

@@ -26,8 +26,8 @@ class GalleryManagerField implements FieldInterface
->setTemplatePath('@LcSov/adminlte/crud/field/collection.html.twig')
->setFormType(CollectionType::class)
->addCssClass('field-collection')
->addWebpackEncoreEntries('adminlte-field-collection')
->addWebpackEncoreEntries('adminlte-field-filemanager')
/*->addWebpackEncoreEntries('adminlte-field-collection')
->addWebpackEncoreEntries('adminlte-field-filemanager')*/
->setFormTypeOption('allow_add', true)
->setFormTypeOption('allow_delete', true)
->setFormTypeOption('entry_options', array('label'=> false))

+ 6
- 4
Resources/views/adminlte/crud/_form.html.twig View File

@@ -13,11 +13,12 @@

{% block configured_stylesheets %}
{{ parent() }}
{% for css_asset in form.vars.ea_crud_form.assets.cssFiles %}

{% for css_asset in form.vars.ea_crud_form.assets.cssAssets %}
<link rel="stylesheet" href="{{ asset(css_asset) }}">
{% endfor %}

{% for webpack_encore_entry in form.vars.ea_crud_form.assets.webpackEncoreEntries %}
{% for webpack_encore_entry in form.vars.ea_crud_form.assets.webpackEncoreAssets %}
{{ ea_call_function_if_exists('encore_entry_link_tags', webpack_encore_entry) }}
{% endfor %}
{% endblock %}
@@ -25,11 +26,12 @@

{% block configured_javascripts %}
{{ parent() }}
{% for js_asset in form.vars.ea_crud_form.assets.jsFiles %}

{% for js_asset in form.vars.ea_crud_form.assets.jsAssets %}
<script src="{{ asset(js_asset) }}"></script>
{% endfor %}

{% for webpack_encore_entry in form.vars.ea_crud_form.assets.webpackEncoreEntries %}
{% for webpack_encore_entry in form.vars.ea_crud_form.assets.webpackEncoreAssets %}
{{ ea_call_function_if_exists('encore_entry_script_tags', webpack_encore_entry) }}
{% endfor %}
{% endblock %}

+ 42
- 41
Resources/views/adminlte/crud/form_theme.html.twig View File

@@ -155,53 +155,54 @@
{% set type = form.parent.vars.ea_crud_form.ea_field.customOptions.get('type') %}
{% endif %}

<div class="lc-filemanager row">
{% if type == 'image' %}
<div class="col-md-3 col-xs-12 form-group">
<div class="lc-filemenager-preview card">
<div class="no-image">
<i class="fa fa-image"></i>
<div class="lc-filemanager row">
{% if type == 'image' %}
<div class="col-md-3 col-xs-12 form-group">
<div class="lc-filemenager-preview card">
<div class="no-image">
<i class="fa fa-image"></i>
</div>
<img src="{{ form.path.vars.value }}" id="{{ form.path.vars.id }}_preview" alt="" class="card-img-top">
</div>
<img src="{{ form.path.vars.value }}" id="{{ form.path.vars.id }}_preview" alt="" class="card-img-top">
</div>
</div>
{% else %}
<div class="callout callout-success">
<h5><i class="fa fa-file-alt"></i>
<span id="{{ form.path.vars.id }}_preview_text">{{ form.path.vars.value }}</span>
</h5>
</div>
{% endif %}

<div class="col-12">
<div class="input-group">
<div class="input-group-prepend">
{% if form.parent.vars['row_attr']['data-sortable'] is defined %}
<button type="button" class="btn btn-success lc-btn-sortable" data-toggle="tooltip"
title="Trier les images">
<i class="fa fa-arrows-alt"></i>
</button>
{% endif %}
<button type="button" class="btn btn-primary lc-filemanager-open" data-id="{{ form.path.vars.id }}"
data-toggle="tooltip" title="Sélectionner un fichier"
data-target="{{ path('file_manager', {module:1, conf: managerDir})|raw }}">
<i class="fa fa-folder-open"></i>
</button>
</div>
{{ form_widget(form.legend) }}
<div class="input-group-append">
<button type="button" class="btn btn-danger lc-filemanager-delete" data-toggle="tooltip"
title="Supprimer l'image"
data-id="{{ form.path.vars.id }}">
<i class="fa fa-trash"></i>
</button>
{% else %}
<div class="callout callout-success">
<h5><i class="fa fa-file-alt"></i>
<span id="{{ form.path.vars.id }}_preview_text">{{ form.path.vars.value }}</span>
</h5>
</div>
{% endif %}

<div class="col-12">
<div class="input-group">
<div class="input-group-prepend">
{% if form.parent.vars['row_attr']['data-sortable'] is defined %}
<button type="button" class="btn btn-success lc-btn-sortable" data-toggle="tooltip"
title="Trier les images">
<i class="fa fa-arrows-alt"></i>
</button>
{% endif %}
<button type="button" class="btn btn-primary lc-filemanager-open" data-id="{{ form.path.vars.id }}"
data-toggle="tooltip" title="Sélectionner un fichier"
data-target="{{ path('file_manager', {module:1, conf: managerDir})|raw }}">
<i class="fa fa-folder-open"></i>
</button>
</div>
{{ form_widget(form.legend) }}
<div class="input-group-append">
<button type="button" class="btn btn-danger lc-filemanager-delete" data-toggle="tooltip"
title="Supprimer l'image"
data-id="{{ form.path.vars.id }}">
<i class="fa fa-trash"></i>
</button>
</div>


{{ form_rest(form) }}
{{ form_rest(form) }}
</div>
</div>
</div>
</div>
</div>
{% endif %}
{% endblock file_manager_widget %}

{% block checkbox_radio_label -%}

+ 4
- 2
Resources/views/adminlte/layout.html.twig View File

@@ -27,7 +27,8 @@
<link rel="stylesheet" href="{{ asset(css_asset) }}">
{% endfor %}

{% for webpack_encore_entry in ea.assets.webpackEncoreEntries ?? [] %}

{% for webpack_encore_entry in ea.assets.webpackEncoreAssets ?? [] %}
{{ ea_call_function_if_exists('encore_entry_link_tags', webpack_encore_entry) }}
{% endfor %}
{% endblock %}
@@ -55,6 +56,7 @@

{% block body %}
<body id="{% block body_id %}{% endblock %}" class="sidebar-mini layout-fixed {% block body_class %}{% endblock %}">

{% block javascript_page_layout %}
<script>
document.body.classList.add(
@@ -164,7 +166,7 @@
<script src="{{ asset(js_asset) }}"></script>
{% endfor %}

{% for webpack_encore_entry in ea.assets.webpackEncoreEntries ?? [] %}
{% for webpack_encore_entry in ea.assets.webpackEncoreAssets ?? [] %}
{{ ea_call_function_if_exists('encore_entry_script_tags', webpack_encore_entry, null, '_default', {'defer': false}) }}
{% endfor %}
{% endblock %}

Loading…
Cancel
Save