From c39b7529690acd5e4c9bbb315d24b45c7d1e7f57 Mon Sep 17 00:00:00 2001 From: Maciej Kobus Date: Wed, 20 Dec 2017 08:13:27 +0100 Subject: [PATCH] EZP-28638: All forms in AdminUI should use Bootstrap 4 theme --- .../public/js/scripts/fieldType/eztext.js | 2 +- .../js/scripts/sidebar/btn/location.create.js | 2 +- .../public/js/scripts/sidebar/btn/location.edit.js | 2 +- .../Resources/public/scss/_extra-actions.scss | 7 ++++--- src/bundle/Resources/public/scss/_forms.scss | 5 +++-- .../Resources/views/Security/login.html.twig | 5 ++++- .../views/admin/content_type/create.html.twig | 2 +- .../views/admin/content_type/edit.html.twig | 1 + .../views/admin/content_type/list.html.twig | 2 ++ .../admin/content_type_group/create.html.twig | 2 ++ .../views/admin/content_type_group/edit.html.twig | 2 ++ .../views/admin/content_type_group/list.html.twig | 2 ++ .../views/admin/language/create.html.twig | 2 ++ .../Resources/views/admin/language/edit.html.twig | 2 ++ .../Resources/views/admin/language/list.html.twig | 2 ++ .../Resources/views/admin/language/view.html.twig | 2 ++ .../Resources/views/admin/policy/add.html.twig | 2 ++ .../Resources/views/admin/policy/edit.html.twig | 2 ++ .../Resources/views/admin/policy/list.html.twig | 2 ++ .../Resources/views/admin/role/add.html.twig | 2 ++ .../Resources/views/admin/role/list.html.twig | 2 +- .../views/admin/role_assignment/create.html.twig | 2 ++ .../views/admin/role_assignment/list.html.twig | 2 ++ .../Resources/views/admin/search/list.html.twig | 2 +- .../Resources/views/admin/search/search.html.twig | 4 +++- .../views/admin/search/search_form.html.twig | 4 +++- .../views/admin/section/assigned_content.html.twig | 2 +- .../Resources/views/admin/section/create.html.twig | 2 ++ .../section/delete_confirmation_modal.html.twig | 6 ++++-- .../Resources/views/admin/section/list.html.twig | 4 ++++ .../Resources/views/admin/section/update.html.twig | 2 ++ .../Resources/views/admin/section/view.html.twig | 2 -- .../trash/empty_trash_confirmation_modal.html.twig | 4 ++-- .../views/bulk_delete_confirmation_modal.html.twig | 6 +++--- .../Resources/views/content/form_fields.html.twig | 2 +- .../Resources/views/content/locationview.html.twig | 6 +++--- .../views/content/modal_location_trash.html.twig | 2 +- .../Resources/views/content/tab/details.html.twig | 12 +++++++----- .../content/tab/locations/panel_swap.html.twig | 4 +++- .../views/content/tab/locations/tab.html.twig | 2 +- .../translations/modal_add_translation.html.twig | 2 +- .../views/content/tab/versions/tab.html.twig | 10 ++++++---- src/bundle/Resources/views/form_fields.html.twig | 4 +++- .../Resources/views/link_manager/edit.html.twig | 2 ++ .../Resources/views/link_manager/list.html.twig | 8 +++++--- src/lib/Form/Type/Location/LocationUpdateType.php | 14 ++++++++++---- 46 files changed, 113 insertions(+), 49 deletions(-) diff --git a/src/bundle/Resources/public/js/scripts/fieldType/eztext.js b/src/bundle/Resources/public/js/scripts/fieldType/eztext.js index 249e76c53c..c4940195aa 100644 --- a/src/bundle/Resources/public/js/scripts/fieldType/eztext.js +++ b/src/bundle/Resources/public/js/scripts/fieldType/eztext.js @@ -20,7 +20,7 @@ errorMessage }; } - }; + } const validator = new EzTextValidator({ classInvalid: 'is-invalid', diff --git a/src/bundle/Resources/public/js/scripts/sidebar/btn/location.create.js b/src/bundle/Resources/public/js/scripts/sidebar/btn/location.create.js index 033c73c8f6..76708f2f0d 100644 --- a/src/bundle/Resources/public/js/scripts/sidebar/btn/location.create.js +++ b/src/bundle/Resources/public/js/scripts/sidebar/btn/location.create.js @@ -1,6 +1,6 @@ (function () { const createActions = document.querySelector('.ez-extra-actions--create'); - const btns = [...createActions.querySelectorAll('.radio [type="radio"]')]; + const btns = [...createActions.querySelectorAll('.form-check [type="radio"]')]; const form = createActions.querySelector('form'); btns.forEach(btn => btn.addEventListener('change', () => form.submit(), false)); diff --git a/src/bundle/Resources/public/js/scripts/sidebar/btn/location.edit.js b/src/bundle/Resources/public/js/scripts/sidebar/btn/location.edit.js index f82c06b6ed..5dfd030f72 100644 --- a/src/bundle/Resources/public/js/scripts/sidebar/btn/location.edit.js +++ b/src/bundle/Resources/public/js/scripts/sidebar/btn/location.edit.js @@ -1,6 +1,6 @@ (function () { const editActions = document.querySelector('.ez-extra-actions--edit'); - const btns = [...editActions.querySelectorAll('.radio [type="radio"]')]; + const btns = [...editActions.querySelectorAll('.form-check [type="radio"]')]; const form = editActions.querySelector('form'); btns.forEach(btn => btn.addEventListener('change', () => form.submit(), false)); diff --git a/src/bundle/Resources/public/scss/_extra-actions.scss b/src/bundle/Resources/public/scss/_extra-actions.scss index 5527ff88f7..618f62a573 100644 --- a/src/bundle/Resources/public/scss/_extra-actions.scss +++ b/src/bundle/Resources/public/scss/_extra-actions.scss @@ -54,7 +54,7 @@ overflow: auto; } - .radio { + .form-check { display: block; background: none; border: 0 none; @@ -68,6 +68,7 @@ text-decoration: none; cursor: pointer; transition: all .2s $ez-admin-transition; + margin-bottom: 0; &:hover, &:focus { @@ -119,11 +120,11 @@ padding: 0; } - .radio { + .form-check { cursor: pointer; background: $ez-white; transition: all .2s $ez-admin-transition; - padding-left: 1.5rem; + margin-bottom: 0; &:hover, &:focus { diff --git a/src/bundle/Resources/public/scss/_forms.scss b/src/bundle/Resources/public/scss/_forms.scss index 7c31b0aa77..c822e5900d 100644 --- a/src/bundle/Resources/public/scss/_forms.scss +++ b/src/bundle/Resources/public/scss/_forms.scss @@ -1,4 +1,4 @@ -*:not(.form-inline) { +form:not(.form-inline) { .form-control-label { font-weight: 700; font-size: 14px; @@ -34,7 +34,8 @@ .ez-form-inline { .control-label, - .form-control { + .form-control, + .form-control-label { margin-right: .5rem; } } diff --git a/src/bundle/Resources/views/Security/login.html.twig b/src/bundle/Resources/views/Security/login.html.twig index b9ac9aa9d8..6762251e77 100644 --- a/src/bundle/Resources/views/Security/login.html.twig +++ b/src/bundle/Resources/views/Security/login.html.twig @@ -14,7 +14,10 @@
-
+ {% if error %} + {{ error.message }} + {% endif %} +
diff --git a/src/bundle/Resources/views/admin/content_type/create.html.twig b/src/bundle/Resources/views/admin/content_type/create.html.twig index 33cef441f8..928ef672a8 100644 --- a/src/bundle/Resources/views/admin/content_type/create.html.twig +++ b/src/bundle/Resources/views/admin/content_type/create.html.twig @@ -2,7 +2,7 @@ {% trans_default_domain 'content_type' %} -{% form_theme form _self %} +{% form_theme form _self '@EzPlatformAdminUi/form_fields.html.twig' %} {% block _ezrepoforms_contenttype_update_removeFieldDefinition_widget %} - {{ form_widget(form.delete, {'attr': {'class': 'btn btn-danger', 'disabled': not deletable}}) }} + {{ form_widget(form.delete, {'attr': {'class': 'btn-danger', 'disabled': not deletable}}) }} {{ form_end(form) }}
diff --git a/src/bundle/Resources/views/admin/section/list.html.twig b/src/bundle/Resources/views/admin/section/list.html.twig index 3c45147720..fb172581f6 100644 --- a/src/bundle/Resources/views/admin/section/list.html.twig +++ b/src/bundle/Resources/views/admin/section/list.html.twig @@ -1,4 +1,8 @@ {% extends 'EzPlatformAdminUiBundle::layout.html.twig' %} + +{% form_theme form_sections_delete '@EzPlatformAdminUi/form_fields.html.twig' %} +{% form_theme form_section_content_assign '@EzPlatformAdminUi/form_fields.html.twig' %} + {% trans_default_domain 'section' %} {% block body_class %}ez-section-list-view{% endblock %} diff --git a/src/bundle/Resources/views/admin/section/update.html.twig b/src/bundle/Resources/views/admin/section/update.html.twig index e136d6a35f..4c545e46d6 100644 --- a/src/bundle/Resources/views/admin/section/update.html.twig +++ b/src/bundle/Resources/views/admin/section/update.html.twig @@ -1,5 +1,7 @@ {% extends 'EzPlatformAdminUiBundle:admin/section:base.html.twig' %} +{% form_theme form_section_update '@EzPlatformAdminUi/form_fields.html.twig' %} + {% trans_default_domain 'section' %} {% block breadcrumbs_admin %} diff --git a/src/bundle/Resources/views/admin/section/view.html.twig b/src/bundle/Resources/views/admin/section/view.html.twig index 1cf44b7a44..4787c70a38 100644 --- a/src/bundle/Resources/views/admin/section/view.html.twig +++ b/src/bundle/Resources/views/admin/section/view.html.twig @@ -2,8 +2,6 @@ {% trans_default_domain 'section' %} -{% form_theme form_section_delete 'EzPlatformAdminUiBundle:parts/form:flat_widgets.html.twig' %} - {% block body_class %}ez-section-view{% endblock %} {% block breadcrumbs %} diff --git a/src/bundle/Resources/views/admin/trash/empty_trash_confirmation_modal.html.twig b/src/bundle/Resources/views/admin/trash/empty_trash_confirmation_modal.html.twig index 8550310ee7..af07578030 100644 --- a/src/bundle/Resources/views/admin/trash/empty_trash_confirmation_modal.html.twig +++ b/src/bundle/Resources/views/admin/trash/empty_trash_confirmation_modal.html.twig @@ -1,4 +1,4 @@ -{% form_theme form 'EzPlatformAdminUiBundle:parts/form:flat_widgets.html.twig' %} +{% form_theme form '@EzPlatformAdminUi/form_fields.html.twig' %} diff --git a/src/bundle/Resources/views/bulk_delete_confirmation_modal.html.twig b/src/bundle/Resources/views/bulk_delete_confirmation_modal.html.twig index 8265bd4a64..4e28b5aec3 100644 --- a/src/bundle/Resources/views/bulk_delete_confirmation_modal.html.twig +++ b/src/bundle/Resources/views/bulk_delete_confirmation_modal.html.twig @@ -11,12 +11,12 @@

{{ message }}

diff --git a/src/bundle/Resources/views/content/form_fields.html.twig b/src/bundle/Resources/views/content/form_fields.html.twig index 4f1950b4ea..124ac2de6c 100644 --- a/src/bundle/Resources/views/content/form_fields.html.twig +++ b/src/bundle/Resources/views/content/form_fields.html.twig @@ -1,4 +1,4 @@ -{% use "bootstrap_4_layout.html.twig" %} +{% use 'bootstrap_4_layout.html.twig' %} {# specific fieldtypes theming #} {% use 'EzPlatformAdminUiBundle:fieldtypes:ezauthor.html.twig' %} diff --git a/src/bundle/Resources/views/content/locationview.html.twig b/src/bundle/Resources/views/content/locationview.html.twig index ec6ae1bc07..6bc676f585 100644 --- a/src/bundle/Resources/views/content/locationview.html.twig +++ b/src/bundle/Resources/views/content/locationview.html.twig @@ -3,9 +3,9 @@ {% trans_default_domain 'locationview' %} {% form_theme form_location_copy '@EzPlatformAdminUi/parts/form/flat_widgets.html.twig' %} {% form_theme form_location_move '@EzPlatformAdminUi/parts/form/flat_widgets.html.twig' %} -{% form_theme form_location_trash '@EzPlatformAdminUi/parts/form/flat_widgets.html.twig' %} -{% form_theme form_content_edit '@EzPlatformAdminUi/parts/form/flat_widgets.html.twig' %} -{% form_theme form_content_create '@EzPlatformAdminUi/parts/form/flat_widgets.html.twig' '@EzPlatformAdminUi/form_fields.html.twig' %} +{% form_theme form_location_trash '@EzPlatformAdminUi/form_fields.html.twig' %} +{% form_theme form_content_edit '@EzPlatformAdminUi/form_fields.html.twig' %} +{% form_theme form_content_create '@EzPlatformAdminUi/form_fields.html.twig' %} {% block body_class %}ez-content-view{% endblock %} diff --git a/src/bundle/Resources/views/content/modal_location_trash.html.twig b/src/bundle/Resources/views/content/modal_location_trash.html.twig index fbb7ef35f4..116c9b4f1a 100644 --- a/src/bundle/Resources/views/content/modal_location_trash.html.twig +++ b/src/bundle/Resources/views/content/modal_location_trash.html.twig @@ -16,7 +16,7 @@ - {{ form_widget(form.trash, {'attr': {'class': 'btn btn-danger'}}) }} + {{ form_widget(form.trash, {'attr': {'class': 'btn-danger'}}) }} {{ form_end(form) }} diff --git a/src/bundle/Resources/views/content/tab/details.html.twig b/src/bundle/Resources/views/content/tab/details.html.twig index f87e8b2ac1..6954b6de5d 100644 --- a/src/bundle/Resources/views/content/tab/details.html.twig +++ b/src/bundle/Resources/views/content/tab/details.html.twig @@ -2,7 +2,7 @@ {% include '@EzPlatformAdminUi/parts/table_header.html.twig' with { headerText: 'tab.details.content_details'|trans()|desc('Content details') } %} -{% form_theme form_location_update '@EzPlatformAdminUi/parts/form/flat_widgets.html.twig' %} +{% form_theme form_location_update '@EzPlatformAdminUi/form_fields.html.twig' %} @@ -115,11 +115,13 @@ 'attr': {'class': 'form-inline ez-form-inline'} }) }} - {{ form_widget(form_location_update) }} + {{ form_label(form_location_update.sort_field, 'tab.details.sub_items_listing_by.order_by'|trans|desc('Order by')) }} + {{ form_widget(form_location_update.sort_field) }} - + {{ form_label(form_location_update.sort_order, 'tab.details.sub_items_listing_by.in'|trans|desc('in')) }} + {{ form_widget(form_location_update.sort_order) }} + + {{ form_widget(form_location_update.update, { 'label': 'tab.details.sub_items_listing_by_set'|trans|desc('Set'), 'translation_domain': false, 'attr': {'class': 'btn-secondary ml-1'} }) }} {{ form_end(form_location_update) }} diff --git a/src/bundle/Resources/views/content/tab/locations/panel_swap.html.twig b/src/bundle/Resources/views/content/tab/locations/panel_swap.html.twig index 56b253265c..586ed527d0 100644 --- a/src/bundle/Resources/views/content/tab/locations/panel_swap.html.twig +++ b/src/bundle/Resources/views/content/tab/locations/panel_swap.html.twig @@ -1,3 +1,5 @@ +{% form_theme form '@EzPlatformAdminUi/form_fields.html.twig' %} + {% include '@EzPlatformAdminUi/parts/table_header.html.twig' with { headerText: 'tab.locations.location_content_swap'|trans()|desc('Location Content Swap'), ground: 'ground-base' @@ -9,7 +11,7 @@ diff --git a/src/bundle/Resources/views/content/tab/locations/tab.html.twig b/src/bundle/Resources/views/content/tab/locations/tab.html.twig index 02e9e5fda3..ec1eb52a64 100644 --- a/src/bundle/Resources/views/content/tab/locations/tab.html.twig +++ b/src/bundle/Resources/views/content/tab/locations/tab.html.twig @@ -58,8 +58,8 @@ {{ form_end(form_content_location_remove) }} {{ form(form_content_location_update_visibility, {'action': path('ezplatform.location.update_visibility')})}} - {{ form(form_content_location_main_update, {'action': path('ezplatform.content.update_main_location')})}} + {% include 'EzPlatformAdminUiBundle:content/tab/locations:panel_swap.html.twig' with {'form': form_content_location_swap} %} diff --git a/src/bundle/Resources/views/content/tab/translations/modal_add_translation.html.twig b/src/bundle/Resources/views/content/tab/translations/modal_add_translation.html.twig index 69accc9d7e..3974b5408e 100644 --- a/src/bundle/Resources/views/content/tab/translations/modal_add_translation.html.twig +++ b/src/bundle/Resources/views/content/tab/translations/modal_add_translation.html.twig @@ -1,5 +1,5 @@ {% trans_default_domain 'locationview' %} -{% form_theme form '@EzPlatformAdminUi/parts/form/flat_widgets.html.twig' '@EzPlatformAdminUi/content/tab/translations/translation_add_form_fields.html.twig' %} +{% form_theme form '@EzPlatformAdminUi/form_fields.html.twig' '@EzPlatformAdminUi/content/tab/translations/translation_add_form_fields.html.twig' %}
{{ 'tab.locations.swap_with_another'|trans()|desc('Swap the content item at this location with another') }} - {{ form_widget(form.swap, {'attr': {'class': 'btn btn-outline-secondary btn--udw-swap ml-5', 'data-root-location': '2'}}) }} + {{ form_widget(form.swap, {'attr': {'class': 'btn-outline-secondary btn--udw-swap ml-5', 'data-root-location': '1'}}) }} {{ form_widget(form.current_location) }} {{ form_widget(form.new_location) }}