From 298a8e32dff58cd1e4fe806c1760a41211e36500 Mon Sep 17 00:00:00 2001 From: Dariusz Szut Date: Thu, 9 Dec 2021 12:28:41 +0100 Subject: [PATCH 1/2] IBX-1402: Changed layout in content type group create and edit --- .../translations/content_type.en.xliff | 20 ++++----- .../Resources/translations/forms.en.xliff | 20 +++++++++ .../content_type_group/base.html.twig | 21 ++++------ .../content_type_group/create.html.twig | 36 ++++++---------- .../content_type_group/edit.html.twig | 41 ++++++------------- .../ui/on_the_fly/edit_on_the_fly.html.twig | 2 +- 6 files changed, 65 insertions(+), 75 deletions(-) diff --git a/src/bundle/Resources/translations/content_type.en.xliff b/src/bundle/Resources/translations/content_type.en.xliff index 46cca65685..859e3434ea 100644 --- a/src/bundle/Resources/translations/content_type.en.xliff +++ b/src/bundle/Resources/translations/content_type.en.xliff @@ -366,16 +366,6 @@ %name% key: content_type.view.view.title - - Creating a new Content Type group - Creating a new Content Type group - key: content_type_group.breadcrumb.add - - - Editing Content Type group '%identifier%' - Editing Content Type group '%identifier%' - key: content_type_group.breadcrumb.edit - Content Types Content Types @@ -401,6 +391,11 @@ Created Content Type group '%name%'. key: content_type_group.create.success + + Creating + Creating + key: content_type_group.creating + Delete Delete @@ -466,6 +461,11 @@ %identifier% key: content_type_group.view.view.title + + Editing + Editing + key: editing + Description Description diff --git a/src/bundle/Resources/translations/forms.en.xliff b/src/bundle/Resources/translations/forms.en.xliff index a3b7c97bb8..9b7352d81d 100644 --- a/src/bundle/Resources/translations/forms.en.xliff +++ b/src/bundle/Resources/translations/forms.en.xliff @@ -186,6 +186,26 @@ Content Type / Update key: role.policy.class.update + + Commerce + Commerce + key: role.policy.commerce + + + Commerce / All functions + Commerce / All functions + key: role.policy.commerce.all_functions + + + Commerce / Currency + Commerce / Currency + key: role.policy.commerce.currency + + + Commerce / Region + Commerce / Region + key: role.policy.commerce.region + Comparison Comparison diff --git a/src/bundle/Resources/views/themes/admin/content_type/content_type_group/base.html.twig b/src/bundle/Resources/views/themes/admin/content_type/content_type_group/base.html.twig index bd0aeedc96..059e3143b7 100644 --- a/src/bundle/Resources/views/themes/admin/content_type/content_type_group/base.html.twig +++ b/src/bundle/Resources/views/themes/admin/content_type/content_type_group/base.html.twig @@ -1,26 +1,21 @@ -{% extends '@ibexadesign/ui/layout.html.twig' %} +{% extends '@ibexadesign/ui/edit_base.html.twig' %} {% trans_default_domain 'content_type' %} -{% block breadcrumbs %} - {% block breadcrumbs_admin %}{% endblock %} -{% endblock %} +{% block main_container_class %}ibexa-main-container--edit-container ibexa-main-container--without-anchor-menu-items{% endblock %} -{% block context_menu %} - {% block context_menu_admin %}{% endblock %} -{% endblock %} +{% set anchor_params = { + close_href: path('ezplatform.content_type_group.list'), +} %} {% block header %} {% block header_admin %}{% endblock %} {% endblock %} {% block content %} -
-
-
- {% block form %} - {% endblock %} -
+
+
+ {% block form %}{% endblock %}
{% endblock %} diff --git a/src/bundle/Resources/views/themes/admin/content_type/content_type_group/create.html.twig b/src/bundle/Resources/views/themes/admin/content_type/content_type_group/create.html.twig index cc3c573261..ccba02f551 100644 --- a/src/bundle/Resources/views/themes/admin/content_type/content_type_group/create.html.twig +++ b/src/bundle/Resources/views/themes/admin/content_type/content_type_group/create.html.twig @@ -4,37 +4,27 @@ {% trans_default_domain 'content_type' %} -{% block breadcrumbs_admin %} - {% include '@ibexadesign/ui/breadcrumbs.html.twig' with { items: [ - { value: 'breadcrumb.admin'|trans(domain='messages')|desc('Admin') }, - { url: path('ezplatform.content_type_group.list'), value: 'content_type_group.breadcrumb.list'|trans|desc('Content Types') }, - { value: 'content_type_group.breadcrumb.add'|trans|desc('Creating a new Content Type group') } - ]} %} -{% endblock %} - -{% block context_menu_admin %} +{% block header_admin %} {% set content_type_group_create_sidebar_right = knp_menu_get('ezplatform_admin_ui.menu.content_type_group_create.sidebar_right') %} - {{ knp_menu_render(content_type_group_create_sidebar_right, {'template': '@ibexadesign/ui/menu/context_menu.html.twig'}) }} -{% endblock %} -{% block header_admin %} - {% include '@ibexadesign/ui/page_title.html.twig' with { + {% include '@ibexadesign/ui/edit_header.html.twig' with { + action_name: 'content_type_group.creating'|trans|desc('Creating'), + icon_name: 'file', title: 'content_type_group.view.add.title'|trans|desc('Creating a new Content Type group'), + show_autosave_status: false, + context_actions: knp_menu_render(content_type_group_create_sidebar_right, {'template': '@ibexadesign/ui/menu/context_menu.html.twig'}) } %} {% endblock %} {% block form %} {{ form_start(form) }} - -
-
-
- {{ form_row(form.identifier, {'attr': {'autofocus': 'autofocus'}}) }} +
+
+
+ {{ form_row(form.identifier, {'attr': {'autofocus': 'autofocus'}}) }} +
-
-
- - {{ form_widget(form.create, {'attr': {'hidden': 'hidden'}}) }} - + + {{ form_widget(form.create, {'attr': {'hidden': 'hidden'}}) }} {{ form_end(form) }} {% endblock %} diff --git a/src/bundle/Resources/views/themes/admin/content_type/content_type_group/edit.html.twig b/src/bundle/Resources/views/themes/admin/content_type/content_type_group/edit.html.twig index 2acbb11ead..334b26b76e 100644 --- a/src/bundle/Resources/views/themes/admin/content_type/content_type_group/edit.html.twig +++ b/src/bundle/Resources/views/themes/admin/content_type/content_type_group/edit.html.twig @@ -4,42 +4,27 @@ {% trans_default_domain 'content_type' %} -{% block breadcrumbs_admin %} - {% include '@ibexadesign/ui/breadcrumbs.html.twig' with { items: [ - { value: 'breadcrumb.admin'|trans(domain='messages')|desc('Admin') }, - { url: path('ezplatform.content_type_group.list'), value: 'content_type_group.breadcrumb.list'|trans|desc('Content Types') }, - { value: 'content_type_group.breadcrumb.edit'|trans({ '%identifier%': content_type_group.identifier })|desc('Editing Content Type group \'%identifier%\'') } - ]} %} -{% endblock %} - -{% block context_menu_admin %} +{% block header_admin %} {% set content_type_group_edit_sidebar_right = knp_menu_get('ezplatform_admin_ui.menu.content_type_group_edit.sidebar_right', [], {'save_id': form.update.vars.id}) %} - {{ knp_menu_render(content_type_group_edit_sidebar_right, {'template': '@ibexadesign/ui/menu/context_menu.html.twig'}) }} -{% endblock %} -{% block header_admin %} - {% include '@ibexadesign/ui/page_title.html.twig' with { + {% include '@ibexadesign/ui/edit_header.html.twig' with { + action_name: 'editing'|trans|desc('Editing'), + icon_name: 'file', title: 'content_type_group.view.edit.title'|trans({'%identifier%': content_type_group.identifier})|desc('Editing Content Type group \'%identifier%\''), + show_autosave_status: false, + context_actions: knp_menu_render(content_type_group_edit_sidebar_right, {'template': '@ibexadesign/ui/menu/context_menu.html.twig'}) } %} {% endblock %} {% block form %} {{ form_start(form) }} - -
-
-
- {{ form_row(form.identifier) }} +
+
+
+ {{ form_row(form.identifier) }} +
-
-
- - {{ form_widget(form.update, {'attr': {'hidden': 'hidden'}}) }} - + + {{ form_widget(form.update, {'attr': {'hidden': 'hidden'}}) }} {{ form_end(form) }} {% endblock %} - -{% block right_sidebar %} - {% set content_type_group_edit_sidebar_right = knp_menu_get('ezplatform_admin_ui.menu.content_type_group_edit.sidebar_right', [], {'save_id': form.update.vars.id}) %} - {{ knp_menu_render(content_type_group_edit_sidebar_right, {'template': '@ibexadesign/ui/menu/context_menu.html.twig'}) }} -{% endblock %} diff --git a/src/bundle/Resources/views/themes/admin/ui/on_the_fly/edit_on_the_fly.html.twig b/src/bundle/Resources/views/themes/admin/ui/on_the_fly/edit_on_the_fly.html.twig index cecf1b7bff..a77d2f4162 100644 --- a/src/bundle/Resources/views/themes/admin/ui/on_the_fly/edit_on_the_fly.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/on_the_fly/edit_on_the_fly.html.twig @@ -17,7 +17,7 @@ icon_name: 'content-type', show_autosave_status: true, description: content_type.description, - subtitle: 'editing_details'|trans({ '%location_name%': parent_location.contentInfo.name })|desc('under %location_name%'), + subtitle: 'editing_details'|trans({ '%location_name%': parent_location.contentInfo.name, '%language%': language.name })|desc('under %location_name% in %language%'), } %} {% endblock %} From e15c303e798073275b604dee532ccc3a1bf442b2 Mon Sep 17 00:00:00 2001 From: Dariusz Szut Date: Thu, 9 Dec 2021 13:16:27 +0100 Subject: [PATCH 2/2] Update src/bundle/Resources/views/themes/admin/content_type/content_type_group/create.html.twig Co-authored-by: Jakub Brzegowski --- .../admin/content_type/content_type_group/create.html.twig | 1 - 1 file changed, 1 deletion(-) diff --git a/src/bundle/Resources/views/themes/admin/content_type/content_type_group/create.html.twig b/src/bundle/Resources/views/themes/admin/content_type/content_type_group/create.html.twig index ccba02f551..228a52bdf6 100644 --- a/src/bundle/Resources/views/themes/admin/content_type/content_type_group/create.html.twig +++ b/src/bundle/Resources/views/themes/admin/content_type/content_type_group/create.html.twig @@ -11,7 +11,6 @@ action_name: 'content_type_group.creating'|trans|desc('Creating'), icon_name: 'file', title: 'content_type_group.view.add.title'|trans|desc('Creating a new Content Type group'), - show_autosave_status: false, context_actions: knp_menu_render(content_type_group_create_sidebar_right, {'template': '@ibexadesign/ui/menu/context_menu.html.twig'}) } %} {% endblock %}