Action::EDIT, | Action::EDIT, | ||||
function (Action $action) { | function (Action $action) { | ||||
$action->setTemplatePath('@LcSov/adminlte/crud/action/translatable.html.twig'); | $action->setTemplatePath('@LcSov/adminlte/crud/action/translatable.html.twig'); | ||||
return $action; | return $action; | ||||
} | } | ||||
); | ); | ||||
} | } | ||||
/* Boutons des actions dans les listes */ | /* Boutons des actions dans les listes */ | ||||
$listButtonsStyleArray = [ | |||||
$actionsArray[Crud::PAGE_INDEX] = [ | |||||
Action::EDIT => [ | Action::EDIT => [ | ||||
'class' => 'btn btn-sm btn-primary', | 'class' => 'btn btn-sm btn-primary', | ||||
'icon' => 'edit' | |||||
'icon' => 'edit', | |||||
'label' => false, | |||||
], | ], | ||||
Action::DELETE => [ | Action::DELETE => [ | ||||
'class' => 'btn btn-sm btn-default', | 'class' => 'btn btn-sm btn-default', | ||||
'icon' => 'trash' | |||||
] | |||||
'icon' => 'trash', | |||||
'label' => false, | |||||
], | |||||
]; | ]; | ||||
foreach($listButtonsStyleArray as $actionName => $button) { | |||||
$actions->update( | |||||
Crud::PAGE_INDEX, | |||||
$actionName, | |||||
function (Action $action) use ($button) { | |||||
$action->setCssClass($button['class']); | |||||
$action->setIcon('fa fa-'.$button['icon'])->setLabel(false); | |||||
return $action; | |||||
} | |||||
); | |||||
/* Boutons des actions dans l'édition */ | |||||
$actionsArray[Crud::PAGE_EDIT] = [ | |||||
Action::SAVE_AND_CONTINUE => [ | |||||
'class' => 'btn btn-info float-right', | |||||
], | |||||
Action::SAVE_AND_RETURN => [ | |||||
'add-class' => 'float-right', | |||||
], | |||||
Action::INDEX => [ | |||||
'icon' => 'chevron-left', | |||||
'class'=> '' | |||||
], | |||||
]; | |||||
$actionsArray[Crud::PAGE_NEW] = [ | |||||
Action::SAVE_AND_ADD_ANOTHER => [ | |||||
'class' => 'btn btn-info float-right', | |||||
], | |||||
Action::SAVE_AND_RETURN => [ | |||||
'add-class' => 'float-right', | |||||
], | |||||
Action::INDEX => [ | |||||
'icon' => 'chevron-left', | |||||
'class'=> '' | |||||
], | |||||
]; | |||||
$actions->add(Crud::PAGE_EDIT, Action::INDEX); | |||||
$actions->add(Crud::PAGE_NEW, Action::INDEX); | |||||
$actions->reorder(Crud::PAGE_EDIT, [Action::INDEX, Action::SAVE_AND_RETURN, Action::SAVE_AND_CONTINUE]); | |||||
$actions->reorder(Crud::PAGE_NEW, [Action::INDEX, Action::SAVE_AND_RETURN, Action::SAVE_AND_ADD_ANOTHER]); | |||||
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']); | |||||
} | |||||
return $action; | |||||
} | |||||
); | |||||
} | |||||
} | } | ||||
return $actions; | return $actions; | ||||
{ | { | ||||
$entityClass = $this->getEntityFqcn(); | $entityClass = $this->getEntityFqcn(); | ||||
$paramListMaxResults = 'listMaxResults'; | $paramListMaxResults = 'listMaxResults'; | ||||
$paramSessionListMaxResults = $entityClass . '-' . $paramListMaxResults; | |||||
$paramSessionListMaxResults = $entityClass.'-'.$paramListMaxResults; | |||||
$requestListMaxResults = $this->request->getCurrentRequest()->get($paramListMaxResults); | $requestListMaxResults = $this->request->getCurrentRequest()->get($paramListMaxResults); | ||||
if ($requestListMaxResults) { | if ($requestListMaxResults) { |
//ADMINLTE | //ADMINLTE | ||||
import 'adminlte-js' ; | import 'adminlte-js' ; | ||||
import "adminlte-css"; | |||||
import "fontawesome-css"; | |||||
//BOOTSTRAP | //BOOTSTRAP | ||||
import 'adminlte-plugin/bootstrap/js/bootstrap.min.js'; | import 'adminlte-plugin/bootstrap/js/bootstrap.min.js'; |
@import 'scss/_formchecboxradio.scss'; | @import 'scss/_formchecboxradio.scss'; | ||||
@import "adminlte-css"; | |||||
@import "fontawesome-css"; | |||||
@import "scss/_formfooter.scss"; | |||||
/* card */ | /* card */ | ||||
.card { | .card { | ||||
&.card-table { | &.card-table { | ||||
.card-header { | .card-header { | ||||
border-bottom: 0px none ; | |||||
font-size: 1.1rem ; | |||||
border-bottom: 0px none; | |||||
font-size: 1.1rem; | |||||
} | } | ||||
.card-body { | .card-body { | ||||
padding: 0px ; | |||||
padding: 0px; | |||||
table.table { | table.table { | ||||
margin-bottom: 0px ; | |||||
margin-bottom: 0px; | |||||
tr { | tr { | ||||
th { | th { | ||||
input.form-check-input { | input.form-check-input { | ||||
position: relative ; | |||||
top: 0px ; | |||||
position: relative; | |||||
top: 0px; | |||||
} | } | ||||
} | } | ||||
td { | td { | ||||
padding: 3px 12px ; | |||||
padding: 3px 12px; | |||||
input.form-batch-checkbox { | input.form-batch-checkbox { | ||||
position: relative ; | |||||
top: 4px ; | |||||
position: relative; | |||||
top: 4px; | |||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
.card-footer { | .card-footer { | ||||
background-color: white ; | |||||
padding-top: 25px ; | |||||
background-color: white; | |||||
padding-top: 25px; | |||||
.nb-results { | .nb-results { | ||||
margin-bottom: 10px; | margin-bottom: 10px; |
section.content{position: relative;} | |||||
body.sidebar-collapse:not(.sidebar-mini-xs):not(.sidebar-mini-md):not(.sidebar-mini) { | |||||
.form-footer { | |||||
&, | |||||
&::before { | |||||
margin-left: 0; | |||||
} | |||||
} | |||||
} | |||||
body:not(.sidebar-mini-md):not(.sidebar-mini-xs):not(.layout-top-nav), .sidebar-mini-md, .sidebar-mini-xs { | |||||
.form-footer { | |||||
@include media-breakpoint-up(md) { | |||||
@include transition(margin-left $transition-speed $transition-fn); | |||||
margin-left: $sidebar-width; | |||||
.sidebar-collapse & { | |||||
margin-left: $sidebar-mini-width; | |||||
} | |||||
} | |||||
@include media-breakpoint-down(md) { | |||||
margin-left: $sidebar-mini-width; | |||||
} | |||||
@include media-breakpoint-down(sm) { | |||||
margin-left: 0; | |||||
} | |||||
} | |||||
} | |||||
// Sidebar Mini Breakpoints | |||||
.sidebar-mini, .sidebar-mini-md, .sidebar-mini-xs{ | |||||
// When the sidebar is collapsed... | |||||
&.sidebar-collapse { | |||||
// Apply the new margins to the main content and footer | |||||
.form-footer | |||||
{ | |||||
margin-left: $sidebar-mini-width !important; | |||||
} | |||||
} | |||||
} | |||||
.form-footer { | |||||
position: fixed; | |||||
left: 0; | |||||
right: 0; | |||||
height: 60px; | |||||
bottom: 0px; | |||||
z-index: 10; | |||||
background-color: #fff; | |||||
border-top: 1px solid #dee2e6; | |||||
color: #869099; | |||||
padding: 1rem; | |||||
.btn-list{ | |||||
.float-right, .float-sm-right{ | |||||
margin-left: 10px; | |||||
} | |||||
} | |||||
} |
{% extends ea.templatePath('layout') %} | |||||
{% form_theme form with ea.crud.formThemes only %} | |||||
{% trans_default_domain ea.i18n.translationDomain %} | |||||
{% block configured_head_contents %} | |||||
{{ parent() }} | |||||
{% for htmlContent in form.vars.ea_crud_form.assets.headContents %} | |||||
{{ htmlContent|raw }} | |||||
{% endfor %} | |||||
{% endblock %} | |||||
{% block configured_stylesheets %} | |||||
{{ parent() }} | |||||
{% for css_asset in form.vars.ea_crud_form.assets.cssFiles %} | |||||
<link rel="stylesheet" href="{{ asset(css_asset) }}"> | |||||
{% endfor %} | |||||
{% for webpack_encore_entry in form.vars.ea_crud_form.assets.webpackEncoreEntries %} | |||||
{{ ea_call_function_if_exists('encore_entry_link_tags', webpack_encore_entry) }} | |||||
{% endfor %} | |||||
{% endblock %} | |||||
{% block configured_javascripts %} | |||||
{{ parent() }} | |||||
{% for js_asset in form.vars.ea_crud_form.assets.jsFiles %} | |||||
<script src="{{ asset(js_asset) }}"></script> | |||||
{% endfor %} | |||||
{% for webpack_encore_entry in form.vars.ea_crud_form.assets.webpackEncoreEntries %} | |||||
{{ ea_call_function_if_exists('encore_entry_script_tags', webpack_encore_entry) }} | |||||
{% endfor %} | |||||
{% endblock %} | |||||
{% block page_actions_wrapper %} | |||||
{% endblock page_actions_wrapper %} | |||||
{% block main %} | |||||
<div class="col-8"> | |||||
<div class="card"> | |||||
<div class="card-status-top bg-primary"></div> | |||||
<div class="card-header "> | |||||
{% set default_title = ea.crud.defaultPageTitle('new')|trans(ea.i18n.translationParameters, 'EasyAdminBundle') %} | |||||
<h2 class="card-title">{{ ea.crud.customPageTitle is null ? default_title|raw : ea.crud.customPageTitle('new')|trans(ea.i18n.translationParameters)|raw }}</h2> | |||||
</div> | |||||
<div class="card-body"> | |||||
{% block form %} | |||||
{{ form(form) }} | |||||
{% endblock form %} | |||||
</div> | |||||
</div> | |||||
</div> | |||||
{% block form_footer %} | |||||
<div class="form-footer"> | |||||
<div class="row"> | |||||
<div class="col-sm-8"> | |||||
<div class="btn-list"> | |||||
{% block delete_form %}{% endblock delete_form %} | |||||
{% block page_actions %} | |||||
{% for action in entity.actions %} | |||||
{{ include(action.templatePath, { action: action }, with_context = false) }} | |||||
{% endfor %} | |||||
{% endblock %} | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
{% endblock form_footer %} | |||||
{% endblock %} |
{# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #} | {# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #} | ||||
{# @var entity \EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto #} | {# @var entity \EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto #} | ||||
{% extends ea.templatePath('layout') %} | |||||
{% form_theme edit_form with ea.crud.formThemes only %} | |||||
{% trans_default_domain ea.i18n.translationDomain %} | |||||
{% set form = edit_form %} | |||||
{% extends '@LcSov/adminlte/crud/_form.html.twig' %} | |||||
{% block body_id 'ea-edit-' ~ entity.name ~ '-' ~ entity.primaryKeyValue %} | {% block body_id 'ea-edit-' ~ entity.name ~ '-' ~ entity.primaryKeyValue %} | ||||
{% block body_class 'ea-edit ea-edit-' ~ entity.name %} | {% block body_class 'ea-edit ea-edit-' ~ entity.name %} | ||||
{% block configured_head_contents %} | |||||
{{ parent() }} | |||||
{% for htmlContent in edit_form.vars.ea_crud_form.assets.headContents %} | |||||
{{ htmlContent|raw }} | |||||
{% endfor %} | |||||
{% endblock %} | |||||
{% block configured_body_contents %} | |||||
{{ parent() }} | |||||
{% for htmlContent in edit_form.vars.ea_crud_form.assets.bodyContents %} | |||||
{{ htmlContent|raw }} | |||||
{% endfor %} | |||||
{% endblock %} | |||||
{% block configured_stylesheets %} | |||||
{{ parent() }} | |||||
{% for css_asset in edit_form.vars.ea_crud_form.assets.cssFiles %} | |||||
<link rel="stylesheet" href="{{ asset(css_asset) }}"> | |||||
{% endfor %} | |||||
{% for webpack_encore_entry in edit_form.vars.ea_crud_form.assets.webpackEncoreEntries %} | |||||
{{ ea_call_function_if_exists('encore_entry_link_tags', webpack_encore_entry) }} | |||||
{% endfor %} | |||||
{% endblock %} | |||||
{% block configured_javascripts %} | |||||
{{ parent() }} | |||||
{% for js_asset in edit_form.vars.ea_crud_form.assets.jsFiles %} | |||||
<script src="{{ asset(js_asset) }}"></script> | |||||
{% endfor %} | |||||
{% for webpack_encore_entry in edit_form.vars.ea_crud_form.assets.webpackEncoreEntries %} | |||||
{{ ea_call_function_if_exists('encore_entry_script_tags', webpack_encore_entry) }} | |||||
{% endfor %} | |||||
{% endblock %} | |||||
{% block content_title %} | {% block content_title %} | ||||
{%- apply spaceless -%} | {%- apply spaceless -%} | ||||
{{ ea.crud.customPageTitle is null | {{ ea.crud.customPageTitle is null | ||||
{%- endapply -%} | {%- endapply -%} | ||||
{% endblock %} | {% endblock %} | ||||
{% block page_actions %} | |||||
{% for action in entity.actions %} | |||||
{{ include(action.templatePath, { action: action }, with_context = false) }} | |||||
{% endfor %} | |||||
{% endblock %} | |||||
{% block delete_form %} | |||||
{{ include('@EasyAdmin/crud/includes/_delete_form.html.twig', { entity_id: entity.primaryKeyValue }, with_context = false) }} | |||||
{% endblock delete_form %} | |||||
{% block main %} | |||||
<div class="col-8"> | |||||
<div class="card"> | |||||
<div class="card-body"> | |||||
{% block edit_form %} | |||||
{{ form(edit_form) }} | |||||
{% endblock edit_form %} | |||||
{% block delete_form %} | |||||
{{ include('@EasyAdmin/crud/includes/_delete_form.html.twig', { entity_id: entity.primaryKeyValue }, with_context = false) }} | |||||
{% endblock delete_form %} | |||||
</div> | |||||
</div> | |||||
</div> | |||||
{% endblock %} | |||||
{# | |||||
{% block body_javascript %} | {% block body_javascript %} | ||||
{{ parent() }} | {{ parent() }} | ||||
< | < | ||||
{% endblock %} | {% endblock %} | ||||
#} |
{# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #} | {# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #} | ||||
{# @var entity \EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto #} | {# @var entity \EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto #} | ||||
{% extends ea.templatePath('layout') %} | |||||
{% form_theme new_form with ea.crud.formThemes only %} | |||||
{% trans_default_domain ea.i18n.translationDomain %} | |||||
{% set form = new_form %} | |||||
{% extends '@LcSov/adminlte/crud/_form.html.twig' %} | |||||
{% block body_id 'ea-new-' ~ entity.name ~ '-' ~ entity.primaryKeyValue %} | {% block body_id 'ea-new-' ~ entity.name ~ '-' ~ entity.primaryKeyValue %} | ||||
{% block body_class 'ea-new ea-new-' ~ entity.name %} | {% block body_class 'ea-new ea-new-' ~ entity.name %} | ||||
{% block configured_head_contents %} | |||||
{{ parent() }} | |||||
{% for htmlContent in new_form.vars.ea_crud_form.assets.headContents %} | |||||
{{ htmlContent|raw }} | |||||
{% endfor %} | |||||
{% endblock %} | |||||
{% block configured_stylesheets %} | |||||
{{ parent() }} | |||||
{% for css_asset in new_form.vars.ea_crud_form.assets.cssFiles %} | |||||
<link rel="stylesheet" href="{{ asset(css_asset) }}"> | |||||
{% endfor %} | |||||
{% for webpack_encore_entry in new_form.vars.ea_crud_form.assets.webpackEncoreEntries %} | |||||
{{ ea_call_function_if_exists('encore_entry_link_tags', webpack_encore_entry) }} | |||||
{% endfor %} | |||||
{% endblock %} | |||||
{% block configured_javascripts %} | |||||
{{ parent() }} | |||||
{% for js_asset in new_form.vars.ea_crud_form.assets.jsFiles %} | |||||
<script src="{{ asset(js_asset) }}"></script> | |||||
{% endfor %} | |||||
{% for webpack_encore_entry in new_form.vars.ea_crud_form.assets.webpackEncoreEntries %} | |||||
{{ ea_call_function_if_exists('encore_entry_script_tags', webpack_encore_entry) }} | |||||
{% endfor %} | |||||
{% endblock %} | |||||
{% block content_title %} | {% block content_title %} | ||||
{# {%- apply spaceless -%} | |||||
{%- apply spaceless -%} | |||||
{% set default_title = ea.crud.defaultPageTitle('new')|trans(ea.i18n.translationParameters, 'EasyAdminBundle') %} | {% set default_title = ea.crud.defaultPageTitle('new')|trans(ea.i18n.translationParameters, 'EasyAdminBundle') %} | ||||
{{ ea.crud.customPageTitle is null ? default_title|raw : ea.crud.customPageTitle('new')|trans(ea.i18n.translationParameters)|raw }} | {{ ea.crud.customPageTitle is null ? default_title|raw : ea.crud.customPageTitle('new')|trans(ea.i18n.translationParameters)|raw }} | ||||
{%- endapply -%} #} | |||||
{%- endapply -%} | |||||
{% endblock %} | {% endblock %} | ||||
{% block content_header_wrapper %} | |||||
{# {% for action in entity.actions %} | |||||
{{ include(action.templatePath, { action: action }, with_context = false) }} | |||||
{% endfor %} #} | |||||
{% endblock %} | |||||
{% block main %} | |||||
<div class="col-8"> | |||||
<div class="card"> | |||||
<div class="card-status-top bg-primary"></div> | |||||
<div class="card-header "> | |||||
{% set default_title = ea.crud.defaultPageTitle('new')|trans(ea.i18n.translationParameters, 'EasyAdminBundle') %} | |||||
<h2 class="card-title">{{ ea.crud.customPageTitle is null ? default_title|raw : ea.crud.customPageTitle('new')|trans(ea.i18n.translationParameters)|raw }}</h2> | |||||
</div> | |||||
<div class="card-body"> | |||||
{% block new_form %} | |||||
{{ form(new_form) }} | |||||
{% endblock new_form %} | |||||
</div> | |||||
</div> | |||||
</div> | |||||
{% endblock %} | |||||
{% block body_javascript %} | {% block body_javascript %} | ||||
{{ parent() }} | {{ parent() }} |
<div class="container"> | <div class="container"> | ||||
<div class="row text-center align-items-center flex-row-reverse"> | <div class="row text-center align-items-center flex-row-reverse"> | ||||
{{ content_footer }} | {{ content_footer }} | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</footer> | </footer> |