diff --git a/src/bundle/Resources/encore/ez.js.config.js b/src/bundle/Resources/encore/ez.js.config.js index 3dcf122fde..a3b5491913 100644 --- a/src/bundle/Resources/encore/ez.js.config.js +++ b/src/bundle/Resources/encore/ez.js.config.js @@ -27,6 +27,7 @@ const layout = [ path.resolve(__dirname, '../public/js/scripts/admin.notifications.js'), path.resolve(__dirname, '../public/js/scripts/button.trigger.js'), path.resolve(__dirname, '../public/js/scripts/button.prevent.default.js'), + path.resolve(__dirname, '../public/js/scripts/toggle.button.state.toggle.js'), path.resolve(__dirname, '../public/js/scripts/udw/browse.js'), path.resolve(__dirname, '../public/js/scripts/admin.user.menu.js'), path.resolve(__dirname, '../public/js/scripts/admin.prevent.click.js'), @@ -177,7 +178,6 @@ module.exports = (Encore) => { path.resolve(__dirname, '../public/js/scripts/fieldType/base/multi-input-field.js'), ...fieldTypes, path.resolve(__dirname, '../public/js/scripts/sidebar/extra.actions.js'), - path.resolve(__dirname, '../public/js/scripts/toggle.button.state.toggle.js'), path.resolve(__dirname, '../public/js/scripts/edit.header.js'), ]) .addEntry('ezplatform-admin-ui-settings-datetime-format-update-js', [ @@ -207,7 +207,7 @@ module.exports = (Encore) => { path.resolve(__dirname, '../../ui-dev/src/modules/universal-discovery/components/view-switcher/view.switcher.js'), path.resolve( __dirname, - '../../ui-dev/src/modules/universal-discovery/components/tree-item-toggle-selection/tree.item.toggle.selection.js', + '../../ui-dev/src/modules/universal-discovery/components/tree-item-toggle-selection/tree.item.toggle.selection.js' ), ]) .addEntry('ezplatform-admin-ui-mfu-js', [ @@ -220,17 +220,11 @@ module.exports = (Encore) => { .addEntry('ezplatform-admin-ui-url-management-js', [ path.resolve(__dirname, '../public/js/scripts/button.state.toggle.js'), path.resolve(__dirname, '../public/js/scripts/admin.url.wildcards.create.js'), - path.resolve(__dirname, '../public/js/scripts/toggle.button.state.toggle.js'), - ]) - .addEntry('ezplatform-admin-ui-url-management-update-js', [ - path.resolve(__dirname, '../public/js/scripts/toggle.button.state.toggle.js'), ]) .addEntry('ezplatform-admin-ui-login-js', [path.resolve(__dirname, '../public/js/scripts/login.js')]) .addEntry('ezplatform-admin-ui-tabs-js', [ path.resolve(__dirname, '../public/js/scripts/admin.location.tab.js'), path.resolve(__dirname, '../public/js/scripts/admin.location.adaptive.tabs.js'), ]) - .addEntry('ezplatform-admin-ui-edit-base-js', [ - path.resolve(__dirname, '../public/js/scripts/edit.header.js'), - ]); + .addEntry('ezplatform-admin-ui-edit-base-js', [path.resolve(__dirname, '../public/js/scripts/edit.header.js')]); }; diff --git a/src/bundle/Resources/public/js/scripts/admin.location.add.custom_url.js b/src/bundle/Resources/public/js/scripts/admin.location.add.custom_url.js index 16e41afedc..8270510c78 100644 --- a/src/bundle/Resources/public/js/scripts/admin.location.add.custom_url.js +++ b/src/bundle/Resources/public/js/scripts/admin.location.add.custom_url.js @@ -1,11 +1,10 @@ (function(global, doc) { - const modal = doc.querySelector('#ez-modal--custom-url-alias'); + const modal = doc.querySelector('#ibexa-modal--custom-url-alias'); if (modal) { const discardBtns = modal.querySelectorAll('[data-bs-dismiss="modal"]'); - const submitBtn = modal.querySelector('[type="submit"]'); + const submitBtn = modal.querySelector('#custom_url_add_add'); const input = modal.querySelector('[required="required"]'); - const checkboxes = modal.querySelectorAll('.ez-field-edit--ezboolean input'); const siteRootCheckbox = modal.querySelector('[name="custom_url_add[site_root]"]'); const toggleButtonState = () => { const hasValue = input.value.trim().length !== 0; @@ -13,27 +12,19 @@ submitBtn[methodName]('disabled', true); }; - const toggleCheckbox = (event) => { - const checkbox = event.target; - const methodName = checkbox.checked ? 'add' : 'remove'; - - checkbox.closest('.ez-data-source__label').classList[methodName]('is-checked'); - }; const clearValues = () => { input.value = ''; toggleButtonState(); }; const toggleSiteAccessSelect = (event) => { const isChecked = event.target.checked; - const siteAccessSelect = modal.querySelector('[name="custom_url_add[site_access]"]'); - const methodName = isChecked ? 'removeAttribute' : 'setAttribute'; + const siteAccessSelect = modal.querySelector('.ibexa-custom-url-from__item--siteacces .ibexa-dropdown'); - siteAccessSelect[methodName]('disabled', true); + siteAccessSelect.classList.toggle('ibexa-dropdown--is-disabled', isChecked); }; input.addEventListener('input', toggleButtonState, false); siteRootCheckbox.addEventListener('change', toggleSiteAccessSelect, false); - checkboxes.forEach((checkbox) => checkbox.addEventListener('change', toggleCheckbox, false)); discardBtns.forEach((btn) => btn.addEventListener('click', clearValues, false)); } })(window, window.document); diff --git a/src/bundle/Resources/public/js/scripts/admin.location.add.translation.js b/src/bundle/Resources/public/js/scripts/admin.location.add.translation.js index 3297cb812d..853f9752ae 100644 --- a/src/bundle/Resources/public/js/scripts/admin.location.add.translation.js +++ b/src/bundle/Resources/public/js/scripts/admin.location.add.translation.js @@ -1,5 +1,5 @@ (function(global, doc) { - const SELECTOR_MODAL = '.ez-modal'; + const SELECTOR_MODAL = '.ibexa-modal'; doc.querySelectorAll('.ez-translation__language-wrapper--language').forEach((select) => { select.addEventListener( diff --git a/src/bundle/Resources/public/js/scripts/admin.location.view.js b/src/bundle/Resources/public/js/scripts/admin.location.view.js index f74d7fd731..12fa25fe34 100644 --- a/src/bundle/Resources/public/js/scripts/admin.location.view.js +++ b/src/bundle/Resources/public/js/scripts/admin.location.view.js @@ -53,7 +53,7 @@ } }; const showModal = (modalHtml) => { - const wrapper = doc.querySelector('.ez-modal-wrapper'); + const wrapper = doc.querySelector('.ibexa-modal-wrapper'); wrapper.innerHTML = modalHtml; attachModalListeners(wrapper); @@ -106,9 +106,7 @@ failedItemsData.forEach(({ contentName, contentTypeName }) => { const container = doc.createElement('tbody'); - const renderedItem = rowTemplate - .replace('{{ content_name }}', contentName) - .replace('{{ content_type_name }}', contentTypeName); + const renderedItem = rowTemplate.replace('{{ content_name }}', contentName).replace('{{ content_type_name }}', contentTypeName); container.insertAdjacentHTML('beforeend', renderedItem); diff --git a/src/bundle/Resources/public/js/scripts/admin.trash.js b/src/bundle/Resources/public/js/scripts/admin.trash.js index 941e660865..0815b7234f 100644 --- a/src/bundle/Resources/public/js/scripts/admin.trash.js +++ b/src/bundle/Resources/public/js/scripts/admin.trash.js @@ -1,7 +1,7 @@ (function(global, doc) { const form = doc.querySelector('form[name="location_trash"]'); const submitButton = form.querySelector('button[type="submit"]'); - const allOptions = form.querySelectorAll('.ez-modal__trash-option'); + const allOptions = form.querySelectorAll('.ibexa-modal__trash-option'); const confirmCheckbox = form.querySelector('input[name="location_trash[confirm][]"]'); const enableButton = (button) => { button.disabled = false; @@ -13,7 +13,7 @@ }; const refreshTrashModal = (event) => { const { numberOfSubitems } = event.detail; - const sendToTrashModal = document.querySelector('.ez-modal--trash-location'); + const sendToTrashModal = document.querySelector('.ibexa-modal--trash-location'); const modalBody = sendToTrashModal.querySelector('.modal-body'); const modalSendToTrashButton = sendToTrashModal.querySelector('.modal-footer .ibexa-btn--confirm-send-to-trash'); const { contentName } = sendToTrashModal.dataset; @@ -28,7 +28,7 @@ 'content' ); - modalBody.querySelector('.ez-modal__option-description').innerHTML = message; + modalBody.querySelector('.ibexa-modal__option-description').innerHTML = message; } else { const message = Translator.trans( /*@Desc("Are you sure you want to send this Content item to Trash?")*/ 'trash.modal.message', diff --git a/src/bundle/Resources/public/js/scripts/button.content.edit.js b/src/bundle/Resources/public/js/scripts/button.content.edit.js index 7979509a37..40e99c1a6d 100644 --- a/src/bundle/Resources/public/js/scripts/button.content.edit.js +++ b/src/bundle/Resources/public/js/scripts/button.content.edit.js @@ -30,7 +30,7 @@ bootstrap.Modal.getOrCreateInstance(doc.querySelector('#version-draft-conflict-modal')).hide(); }; const showModal = (modalHtml) => { - const wrapper = doc.querySelector('.ez-modal-wrapper'); + const wrapper = doc.querySelector('.ibexa-modal-wrapper'); wrapper.innerHTML = modalHtml; diff --git a/src/bundle/Resources/public/js/scripts/button.translation.edit.js b/src/bundle/Resources/public/js/scripts/button.translation.edit.js index 5f608f0051..57c2ff9541 100644 --- a/src/bundle/Resources/public/js/scripts/button.translation.edit.js +++ b/src/bundle/Resources/public/js/scripts/button.translation.edit.js @@ -22,7 +22,7 @@ hideTranslationsList(event) { const closestTranslationSelector = event.target.closest('.ez-translation-selector'); const clickedOnTranslationsList = closestTranslationSelector && closestTranslationSelector.isSameNode(this.container); - const clickedOnDraftConflictModal = event.target.closest('.ez-modal--version-draft-conflict'); + const clickedOnDraftConflictModal = event.target.closest('.ibexa-modal--version-draft-conflict'); if (clickedOnTranslationsList || clickedOnDraftConflictModal) { return; 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 e7022f9b7a..f4a3fc81b9 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 @@ -46,7 +46,7 @@ } }; const showModal = (modalHtml) => { - const wrapper = doc.querySelector('.ez-modal-wrapper'); + const wrapper = doc.querySelector('.ibexa-modal-wrapper'); wrapper.innerHTML = modalHtml; attachModalListeners(wrapper); diff --git a/src/bundle/Resources/public/scss/_buttons.scss b/src/bundle/Resources/public/scss/_buttons.scss index ad0a383391..28e906e253 100644 --- a/src/bundle/Resources/public/scss/_buttons.scss +++ b/src/bundle/Resources/public/scss/_buttons.scss @@ -261,7 +261,7 @@ .ez-content-view, .ez-trash-list-view { - .ez-modal--send-to-trash { + .ibexa-modal--send-to-trash { .modal-footer { .form-check-inline { margin-right: 0; diff --git a/src/bundle/Resources/public/scss/_custom-url-form.scss b/src/bundle/Resources/public/scss/_custom-url-form.scss new file mode 100644 index 0000000000..fee0ad40cf --- /dev/null +++ b/src/bundle/Resources/public/scss/_custom-url-form.scss @@ -0,0 +1,29 @@ +.ibexa-custom-url-from { + &__item { + margin-bottom: calculateRem(24px); + + .ibexa-dropdown, + .ibexa-input-text-wrapper { + width: calculateRem(352px); + } + } + + &__info-text { + font-size: $ibexa-text-font-size-small; + color: $ibexa-color-dark-400; + + &--checked { + display: none; + + .ibexa-toggle--is-checked + & { + display: block; + } + } + + &--unchecked { + .ibexa-toggle--is-checked + .ibexa-custom-url-from__info-text--checked + & { + display: none; + } + } + } +} diff --git a/src/bundle/Resources/public/scss/_custom.scss b/src/bundle/Resources/public/scss/_custom.scss index 68b7473b4e..65857c7552 100644 --- a/src/bundle/Resources/public/scss/_custom.scss +++ b/src/bundle/Resources/public/scss/_custom.scss @@ -366,11 +366,11 @@ $pagination-disabled-bg: transparent; $pagination-disabled-border-color: transparent; // Modals -$modal-header-padding-y: 24px; +$modal-header-padding-y: 16px; $modal-header-padding-x: 0; $modal-header-border-width: 1px; $modal-header-border-color: $ibexa-color-base-medium; -$modal-title-font-size: 20px; +$modal-title-font-size: 28px; $modal-content-border-width: 0; $modal-content-border-radius: $ibexa-border-radius; $modal-inner-padding: 24px 0; diff --git a/src/bundle/Resources/public/scss/_modals.scss b/src/bundle/Resources/public/scss/_modals.scss index 8b5ab987af..26064bd51e 100644 --- a/src/bundle/Resources/public/scss/_modals.scss +++ b/src/bundle/Resources/public/scss/_modals.scss @@ -1,4 +1,4 @@ -.ez-modal { +.ibexa-modal { .modal-dialog { @include modal-main(); } @@ -30,7 +30,7 @@ &--table-content { .modal-header { border-width: 0; - } + } .modal-body { padding-top: 0; @@ -53,8 +53,8 @@ &--wide { .modal-dialog { - max-width: calculateRem(800px); - width: calculateRem(800px); + max-width: calculateRem(800px); + width: calculateRem(800px); } } } diff --git a/src/bundle/Resources/public/scss/ezplatform.scss b/src/bundle/Resources/public/scss/ezplatform.scss index 8f6e614e86..4dd46066bd 100644 --- a/src/bundle/Resources/public/scss/ezplatform.scss +++ b/src/bundle/Resources/public/scss/ezplatform.scss @@ -107,3 +107,4 @@ @import 'grid-view-item'; @import 'list-search'; @import 'search-links-form'; +@import 'custom-url-form'; diff --git a/src/bundle/Resources/public/scss/mixins/_modals.scss b/src/bundle/Resources/public/scss/mixins/_modals.scss index aad0eda435..a960ac337d 100644 --- a/src/bundle/Resources/public/scss/mixins/_modals.scss +++ b/src/bundle/Resources/public/scss/mixins/_modals.scss @@ -57,6 +57,6 @@ padding: $modal-footer-padding; .btn { - margin: 0 calculateRem(4px) 0 0; + margin: 0 calculateRem(16px) 0 0; } } diff --git a/src/bundle/Resources/translations/content_url.en.xliff b/src/bundle/Resources/translations/content_url.en.xliff index 961e9bff8c..8061b54ebb 100644 --- a/src/bundle/Resources/translations/content_url.en.xliff +++ b/src/bundle/Resources/translations/content_url.en.xliff @@ -37,13 +37,13 @@ key: tab.urls.add.redirect - When checked, the alias will redirect to the destination using an HTTP 301 response. - When checked, the alias will redirect to the destination using an HTTP 301 response. + The alias will redirect to the destination using an HTTP 301 response. + The alias will redirect to the destination using an HTTP 301 response. key: tab.urls.add.redirect.helper.checked - When unchecked, the alias will not redirect to the destination and the URL will stay the same. - When unchecked, the alias will not redirect to the destination and the URL will stay the same. + The alias will not redirect to the destination and the URL will stay the same. + The alias will not redirect to the destination and the URL will stay the same. key: tab.urls.add.redirect.helper.unchecked @@ -62,18 +62,18 @@ key: tab.urls.add.site_root - When checked, the alias will be placed at the site root. - When checked, the alias will be placed at the site root. + The alias will be placed at the site root. + The alias will be placed at the site root. key: tab.urls.add.site_root.helper.checked - When unchecked, the alias will be placed under the parent of this Location - When unchecked, the alias will be placed under the parent of this Location + The alias will be placed under the parent of this Location + The alias will be placed under the parent of this Location key: tab.urls.add.site_root.helper.no_parent_name - When unchecked, the alias will be placed under %parent_name% - When unchecked, the alias will be placed under %parent_name% + The alias will be placed under %parent_name% + The alias will be placed under %parent_name% key: tab.urls.add.site_root.helper.unchecked diff --git a/src/bundle/Resources/views/themes/admin/account/notifications/modal.html.twig b/src/bundle/Resources/views/themes/admin/account/notifications/modal.html.twig index 96e9d2a990..b89ac63ced 100644 --- a/src/bundle/Resources/views/themes/admin/account/notifications/modal.html.twig +++ b/src/bundle/Resources/views/themes/admin/account/notifications/modal.html.twig @@ -1,7 +1,7 @@ {% trans_default_domain 'notifications' %}