From 84a1d750c2bf7f93b10b9492f92aa6fa7eb22657 Mon Sep 17 00:00:00 2001 From: Jakub Brzegowski Date: Tue, 22 Jun 2021 11:52:08 +0200 Subject: [PATCH 1/2] IBX-497: Redesign tabs for 4.0 --- .../themes/admin/system_info/info.html.twig | 4 ++ .../themes/admin/ui/tab/system_info.html.twig | 39 +++++++------------ 2 files changed, 17 insertions(+), 26 deletions(-) diff --git a/src/bundle/Resources/views/themes/admin/system_info/info.html.twig b/src/bundle/Resources/views/themes/admin/system_info/info.html.twig index 6ba57577..94d76bc0 100644 --- a/src/bundle/Resources/views/themes/admin/system_info/info.html.twig +++ b/src/bundle/Resources/views/themes/admin/system_info/info.html.twig @@ -21,3 +21,7 @@ {% block content %} {{ ez_render_component_group('systeminfo-tab-groups') }} {% endblock %} + +{% block javascripts %} + {{ encore_entry_script_tags('ezplatform-admin-ui-tabs-js', null, 'ezplatform') }} +{% endblock %} diff --git a/src/bundle/Resources/views/themes/admin/ui/tab/system_info.html.twig b/src/bundle/Resources/views/themes/admin/ui/tab/system_info.html.twig index bab6a62b..8a6b36b2 100644 --- a/src/bundle/Resources/views/themes/admin/ui/tab/system_info.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/tab/system_info.html.twig @@ -1,26 +1,13 @@ -
-
- -
-
-
- {% for tab in tabs %} - {% set id = group ~ '-' ~ tab.identifier %} - {% set active = loop.first %} - -
- {{ tab.view|raw }} -
- {% endfor %} -
+{% set tabs_to_show = [] %} +{% for tab in tabs %} + {% set tabs_to_show = tabs_to_show|merge([{ + id: group ~ '-' ~ tab.identifier, + label: tab.name, + content: tab.view, + active: loop.first, + }]) %} +{% endfor %} +{% include '@ezdesign/ui/component/tab/tabs.html.twig' with { + tabs: tabs_to_show, + include_tab_more: true, +} %} From 0430d63bfa285632a791807e5d339ca9923b57d0 Mon Sep 17 00:00:00 2001 From: Jakub Brzegowski Date: Fri, 25 Jun 2021 08:53:20 +0200 Subject: [PATCH 2/2] Fixes after CR --- .../themes/admin/ui/tab/system_info.html.twig | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/bundle/Resources/views/themes/admin/ui/tab/system_info.html.twig b/src/bundle/Resources/views/themes/admin/ui/tab/system_info.html.twig index 8a6b36b2..b0b655d6 100644 --- a/src/bundle/Resources/views/themes/admin/ui/tab/system_info.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/tab/system_info.html.twig @@ -1,12 +1,9 @@ -{% set tabs_to_show = [] %} -{% for tab in tabs %} - {% set tabs_to_show = tabs_to_show|merge([{ - id: group ~ '-' ~ tab.identifier, - label: tab.name, - content: tab.view, - active: loop.first, - }]) %} -{% endfor %} +{% set tabs_to_show = tabs|map((tab, index) => { + id: group ~ '-' ~ tab.identifier, + label: tab.name, + content: tab.view, + active: index == 0, +}) %} {% include '@ezdesign/ui/component/tab/tabs.html.twig' with { tabs: tabs_to_show, include_tab_more: true,