From c9778075431f4bab838ed2e653d25259e91548af Mon Sep 17 00:00:00 2001 From: Michal Dabrowski Date: Fri, 15 Nov 2024 15:45:48 +0100 Subject: [PATCH] move menuitem from list to tabs --- .gitignore | 1 + config/routing/shop_routing.yaml | 12 +++------ src/Menu/Shop/AccountMenuListener.php | 7 +---- templates/Shop/Account/index.html.twig | 37 ++++++++++++++++++++++++++ 4 files changed, 42 insertions(+), 15 deletions(-) create mode 100644 templates/Shop/Account/index.html.twig diff --git a/.gitignore b/.gitignore index c03bd0e..fb25d8e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /etc/build/* !/etc/build/.gitignore +/.idea /tests/Application/yarn.lock diff --git a/config/routing/shop_routing.yaml b/config/routing/shop_routing.yaml index 880f129..1150b84 100644 --- a/config/routing/shop_routing.yaml +++ b/config/routing/shop_routing.yaml @@ -1,11 +1,5 @@ -speardevs_push_notifications_section: - path: /account/push-notifications - defaults: - _controller: 'SpearDevs\SyliusPushNotificationsPlugin\Controller\Shop\PushNotificationAction' - template: '@SpearDevsSyliusPushNotificationsPlugin/Shop/Account/push_notification.html.twig' - -speardevs_push_notifications_history_index: - path: /account/push-notifications-history +speardevs_push_notifications: + path: /account/push-notifications-section methods: [ GET ] defaults: _controller: speardevs_sylius_push_notifications_plugin.controller.push_notification_history::indexAction @@ -16,7 +10,7 @@ speardevs_push_notifications_history_index: grid: speardevs_push_notification_history section: shop_account permission: true - template: '@SpearDevsSyliusPushNotificationsPlugin/Shop/Account/push_notification_history.html.twig' + template: '@SpearDevsSyliusPushNotificationsPlugin/Shop/Account/index.html.twig' repository: method: findByCustomer arguments: diff --git a/src/Menu/Shop/AccountMenuListener.php b/src/Menu/Shop/AccountMenuListener.php index faeb79f..6d549e1 100644 --- a/src/Menu/Shop/AccountMenuListener.php +++ b/src/Menu/Shop/AccountMenuListener.php @@ -13,13 +13,8 @@ public function addAccountMenuItems(MenuBuilderEvent $event): void $menu = $event->getMenu(); $menu - ->addChild('push_notification_section', ['route' => 'speardevs_push_notifications_section']) + ->addChild('push_notification_section', ['route' => 'speardevs_push_notifications']) ->setLabel('speardevs_sylius_push_notifications_plugin.ui.my_account.push_notifications') ->setLabelAttribute('icon', 'star'); - - $menu - ->addChild('push_notification_history', ['route' => 'speardevs_push_notifications_history_index']) - ->setLabel('speardevs_sylius_push_notifications_plugin.ui.my_account.push_notification_history') - ->setLabelAttribute('icon', 'history'); } } diff --git a/templates/Shop/Account/index.html.twig b/templates/Shop/Account/index.html.twig new file mode 100644 index 0000000..8d44f0f --- /dev/null +++ b/templates/Shop/Account/index.html.twig @@ -0,0 +1,37 @@ +{% extends '@SyliusShop/Account/RefundationDocument/layout.html.twig' %} + +{% import '@SyliusUi/Macro/messages.html.twig' as messages %} +{% import '@SyliusUi/Macro/pagination.html.twig' as pagination %} +{% import '@SyliusShop/Common/Macro/headers.html.twig' as headers %} +{% import "@SyliusShop/Common/Macro/icons.html.twig" as icons %} + +{% block turbo_frame_content %} + + {{ block('grid_navigation') }} + +
+
+ {{ include('@SpearDevsSyliusPushNotificationsPlugin/Shop/Account/push_notification.html.twig') }} +
+
+ {{ include('@SpearDevsSyliusPushNotificationsPlugin/Shop/Account/push_notification_history.html.twig') }} +
+
+{% endblock %} + +{% block grid_navigation %} + {% set verified = resources.parameters.get('criteria').verified|default(null) %} + + +{% endblock %}