{ | { | ||||
if (in_array(TranslatableInterface::class, class_implements($this->getEntityFqcn()))) { | if (in_array(TranslatableInterface::class, class_implements($this->getEntityFqcn()))) { | ||||
$actions->update(Crud::PAGE_INDEX, Action::EDIT, function (Action $action) { | $actions->update(Crud::PAGE_INDEX, Action::EDIT, function (Action $action) { | ||||
return $action->setTemplatePath('@Sov/crud/action/translatable.html.twig'); | |||||
return $action->setTemplatePath('@LcSov/crud/action/translatable.html.twig'); | |||||
}); | }); | ||||
} | } | ||||
{ | { | ||||
return $crud | return $crud | ||||
->overrideTemplates([ | ->overrideTemplates([ | ||||
'crud/edit' => '@Sov/crud/edit.html.twig', | |||||
'crud/new' => '@Sov/crud/new.html.twig' | |||||
'crud/edit' => '@LcSov/crud/edit.html.twig', | |||||
'crud/new' => '@LcSov/crud/new.html.twig' | |||||
]) | ]) | ||||
// don't forget to add EasyAdmin's form theme at the end of the list | // don't forget to add EasyAdmin's form theme at the end of the list | ||||
// (otherwise you'll lose all the styles for the rest of form fields) | // (otherwise you'll lose all the styles for the rest of form fields) | ||||
->setFormThemes(['@Sov/crud/form_theme.html.twig', '@FOSCKEditor/Form/ckeditor_widget.html.twig']); | |||||
->setFormThemes(['@LcSov/crud/form_theme.html.twig', '@FOSCKEditor/Form/ckeditor_widget.html.twig']); | |||||
} | } | ||||
// the argument of these methods is passed to the asset() Twig function | // the argument of these methods is passed to the asset() Twig function | ||||
// CSS assets are added just before the closing </head> element | // CSS assets are added just before the closing </head> element | ||||
// and JS assets are added just before the closing </body> element | // and JS assets are added just before the closing </body> element | ||||
->addJsFile('bundles/lcadmin/js/utils.js'); | |||||
->addJsFile('bundles/lc_sov/js/utils.js'); | |||||
} | } | ||||
/* | /* |
public function index(): Response | public function index(): Response | ||||
{ | { | ||||
return $this->render('@Sov/dashboard.html.twig'); | |||||
return $this->render('@LcSov/dashboard.html.twig'); | |||||
} | } | ||||
public function configureDashboard(): Dashboard | public function configureDashboard(): Dashboard |
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; | use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; | ||||
class SovExtension extends Extension implements PrependExtensionInterface | |||||
class LcSovExtension extends Extension implements PrependExtensionInterface | |||||
{ | { | ||||
return (new self()) | return (new self()) | ||||
->setProperty($propertyName) | ->setProperty($propertyName) | ||||
->setLabel($label) | ->setLabel($label) | ||||
->setTemplatePath('@Sov/crud/field/collection.html.twig') | |||||
->setTemplatePath('@LcSov/crud/field/collection.html.twig') | |||||
->setFormType(CollectionType::class) | ->setFormType(CollectionType::class) | ||||
->addCssClass('field-collection') | ->addCssClass('field-collection') | ||||
->addJsFiles('bundles/lcadmin/js/form-type-collection-array.js') | ->addJsFiles('bundles/lcadmin/js/form-type-collection-array.js') |
return (new self()) | return (new self()) | ||||
->setProperty($propertyName) | ->setProperty($propertyName) | ||||
->setLabel($label) | ->setLabel($label) | ||||
->setTemplatePath('@Sov/crud/field/image.html.twig') | |||||
->setTemplatePath('@LcSov/crud/field/image.html.twig') | |||||
->addJsFiles('bundles/lcadmin/js/form-type-file-manager.js') | ->addJsFiles('bundles/lcadmin/js/form-type-file-manager.js') | ||||
->setFormType(FileManagerType::class) | ->setFormType(FileManagerType::class) | ||||
->addCssClass('field-text') | ->addCssClass('field-text') |
return (new self()) | return (new self()) | ||||
->setProperty($propertyName) | ->setProperty($propertyName) | ||||
->setLabel($label) | ->setLabel($label) | ||||
->setTemplatePath('@Sov/crud/field/collection.html.twig') | |||||
->setTemplatePath('@LcSov/crud/field/collection.html.twig') | |||||
->setFormType(CollectionType::class) | ->setFormType(CollectionType::class) | ||||
->addCssClass('field-collection') | ->addCssClass('field-collection') | ||||
->addJsFiles('bundles/lcadmin/js/form-type-collection.js') | ->addJsFiles('bundles/lcadmin/js/form-type-collection.js') |
namespace Lc\SovBundle; | namespace Lc\SovBundle; | ||||
use Lc\SovBundle\DependencyInjection\SovExtension; | |||||
use Lc\SovBundle\DependencyInjection\LcSovExtension; | |||||
use Symfony\Component\HttpKernel\Bundle\Bundle; | use Symfony\Component\HttpKernel\Bundle\Bundle; | ||||
class SovBundle extends Bundle | |||||
class LcSovBundle extends Bundle | |||||
{ | { | ||||
public function getContainerExtension() | public function getContainerExtension() | ||||
{ | { | ||||
return new SovExtension(); | |||||
return new LcSovExtension(); | |||||
} | } | ||||
} | } |
{% block body_javascript %} | {% block body_javascript %} | ||||
{{ parent() }} | {{ parent() }} | ||||
{% include '@Sov/crud/filemanager/file-manager-modal.html.twig' %} | |||||
{% include '@LcSov/crud/filemanager/file-manager-modal.html.twig' %} | |||||
{% endblock %} | {% endblock %} |
{% block body_javascript %} | {% block body_javascript %} | ||||
{{ parent() }} | {{ parent() }} | ||||
{% include '@Sov/crud/filemanager/file-manager-modal.html.twig' %} | |||||
{% include '@LcSov/crud/filemanager/file-manager-modal.html.twig' %} | |||||
{% endblock %} | {% endblock %} | ||||