-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
402 changed files
with
20,074 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sylius package. | ||
* | ||
* (c) Sylius Sp. z o.o. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Form; | ||
|
||
use App\Entity\Book; | ||
use Symfony\Component\Form\AbstractType; | ||
use Symfony\Component\Form\FormBuilderInterface; | ||
use Symfony\Component\OptionsResolver\OptionsResolver; | ||
|
||
final class BookType extends AbstractType | ||
{ | ||
public function buildForm(FormBuilderInterface $builder, array $options): void | ||
{ | ||
$builder | ||
->add('title') | ||
->add('authorName') | ||
; | ||
} | ||
|
||
public function configureOptions(OptionsResolver $resolver): void | ||
{ | ||
$resolver->setDefaults([ | ||
'data_class' => Book::class, | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sylius package. | ||
* | ||
* (c) Sylius Sp. z o.o. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Menu; | ||
|
||
use Knp\Menu\ItemInterface; | ||
use Sylius\AdminUi\Knp\Menu\MenuBuilderInterface; | ||
use Symfony\Component\DependencyInjection\Attribute\AsDecorator; | ||
|
||
#[AsDecorator(decorates: 'sylius_admin_ui.knp.menu_builder')] | ||
final class AdminMenuBuilder implements MenuBuilderInterface | ||
{ | ||
public function __construct(private MenuBuilderInterface $menuBuilder) | ||
{ | ||
} | ||
|
||
public function createMenu(array $options): ItemInterface | ||
{ | ||
$menu = $this->menuBuilder->createMenu($options); | ||
|
||
$menu | ||
->addChild('dashboard') | ||
->setLabel('sylius.ui.dashboard') | ||
->setLabelAttribute('icon', 'dashboard') | ||
; | ||
|
||
$this->addLibrarySubMenu($menu); | ||
$this->addConfigurationSubMenu($menu); | ||
|
||
return $menu; | ||
} | ||
|
||
private function addLibrarySubMenu(ItemInterface $menu): void | ||
{ | ||
$library = $menu | ||
->addChild('library') | ||
->setLabel('app.ui.library') | ||
->setLabelAttribute('icon', 'users') | ||
; | ||
|
||
$library->addChild('backend_pet', ['route' => 'app_admin_book_index']) | ||
->setLabel('app.ui.books') | ||
->setLabelAttribute('icon', 'book') | ||
; | ||
|
||
$library->addChild('backend_plop') | ||
->setLabel('Authors') | ||
->setLabelAttribute('icon', 'folder') | ||
; | ||
} | ||
|
||
private function addConfigurationSubMenu(ItemInterface $menu): void | ||
{ | ||
$library = $menu | ||
->addChild('configuration') | ||
->setLabel('Configuration') | ||
->setLabelAttribute('icon', 'dashboard') | ||
; | ||
|
||
$library->addChild('backend_channel') | ||
->setLabel('Channels') | ||
->setLabelAttribute('icon', 'shuffle'); | ||
|
||
$library->addChild('backend_countries') | ||
->setLabel('Countries') | ||
->setLabelAttribute('icon', 'flag'); | ||
|
||
$library->addChild('backend_zones') | ||
->setLabel('Zones') | ||
->setLabelAttribute('icon', 'globe'); | ||
|
||
$library->addChild('backend_administrators') | ||
->setLabel('Admin Users') | ||
->setLabelAttribute('icon', 'lock'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sylius package. | ||
* | ||
* (c) Sylius Sp. z o.o. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Twig\Component\Book; | ||
|
||
use App\Entity\Book; | ||
use App\Form\BookType; | ||
use Sylius\TwigHooks\LiveComponent\HookableLiveComponentTrait; | ||
use Symfony\Component\Form\FormFactoryInterface; | ||
use Symfony\Component\Form\FormInterface; | ||
use Symfony\UX\LiveComponent\Attribute\AsLiveComponent; | ||
use Symfony\UX\LiveComponent\Attribute\LiveProp; | ||
use Symfony\UX\LiveComponent\ComponentWithFormTrait; | ||
use Symfony\UX\LiveComponent\DefaultActionTrait; | ||
|
||
#[AsLiveComponent(template: '@SyliusBootstrapTheme/shared/crud/common/content/form.html.twig')] | ||
final class BookFormComponent | ||
{ | ||
use ComponentWithFormTrait; | ||
use DefaultActionTrait; | ||
use HookableLiveComponentTrait; | ||
|
||
#[LiveProp(fieldName: 'formData')] | ||
public ?Book $resource = null; | ||
|
||
public function __construct( | ||
private readonly FormFactoryInterface $formFactory, | ||
) { | ||
} | ||
|
||
protected function instantiateForm(): FormInterface | ||
{ | ||
return $this->formFactory->create(BookType::class, $this->resource); | ||
} | ||
|
||
private function getDataModelValue(): ?string | ||
{ | ||
return 'norender|*'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* This file is part of the Sylius package. | ||
* | ||
* (c) Sylius Sp. z o.o. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
import {startStimulusApp} from '@symfony/stimulus-bridge'; | ||
import LiveController from '@symfony/ux-live-component'; | ||
import '@symfony/ux-live-component/styles/live.css'; | ||
|
||
// 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, | ||
/\.[jt]sx?$/ | ||
)); | ||
|
||
app.register('live', LiveController); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"controllers": {}, | ||
"entrypoints": [] | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* This file is part of the Sylius package. | ||
* | ||
* (c) Sylius Sp. z o.o. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
import './styles/main.scss'; | ||
|
||
import './bootstrap'; | ||
|
||
import './scripts/bulk-delete'; | ||
import './scripts/check-all'; | ||
import './scripts/choices'; | ||
import './scripts/menu-search'; | ||
import './scripts/sticky-header'; | ||
import './scripts/tree'; | ||
|
||
import './scripts/bootstrap'; |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.