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 ef143e4d81..de10fd4f5e 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 @@ -7,8 +7,19 @@ createActions.forEach((container) => { const radioInputs = container.querySelectorAll('.form-check [type="radio"]'); - const form = container.querySelector('form'); + const submitBtn = container.querySelector('.ibexa-extra-actions__btn--confirm'); + const cancelBtn = container.querySelector('.ibexa-extra-actions__btn--cancel'); + const closeBtn = container.querySelector('.ibexa-extra-actions__header .ibexa-btn--close'); - radioInputs.forEach((radioInput) => radioInput.addEventListener('change', () => form.submit(), false)); + cancelBtn.addEventListener('click', () => { closeBtn.click() }, false); + radioInputs.forEach((radioInput) => radioInput.addEventListener('change', (event) => { + const selectedItems = container.querySelectorAll('.ibexa-instant-filter__group-item--selected'); + const itemToSelect = event.currentTarget.closest('.ibexa-instant-filter__group-item'); + + selectedItems.forEach((selectedItem) => selectedItem.classList.remove('ibexa-instant-filter__group-item--selected')); + itemToSelect.classList.add('ibexa-instant-filter__group-item--selected'); + + submitBtn.removeAttribute('disabled'); + }, false)); }); })(window, window.document); diff --git a/src/bundle/Resources/public/scss/_extra-actions.scss b/src/bundle/Resources/public/scss/_extra-actions.scss index 997759424a..55e31bf621 100644 --- a/src/bundle/Resources/public/scss/_extra-actions.scss +++ b/src/bundle/Resources/public/scss/_extra-actions.scss @@ -82,6 +82,13 @@ } } + &__confirm-wrapper { + margin-top: calculateRem(20px); + padding: 0 calculateRem(32px); + display: flex; + gap: calculateRem(16px); + } + &--edit-user, &--edit { .form-check { @@ -126,7 +133,7 @@ &--create { .ibexa-extra-actions { &__content { - max-height: calc(100% - #{calculateRem(89px)}); + height: calc(100% - #{calculateRem(157px)}); overflow: auto; } diff --git a/src/bundle/Resources/views/themes/admin/content/widget/content_create.html.twig b/src/bundle/Resources/views/themes/admin/content/widget/content_create.html.twig index 6ca6f43436..7191485337 100644 --- a/src/bundle/Resources/views/themes/admin/content/widget/content_create.html.twig +++ b/src/bundle/Resources/views/themes/admin/content/widget/content_create.html.twig @@ -1,27 +1,30 @@ {% trans_default_domain 'locationview' %} {% set data_actions = data_actions|default('create') %} +{% set action = action is defined ? action : path('ibexa.content.create') %} -