diff --git a/src/bundle/Resources/encore/ez.js.config.js b/src/bundle/Resources/encore/ez.js.config.js index 9f264e4e47..6edef51b0d 100644 --- a/src/bundle/Resources/encore/ez.js.config.js +++ b/src/bundle/Resources/encore/ez.js.config.js @@ -109,11 +109,13 @@ module.exports = (Encore) => { path.resolve(__dirname, '../public/js/scripts/button.state.toggle.js'), path.resolve(__dirname, '../public/js/scripts/button.content.edit.js'), path.resolve(__dirname, '../public/js/scripts/admin.version.edit.conflict.js'), + path.resolve(__dirname, '../public/js/scripts/admin.content.tree.js'), ]) .addEntry('ezplatform-admin-ui-content-draft-list-js', [ path.resolve(__dirname, '../public/js/scripts/button.state.toggle.js'), path.resolve(__dirname, '../public/js/scripts/button.content.edit.js'), path.resolve(__dirname, '../public/js/scripts/admin.version.edit.conflict.js'), + path.resolve(__dirname, '../public/js/scripts/admin.content.tree.js'), ]) .addEntry('ezplatform-admin-ui-content-type-create-js', [ path.resolve(__dirname, '../public/js/scripts/admin.contenttype.selection.js'), @@ -155,17 +157,21 @@ module.exports = (Encore) => { path.resolve(__dirname, '../public/js/scripts/button.content.edit.js'), path.resolve(__dirname, '../public/js/scripts/admin.search.filters.js'), path.resolve(__dirname, '../public/js/scripts/udw/select.location.js'), + path.resolve(__dirname, '../public/js/scripts/admin.content.tree.js'), ]) .addEntry('ezplatform-admin-ui-section-list-js', [ path.resolve(__dirname, '../public/js/scripts/admin.section.list.js'), path.resolve(__dirname, '../public/js/scripts/button.state.toggle.js'), ]) .addEntry('ezplatform-admin-ui-section-view-js', [path.resolve(__dirname, '../public/js/scripts/admin.section.view.js')]) - .addEntry('ezplatform-admin-ui-trash-list-js', [path.resolve(__dirname, '../public/js/scripts/admin.trash.list.js')]) + .addEntry('ezplatform-admin-ui-trash-list-js', [ + path.resolve(__dirname, '../public/js/scripts/admin.trash.list.js'), + path.resolve(__dirname, '../public/js/scripts/admin.content.tree.js'), + ]) .addEntry('ezplatform-admin-ui-content-preview-js', [path.resolve(__dirname, '../public/js/scripts/admin.preview.js')]) .addEntry('ezplatform-admin-ui-location-view-js', [ path.resolve(__dirname, '../public/js/scripts/admin.location.change.language.js'), - path.resolve(__dirname, '../public/js/scripts/admin.location.content.tree.js'), + path.resolve(__dirname, '../public/js/scripts/admin.content.tree.js'), path.resolve(__dirname, '../public/js/scripts/admin.location.view.js'), path.resolve(__dirname, '../public/js/scripts/admin.location.tab.js'), path.resolve(__dirname, '../public/js/scripts/admin.location.visibility.js'), diff --git a/src/bundle/Resources/public/js/scripts/admin.location.content.tree.js b/src/bundle/Resources/public/js/scripts/admin.content.tree.js similarity index 100% rename from src/bundle/Resources/public/js/scripts/admin.location.content.tree.js rename to src/bundle/Resources/public/js/scripts/admin.content.tree.js diff --git a/src/bundle/Resources/public/scss/_view-content.scss b/src/bundle/Resources/public/scss/_content-tree.scss similarity index 82% rename from src/bundle/Resources/public/scss/_view-content.scss rename to src/bundle/Resources/public/scss/_content-tree.scss index ddb643c866..16e297fa7d 100644 --- a/src/bundle/Resources/public/scss/_view-content.scss +++ b/src/bundle/Resources/public/scss/_content-tree.scss @@ -1,6 +1,9 @@ -.ez-content-view { +.ez-content-view, +.ez-bookmark-list-view, +.ez-search-view, +.ez-trash-list-view, +.ez-drafts-list-view { .ez-content-container { - display: flex; min-width: 0; } @@ -12,7 +15,6 @@ background: $ez-white; color: inherit; transition: max-width 0.2s $ez-admin-transition; - margin-bottom: calculateRem(-24px); &--expanded { display: initial; @@ -27,7 +29,7 @@ } } - .ez-location-view-container { + .ez-view-container { flex: 1 1 auto; min-width: 0; } diff --git a/src/bundle/Resources/public/scss/_main-row.scss b/src/bundle/Resources/public/scss/_main-row.scss index c2ae2ba341..6598def848 100644 --- a/src/bundle/Resources/public/scss/_main-row.scss +++ b/src/bundle/Resources/public/scss/_main-row.scss @@ -1,38 +1,13 @@ .ez-main-row { - display: grid; - grid-template-columns: 1fr calculateRem(80px); - grid-template-rows: auto; - grid-template-areas: 'ez-content-container ez-context-menu'; - - .ez-content-container { - grid-area: ez-content-container; - } + display: flex; + flex-wrap: nowrap; + .ez-side-menu, .ez-context-menu { - grid-area: ez-context-menu; - } - - .ez-has-two-sidebars & { - grid-template-columns: calculateRem(80px) 1fr calculateRem(80px); - grid-template-areas: 'ez-side-menu ez-content-container ez-context-menu'; - - .ez-side-menu { - grid-area: ez-side-menu; - } + flex: 0 0 calculateRem(80px); } - .ez-has-no-sidebars & { - grid-template-columns: 1fr; - grid-template-areas: 'ez-content-container'; - - .ez-context-menu, - .ez-side-menu { - display: none; - } - } - - &.ez-dashboard-row { - grid-template-columns: 1fr; - grid-template-areas: 'ez-content-container'; + .ez-content-container { + flex: 1 1 auto; } } diff --git a/src/bundle/Resources/public/scss/ezplatform.scss b/src/bundle/Resources/public/scss/ezplatform.scss index 7b103c5df6..6795079e87 100644 --- a/src/bundle/Resources/public/scss/ezplatform.scss +++ b/src/bundle/Resources/public/scss/ezplatform.scss @@ -71,4 +71,4 @@ @import 'admin.section-view'; @import 'admin.content-type-view'; @import 'main-row'; -@import 'view-content'; +@import 'content-tree'; diff --git a/src/bundle/Resources/views/admin/bookmark/list.html.twig b/src/bundle/Resources/views/admin/bookmark/list.html.twig index 7522d62b0a..371d895169 100644 --- a/src/bundle/Resources/views/admin/bookmark/list.html.twig +++ b/src/bundle/Resources/views/admin/bookmark/list.html.twig @@ -22,72 +22,74 @@ 'attr': { 'class': 'ez-toggle-btn-state', 'data-toggle-button-id': '#bookmark_remove_remove' } }) }} {% include '@ezdesign/parts/table_header.html.twig' with { - ground: 'mt-3', - headerText: 'bookmark.table.header'|trans|desc('Bookmarks') ~ ' (' ~ pager.count ~ ')', - tools: form_widget(form_remove.remove, {'attr': {'class': 'btn btn-danger', 'disabled': true}}) - } %} - - - - - - - - - - - - - {% if pager.count is same as(0) %} - - - - {% else %} - {% for bookmark in pager.currentPageResults %} + ground: 'mt-3', + headerText: 'bookmark.table.header'|trans|desc('Bookmarks') ~ ' (' ~ pager.count ~ ')', + tools: form_widget(form_remove.remove, {'attr': {'class': 'btn btn-danger', 'disabled': true}}) + } %} +
+
{{ 'bookmark.list.name'|trans|desc('Name') }}{{ 'bookmark.list.content_type'|trans|desc('Content Type') }}{{ 'bookmark.list.path'|trans|desc('Path') }}
- {{ 'bookmark.list.empty'|trans|desc('The bookmark list is empty. Any Content item you bookmark will end up here.') }} -
+ - - - - - - + + + + + + + + + {% if pager.count is same as(0) %} + + - {% endfor %} - {% endif %} - -
{{ form_widget(form_remove.bookmarks[bookmark.id]) }} - - - - {{ ez_content_name(bookmark.contentInfo) }}{{ bookmark.contentType.name }} - {% if bookmark.pathLocations|length > 1 %} - {% for location in bookmark.pathLocations %} - {% if loop.revindex > 1 %} - - {{ ez_content_name(location.contentInfo) }} - - {% if loop.revindex > 2 %}/{% endif %} - {% endif %} - {% endfor %} - {% else %} - - - {% endif %} - - {% if bookmark.userCanEdit %} - - {% endif %} + {{ 'bookmark.list.name'|trans|desc('Name') }}{{ 'bookmark.list.content_type'|trans|desc('Content Type') }}{{ 'bookmark.list.path'|trans|desc('Path') }}
+ {{ 'bookmark.list.empty'|trans|desc('The bookmark list is empty. Any Content item you bookmark will end up here.') }}
+ {% else %} + {% for bookmark in pager.currentPageResults %} + + {{ form_widget(form_remove.bookmarks[bookmark.id]) }} + + + + + + {{ ez_content_name(bookmark.contentInfo) }} + {{ bookmark.contentType.name }} + + {% if bookmark.pathLocations|length > 1 %} + {% for location in bookmark.pathLocations %} + {% if loop.revindex > 1 %} + + {{ ez_content_name(location.contentInfo) }} + + {% if loop.revindex > 2 %}/{% endif %} + {% endif %} + {% endfor %} + {% else %} + - + {% endif %} + + + {% if bookmark.userCanEdit %} + + {% endif %} + + + {% endfor %} + {% endif %} + + + {{ form_end(form_remove) }} @@ -115,6 +117,10 @@ {% endblock %} +{% block react_modules %} + {{ encore_entry_script_tags('ezplatform-admin-ui-modules-content-tree-js', null, 'ezplatform') }} +{% endblock %} + {% block javascripts %} {{ encore_entry_script_tags('ezplatform-admin-ui-bookmark-list-js', null, 'ezplatform') }} {% endblock %} diff --git a/src/bundle/Resources/views/admin/content_draft/list.html.twig b/src/bundle/Resources/views/admin/content_draft/list.html.twig index 32037c86d4..a7ddb42ad4 100644 --- a/src/bundle/Resources/views/admin/content_draft/list.html.twig +++ b/src/bundle/Resources/views/admin/content_draft/list.html.twig @@ -8,7 +8,7 @@ {% block title %}{{ 'drafts.list'|trans|desc('Drafts') }} - {{ parent() }}{% endblock %} -{% block body_class %}ez-drafts-list-view ez-has-two-sidebars{% endblock %} +{% block body_class %}ez-drafts-list-view{% endblock %} {% block content %}
@@ -37,68 +37,70 @@ headerText: 'drafts.table.header'|trans|desc('Drafts') ~ ' (' ~ pager.count ~ ')', tools: macros.table_header_tools(form_remove) } %} - - - - - - - - - - - - - - - {% if pager.count is same as(0) %} - - - - {% else %} - {% for row in pager.currentPageResults %} - {% set content_draft_edit_url = content_is_user|default(false) ? 'ez_user_update' : 'ez_content_draft_edit' %} +
+
{{ 'drafts.list.name'|trans|desc('Name') }}{{ 'drafts.list.content_type'|trans|desc('Content Type') }}{{ 'drafts.list.modified_language'|trans|desc('Modified Language') }}{{ 'drafts.list.version'|trans|desc('Version') }}{{ 'drafts.list.last_saved'|trans|desc('Last Saved') }}
- - {{ 'drafts.list.empty'|trans|desc('The draft list is empty. Any Content draft you create will end up here.') }} - -
+ - - - - - - - - + + + + + + + + + + + {% if pager.count is same as(0) %} + + - {% endfor %} - {% endif %} - -
- {{ form_widget(form_remove.versions[row.id ~ '']) }} - - - - - {{ row.name }}{{ row.content_type.name }}{{ admin_ui_config.languages.mappings[row.language].name }}{{ row.version }}{{ row.modified|ez_full_datetime }} - + {{ 'drafts.list.name'|trans|desc('Name') }}{{ 'drafts.list.content_type'|trans|desc('Content Type') }}{{ 'drafts.list.modified_language'|trans|desc('Modified Language') }}{{ 'drafts.list.version'|trans|desc('Version') }}{{ 'drafts.list.last_saved'|trans|desc('Last Saved') }}
+ + {{ 'drafts.list.empty'|trans|desc('The draft list is empty. Any Content draft you create will end up here.') }} +
+ {% else %} + {% for row in pager.currentPageResults %} + {% set content_draft_edit_url = content_is_user|default(false) ? 'ez_user_update' : 'ez_content_draft_edit' %} + + + {{ form_widget(form_remove.versions[row.id ~ '']) }} + + + + + + + {{ row.name }} + {{ row.content_type.name }} + {{ admin_ui_config.languages.mappings[row.language].name }} + {{ row.version }} + {{ row.modified|ez_full_datetime }} + + + + + {% endfor %} + {% endif %} + + +
{{ form_widget(form_remove.remove, { 'attr': { 'hidden': true @@ -127,6 +129,10 @@ {% include '@ezdesign/content/modal_version_conflict.html.twig' %} {% endblock %} +{% block react_modules %} + {{ encore_entry_script_tags('ezplatform-admin-ui-modules-content-tree-js', null, 'ezplatform') }} +{% endblock %} + {% block javascripts %} {{ encore_entry_script_tags('ezplatform-admin-ui-content-draft-list-js', null, 'ezplatform') }} {% endblock %} diff --git a/src/bundle/Resources/views/admin/search/search.html.twig b/src/bundle/Resources/views/admin/search/search.html.twig index c3da76a641..b6293d2465 100644 --- a/src/bundle/Resources/views/admin/search/search.html.twig +++ b/src/bundle/Resources/views/admin/search/search.html.twig @@ -22,12 +22,12 @@ {% if results is defined %} -
+
{{ 'search.header'|trans({'%total%': pager.nbResults})|desc('Search results (%total%)') }}
{% if results is empty %} -
+
+ + + + + + + {% endfor %} + {% endif %} + +
@@ -44,8 +44,8 @@ {% else %} -
- +
+
@@ -61,20 +61,20 @@ {% endfor %}
- - {% if pager.haveToPaginate %} -
- - {{ 'pagination.viewing'|trans({ - '%viewing%': pager.currentPageResults|length, - '%total%': pager.nbResults}, 'pagination')|desc('Viewing %viewing% out of %total% items')|raw }} - -
-
- {{ pagerfanta(pager, 'ez', {'pageParameter': '[search][page]'}) }} -
- {% endif %}
+ + {% if pager.haveToPaginate %} +
+ + {{ 'pagination.viewing'|trans({ + '%viewing%': pager.currentPageResults|length, + '%total%': pager.nbResults}, 'pagination')|desc('Viewing %viewing% out of %total% items')|raw }} + +
+
+ {{ pagerfanta(pager, 'ez', {'pageParameter': '[search][page]'}) }} +
+ {% endif %} {% endif %} {% form_theme form_edit '@ezdesign/parts/form/flat_widgets.html.twig' %} @@ -91,6 +91,10 @@ {% endblock %} +{% block react_modules %} + {{ encore_entry_script_tags('ezplatform-admin-ui-modules-content-tree-js', null, 'ezplatform') }} +{% endblock %} + {% block javascripts %} {{ encore_entry_script_tags('ezplatform-admin-ui-search-js', null, 'ezplatform') }} {% endblock %} diff --git a/src/bundle/Resources/views/admin/search/search_form.html.twig b/src/bundle/Resources/views/admin/search/search_form.html.twig index b934d79646..bed8e10c5d 100644 --- a/src/bundle/Resources/views/admin/search/search_form.html.twig +++ b/src/bundle/Resources/views/admin/search/search_form.html.twig @@ -3,7 +3,7 @@ {% trans_default_domain 'search' %} {{ form_start(form) }} -
+
{{ form_widget(form.query) }} diff --git a/src/bundle/Resources/views/admin/trash/list.html.twig b/src/bundle/Resources/views/admin/trash/list.html.twig index 4107fe718d..2156e0a528 100644 --- a/src/bundle/Resources/views/admin/trash/list.html.twig +++ b/src/bundle/Resources/views/admin/trash/list.html.twig @@ -62,54 +62,56 @@ {% endif %}
- - - - - - - - - - - - {% if trash_items is empty %} +
+
{{ 'trash.name'|trans|desc('Name') }}{{ 'trash.type'|trans|desc('Type') }}{{ 'trash.original_location'|trans|desc('Original location') }}
+ - + + + + + - {% else %} - {% for key, form in form_trash_item_restore.trash_items %} - {% set trash_item = trash_items[key] %} - {% set is_parent_in_trash = trash_item.parentInTrash %} + + + {% if trash_items is empty %} - - - - - - {% endfor %} - {% endif %} - -
- - {{ 'trash.empty'|trans|desc('Trash is empty. Any content item you send to trash will end up here.') }} - - {{ 'trash.name'|trans|desc('Name') }}{{ 'trash.type'|trans|desc('Type') }}{{ 'trash.original_location'|trans|desc('Original location') }}
- {{ form_widget(form, {attr: { - 'data-is-parent-in-trash': is_parent_in_trash ? '1': '0' - }}) }} - - - - - {{ ez_content_name(trash_item.location.contentInfo) }}{{ trash_item.contentType.name }} - {% if not is_parent_in_trash %} - {% include '@ezdesign/parts/path.html.twig' with {'locations': trash_item.ancestors, 'link_last_element': true} %} - {% else %} - {{ 'trash.item.ancesor_in_trash'|trans|desc('Ancestor is in the Trash') }} - {% endif %} + + + {{ 'trash.empty'|trans|desc('Trash is empty. Any content item you send to trash will end up here.') }} +
+ {% else %} + {% for key, form in form_trash_item_restore.trash_items %} + {% set trash_item = trash_items[key] %} + {% set is_parent_in_trash = trash_item.parentInTrash %} +
+ {{ form_widget(form, {attr: { + 'data-is-parent-in-trash': is_parent_in_trash ? '1': '0' + }}) }} + + + + + {{ ez_content_name(trash_item.location.contentInfo) }}{{ trash_item.contentType.name }} + {% if not is_parent_in_trash %} + {% include '@ezdesign/parts/path.html.twig' with {'locations': trash_item.ancestors, 'link_last_element': true} %} + {% else %} + {{ 'trash.item.ancesor_in_trash'|trans|desc('Ancestor is in the Trash') }} + {% endif %} +
+
{{ form_widget(form_trash_item_restore._token) }} {{ form_end(form_trash_item_restore, { 'render_rest': false }) }}
@@ -151,6 +153,10 @@
{% endblock %} +{% block react_modules %} + {{ encore_entry_script_tags('ezplatform-admin-ui-modules-content-tree-js', null, 'ezplatform') }} +{% endblock %} + {% block javascripts %} {{ encore_entry_script_tags('ezplatform-admin-ui-trash-list-js', null, 'ezplatform') }} {% endblock %} diff --git a/src/bundle/Resources/views/layout.html.twig b/src/bundle/Resources/views/layout.html.twig index dd0d6375d1..f36b551aaa 100644 --- a/src/bundle/Resources/views/layout.html.twig +++ b/src/bundle/Resources/views/layout.html.twig @@ -123,6 +123,12 @@ {{ knp_menu_render('ezplatform_admin_ui.menu.content.sidebar_left', {'template': '@ezdesign/parts/menu/sidebar_left.html.twig'}) }} +
+
+
{% endblock left_sidebar %} {% endblock content %}