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 f813e5f070..b6138edf02 100644 --- a/src/bundle/Resources/public/js/scripts/admin.location.view.js +++ b/src/bundle/Resources/public/js/scripts/admin.location.view.js @@ -114,6 +114,13 @@ return total; }, {}); const udwConfigBulkMoveItems = JSON.parse(container.dataset.udwConfigBulkMoveItems); + const mfuContentTypesMap = Object.values(eZ.adminUiConfig.contentTypes).reduce((contentTypeDataMap, contentTypeGroup) => { + for (const contentTypeData of contentTypeGroup) { + contentTypeDataMap[contentTypeData.href] = contentTypeData; + } + + return contentTypeDataMap; + }, {}); ReactDOM.render( React.createElement(eZ.modules.SubItems, { @@ -128,6 +135,7 @@ attrs: Object.assign({}, mfuAttrs, { onPopupClose: (itemsUploaded) => itemsUploaded.length && global.location.reload(true), contentCreatePermissionsConfig: JSON.parse(container.dataset.mfuCreatePermissionsConfig), + contentTypesMap: mfuContentTypesMap, }), }, ], diff --git a/src/bundle/Resources/public/scss/_extra-actions.scss b/src/bundle/Resources/public/scss/_extra-actions.scss index 54ba5fde7e..ec8b71e191 100644 --- a/src/bundle/Resources/public/scss/_extra-actions.scss +++ b/src/bundle/Resources/public/scss/_extra-actions.scss @@ -1,9 +1,9 @@ .ez-extra-actions { $block: '.ez-extra-actions'; - border-radius: 8px; - border: 6px solid $ez-color-secondary; - width: 300px; + border-radius: calculateRem(8px); + border: calculateRem(6px) solid $ez-color-secondary; + width: calculateRem(300px); &__action { display: block; @@ -11,9 +11,9 @@ border: 0 none; width: 100%; text-align: left; - border-radius: 4px; - padding: 0 16px; - line-height: 45px; + border-radius: calculateRem(4px); + padding: 0 calculateRem(16px); + line-height: calculateRem(45px); background: $ez-white; color: $ez-color-secondary; text-decoration: none; @@ -38,19 +38,19 @@ } &__action + &__action { - margin-top: 8px; + margin-top: calculateRem(8px); } &__header { - line-height: 45px; + line-height: calculateRem(45px); color: $ez-white; - padding: 0 8px; + padding: 0 calculateRem(8px); font-weight: 700; } &__content { background: $ez-ground-base-dark; - max-height: 300px; + max-height: calculateRem(300px); overflow: auto; .form-group { @@ -61,11 +61,11 @@ &--edit-user, &--edit { #{$block}__content { - padding: 8px; + padding: calculateRem(8px); } #{$block}__form-values { - max-height: 150px; + max-height: calculateRem(150px); overflow: auto; } @@ -75,15 +75,15 @@ border: 0 none; width: 100%; text-align: left; - border-radius: 4px; - padding: 0 16px; - line-height: 45px; + border-radius: calculateRem(4px); + padding: 0 calculateRem(16px); + line-height: calculateRem(45px); background: $ez-white; text-decoration: none; cursor: pointer; transition: all 0.2s $ez-admin-transition; margin-bottom: 0; - font-size: 0.9375rem; + font-size: calculateRem(15px); &:hover, &:focus { @@ -97,7 +97,7 @@ } &:not(:last-child) { - margin-bottom: 0.5rem; + margin-bottom: calculateRem(8px); } &-label { @@ -115,15 +115,15 @@ &__section-header { background: $ez-ground-base-dark; - padding: 0.25rem 0 0.25rem 0.5rem; - font-size: 0.9375rem; + padding: calculateRem(4px) 0 calculateRem(4px) calculateRem(8px); + font-size: calculateRem(15px); font-weight: 700; } &__section-content { background: $ez-white; - padding: 1rem 0.5rem; - font-size: 0.9375rem; + padding: 1rem calculateRem(8px); + font-size: calculateRem(15px); select { display: inline-block; @@ -160,7 +160,7 @@ &-label { margin: 0; display: block; - padding-left: 1.5rem; + padding-left: calculateRem(40px); } &-input[type='radio'] { @@ -178,10 +178,10 @@ &::after { content: ''; position: absolute; - height: 40px; - width: 10px; - top: 30px; - right: -6px; + height: calculateRem(40px); + width: calculateRem(10px); + top: calculateRem(30px); + right: calculateRem(-6px); transform: translate(100%, -50%); z-index: 0; background: $ez-color-secondary; @@ -194,13 +194,13 @@ left: 0; z-index: 2; opacity: 1; - transform: translate(calc(-100% - 10px), 0) scaleX(1); + transform: translate(calc(-100% - #{calculateRem(10px)}), 0) scaleX(1); transform-origin: right center; transition: all 0.2s $ez-admin-transition; &--hidden { opacity: 0; - transform: translate(calc(-100% - 15px), 0) scaleX(0); + transform: translate(calc(-100% - #{calculateRem(15px)}), 0) scaleX(0); } } } diff --git a/src/bundle/Resources/public/scss/_instant-filter.scss b/src/bundle/Resources/public/scss/_instant-filter.scss index 0750b092a4..c7a118d110 100644 --- a/src/bundle/Resources/public/scss/_instant-filter.scss +++ b/src/bundle/Resources/public/scss/_instant-filter.scss @@ -8,21 +8,33 @@ .ez-extra-actions--create { .ez-instant-filter { &__group-name { - padding-left: .5rem; + padding-left: calculateRem(8px); } &__input-wrapper { - padding: 1rem .5rem; + padding: calculateRem(16px) calculateRem(8px); } &__group-item { + position: relative; + label { cursor: pointer; } + + .ez-icon { + fill: $ez-black; + position: absolute; + top: 0; + left: calculateRem(20px); + width: calculateRem(16px); + height: calculateRem(16px); + margin-top: calculateRem(3px); + } } &__items { - max-height: 200px; + max-height: calculateRem(200px); overflow: auto; } } diff --git a/src/bundle/Resources/public/scss/_tables.scss b/src/bundle/Resources/public/scss/_tables.scss index 38f8e1312b..b7f72b8889 100644 --- a/src/bundle/Resources/public/scss/_tables.scss +++ b/src/bundle/Resources/public/scss/_tables.scss @@ -4,34 +4,56 @@ justify-content: space-between; background-color: $ez-ground-primary; align-items: center; - padding: 0 1.25rem; - min-height: 50px; - border-radius: .25rem .25rem 0 0; + padding: 0 calculateRem(20px); + min-height: calculateRem(50px); + border-radius: calculateRem(4px) calculateRem(4px) 0 0; } &__headline { - font-size: 1.0625rem; + font-size: calculateRem(17px); margin-bottom: 0; font-weight: bold; color: $ez-black; } + &__header-cell { + .table &--has-icon { + padding: 0; + } + + .table &--after-icon { + padding-left: 0; + } + } + &__cell { &--field-definitions-head { width: calc(100% / 3); } .table &--has-action-btns { - padding-right: 1.25rem; + padding-right: calculateRem(20px); } &--has-checkbox { width: 5%; } + .table &--has-icon { + padding: 0 calculateRem(8px); + width: calculateRem(24px); + text-align: right; + vertical-align: middle; + line-height: 0; + } + + .table &--after-icon { + padding-left: 0; + } + &--no-content { - margin-bottom: 3rem; - padding: 0.75rem 1rem; + margin-bottom: calculateRem(48px); + padding: calculateRem(12px) calculateRem(16px); background-color: $ez-white; font-style: italic; color: $ez-color-base-dark; @@ -48,12 +70,12 @@ justify-content: space-between; background-color: $ez-ground-primary; align-items: center; - padding: 0 1.25rem; - min-height: 50px; - border-radius: .25rem .25rem 0 0; + padding: 0 calculateRem(20px); + min-height: calculateRem(50px); + border-radius: calculateRem(4px) calculateRem(4px) 0 0; &__headline { - font-size: 1.0625rem; + font-size: calculateRem(17px); margin-bottom: 0; font-weight: bold; color: $ez-black; @@ -65,20 +87,21 @@ } .table { - margin-bottom: 3rem; + margin-bottom: calculateRem(48px); - th, td { - padding: .7rem 1.4rem; - line-height: 20px; + th, + td { + padding: calculateRem(11px) calculateRem(22px); + line-height: calculateRem(20px); } thead th { - font-size: .9375rem; + font-size: calculateRem(15px); vertical-align: top; } td { - font-size: .875rem; + font-size: calculateRem(14px); vertical-align: middle; .checkbox label { @@ -109,11 +132,11 @@ } .ez-table-no-content { - margin-bottom: 3rem; - padding: 0.75rem 1rem; + margin-bottom: calculateRem(48px); + padding: calculateRem(12px) calculateRem(16px); background-color: $ez-white; font-style: italic; - font-size: .875rem; + font-size: calculateRem(14px); color: $ez-color-base-dark; } diff --git a/src/bundle/Resources/views/admin/bookmark/list.html.twig b/src/bundle/Resources/views/admin/bookmark/list.html.twig index e09727f711..7a6ec42eb5 100644 --- a/src/bundle/Resources/views/admin/bookmark/list.html.twig +++ b/src/bundle/Resources/views/admin/bookmark/list.html.twig @@ -29,11 +29,12 @@ - - - - - + + + + + + @@ -47,7 +48,12 @@ {% for bookmark in pager.currentPageResults %} - + +
{{ 'bookmark.list.name'|trans|desc('Name') }}{{ 'bookmark.list.content_type'|trans|desc('Content Type') }}{{ 'bookmark.list.path'|trans|desc('Path') }}{{ 'bookmark.list.name'|trans|desc('Name') }}{{ 'bookmark.list.content_type'|trans|desc('Content Type') }}{{ 'bookmark.list.path'|trans|desc('Path') }}
{{ form_widget(form_remove.bookmarks[bookmark.id]) }}{{ ez_content_name(bookmark.contentInfo) }} + + + + {{ ez_content_name(bookmark.contentInfo) }} {{ bookmark.contentType.name }} {% if bookmark.pathLocations|length > 1 %} 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 446d961a48..e758f08c86 100644 --- a/src/bundle/Resources/views/admin/content_draft/list.html.twig +++ b/src/bundle/Resources/views/admin/content_draft/list.html.twig @@ -40,13 +40,14 @@ - - - - - - - + + + + + + + + @@ -65,8 +66,13 @@ - - + + + diff --git a/src/bundle/Resources/views/admin/content_type/edit.html.twig b/src/bundle/Resources/views/admin/content_type/edit.html.twig index 31880a358c..9dbba5a3a8 100644 --- a/src/bundle/Resources/views/admin/content_type/edit.html.twig +++ b/src/bundle/Resources/views/admin/content_type/edit.html.twig @@ -17,7 +17,7 @@ {% block page_title_admin %} {% include '@ezdesign/parts/page_title.html.twig' with { title: 'content_type.view.edit.title'|trans({ '%name%': content_type.name })|desc('Editing Content Type: %name%'), - iconName: 'content-type' + content_type_identifier: content_type.identifier } %} {% endblock %} diff --git a/src/bundle/Resources/views/admin/content_type/list.html.twig b/src/bundle/Resources/views/admin/content_type/list.html.twig index ea95fdaab0..4b3d73d092 100644 --- a/src/bundle/Resources/views/admin/content_type/list.html.twig +++ b/src/bundle/Resources/views/admin/content_type/list.html.twig @@ -48,12 +48,13 @@
{{ '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.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') }}
{{ form_widget(form_remove.versions[row.id ~ '']) }} {{ row.name }}{{ row.type }} + + + + {{ row.name }}{{ row.content_type.name }} {{ admin_ui_config.languages.mappings[row.language].name }} {{ row.version }} {{ row.modified|localizeddate('medium', 'short', null, ez_user_settings['timezone']) }}
- - - - - - + + + + + + + @@ -66,7 +67,12 @@ {% do form_content_types_delete.content_types.setRendered %} {% endif %} - +
{{ 'content_type.view.list.column.name'|trans|desc('Name') }}{{ 'content_type.view.list.column.identifier'|trans|desc('Identifier') }}{{ 'content_type.view.list.column.id'|trans|desc('ID') }}{{ 'content_type.view.list.column.modification_date'|trans|desc('Modification date') }}{{ 'content_type.view.list.column.name'|trans|desc('Name') }}{{ 'content_type.view.list.column.identifier'|trans|desc('Identifier') }}{{ 'content_type.view.list.column.id'|trans|desc('ID') }}{{ 'content_type.view.list.column.modification_date'|trans|desc('Modification date') }}
+ + + + + {% set view_url = path('ezplatform.content_type.view', { 'contentTypeGroupId': content_type_group.id, 'contentTypeId': content_type.id diff --git a/src/bundle/Resources/views/admin/search/search.html.twig b/src/bundle/Resources/views/admin/search/search.html.twig index 2b31ef18ab..276b2bc197 100644 --- a/src/bundle/Resources/views/admin/search/search.html.twig +++ b/src/bundle/Resources/views/admin/search/search.html.twig @@ -48,10 +48,11 @@ - - - - + + + + + diff --git a/src/bundle/Resources/views/admin/search/search_table_row.html.twig b/src/bundle/Resources/views/admin/search/search_table_row.html.twig index 9be41efb7a..3b5330a003 100644 --- a/src/bundle/Resources/views/admin/search/search_table_row.html.twig +++ b/src/bundle/Resources/views/admin/search/search_table_row.html.twig @@ -1,5 +1,10 @@ - + diff --git a/src/bundle/Resources/views/admin/trash/list.html.twig b/src/bundle/Resources/views/admin/trash/list.html.twig index 8f3b608878..1ad16ebc20 100644 --- a/src/bundle/Resources/views/admin/trash/list.html.twig +++ b/src/bundle/Resources/views/admin/trash/list.html.twig @@ -65,10 +65,11 @@
{{ 'search.name'|trans|desc('Name') }}{{ 'search.modified'|trans|desc('Modified') }}{{ 'search.type'|trans|desc('Content Type') }}{{ 'search.name'|trans|desc('Name') }}{{ 'search.modified'|trans|desc('Modified') }}{{ 'search.type'|trans|desc('Content Type') }}
+ + + + + {{ row.name }} {{ row.modified|localizeddate('medium', 'short', null, ez_user_settings['timezone']) }}
- - - - + + + + + @@ -90,7 +91,12 @@ 'data-is-parent-in-trash': is_parent_in_trash ? '1': '0' }}) }} - + +
{{ 'trash.name'|trans|desc('Name') }}{{ 'trash.type'|trans|desc('Type') }}{{ 'trash.original_location'|trans|desc('Original location') }}{{ 'trash.name'|trans|desc('Name') }}{{ 'trash.type'|trans|desc('Type') }}{{ 'trash.original_location'|trans|desc('Original location') }}
{{ ez_content_name(trash_item.location.contentInfo) }} + + + + {{ ez_content_name(trash_item.location.contentInfo) }} {{ trash_item.contentType.name }} {% if not is_parent_in_trash %} diff --git a/src/bundle/Resources/views/content/content_edit/content_create.html.twig b/src/bundle/Resources/views/content/content_edit/content_create.html.twig index 409b227fad..0c1b2e6885 100644 --- a/src/bundle/Resources/views/content/content_edit/content_create.html.twig +++ b/src/bundle/Resources/views/content/content_edit/content_create.html.twig @@ -11,7 +11,7 @@

{{ 'creating_in_language'|trans({'%contentTypeName%': contentType.name, '%languageName%': language.name})|desc('Creating - %contentTypeName% in %languageName%') }}

- + {{ 'new_content_item'|trans({'%contentType%': contentType.name})|desc('New %contentType%') }}

diff --git a/src/bundle/Resources/views/content/content_edit/content_edit.html.twig b/src/bundle/Resources/views/content/content_edit/content_edit.html.twig index f35dbd6036..b939dedec9 100644 --- a/src/bundle/Resources/views/content/content_edit/content_edit.html.twig +++ b/src/bundle/Resources/views/content/content_edit/content_edit.html.twig @@ -15,7 +15,7 @@ {% endif %}

- + {{ content.name }}

diff --git a/src/bundle/Resources/views/content/content_edit/user_create.html.twig b/src/bundle/Resources/views/content/content_edit/user_create.html.twig index ad4268e9fa..3e70a356b3 100644 --- a/src/bundle/Resources/views/content/content_edit/user_create.html.twig +++ b/src/bundle/Resources/views/content/content_edit/user_create.html.twig @@ -7,7 +7,7 @@

{{ 'creating'|trans({'%contentType%': contentType.name})|desc('Creating - %contentType%') }}

- + {{ 'new_content_item'|trans({'%contentType%': contentType.name})|desc('New %contentType%') }}

diff --git a/src/bundle/Resources/views/content/content_edit/user_edit.html.twig b/src/bundle/Resources/views/content/content_edit/user_edit.html.twig index 0e664f6511..3e7d3c9e3e 100644 --- a/src/bundle/Resources/views/content/content_edit/user_edit.html.twig +++ b/src/bundle/Resources/views/content/content_edit/user_edit.html.twig @@ -7,7 +7,7 @@

{{ 'editing'|trans({'%contentType%': contentType.name})|desc('Editing - %contentType%') }}

- + {{ user.name }}

diff --git a/src/bundle/Resources/views/dashboard/tab/all_content.html.twig b/src/bundle/Resources/views/dashboard/tab/all_content.html.twig index f1923abcc8..ff00dac5d9 100644 --- a/src/bundle/Resources/views/dashboard/tab/all_content.html.twig +++ b/src/bundle/Resources/views/dashboard/tab/all_content.html.twig @@ -4,17 +4,23 @@ - - - - - + + + + + + {% for row in data %} - + +
{{ 'dashboard.table.name'|trans|desc('Name') }}{{ 'dashboard.table.content_type'|trans|desc('Content Type') }}{{ 'dashboard.table.contributor'|trans|desc('Contributor') }}{{ 'dashboard.table.last_saved'|trans|desc('Last Saved') }}{{ 'dashboard.table.name'|trans|desc('Name') }}{{ 'dashboard.table.content_type'|trans|desc('Content Type') }}{{ 'dashboard.table.contributor'|trans|desc('Contributor') }}{{ 'dashboard.table.last_saved'|trans|desc('Last Saved') }}
{{ row.name }} + + + + {{ row.name }} {{ row.type }} {% if row.contributor is not null %} diff --git a/src/bundle/Resources/views/dashboard/tab/all_media.html.twig b/src/bundle/Resources/views/dashboard/tab/all_media.html.twig index 42ce889b8e..f13253e0d5 100644 --- a/src/bundle/Resources/views/dashboard/tab/all_media.html.twig +++ b/src/bundle/Resources/views/dashboard/tab/all_media.html.twig @@ -4,17 +4,23 @@ - - - - - + + + + + + {% for row in data %} - + +
{{ 'dashboard.table.name'|trans|desc('Name') }}{{ 'dashboard.table.content_type'|trans|desc('Content Type') }}{{ 'dashboard.table.contributor'|trans|desc('Contributor') }}{{ 'dashboard.table.last_saved'|trans|desc('Last Saved') }}{{ 'dashboard.table.name'|trans|desc('Name') }}{{ 'dashboard.table.content_type'|trans|desc('Content Type') }}{{ 'dashboard.table.contributor'|trans|desc('Contributor') }}{{ 'dashboard.table.last_saved'|trans|desc('Last Saved') }}
{{ row.name }} + + + + {{ row.name }} {{ row.type }} {% if row.contributor is not null %} diff --git a/src/bundle/Resources/views/dashboard/tab/my_content.html.twig b/src/bundle/Resources/views/dashboard/tab/my_content.html.twig index 3bc45a3fbc..266a12e37d 100644 --- a/src/bundle/Resources/views/dashboard/tab/my_content.html.twig +++ b/src/bundle/Resources/views/dashboard/tab/my_content.html.twig @@ -4,16 +4,22 @@ - - - - + + + + + {% for row in data %} - + +
{{ 'dashboard.table.name'|trans|desc('Name') }}{{ 'dashboard.table.content_type'|trans|desc('Content Type') }}{{ 'dashboard.table.last_saved'|trans|desc('Last Saved') }}{{ 'dashboard.table.name'|trans|desc('Name') }}{{ 'dashboard.table.content_type'|trans|desc('Content Type') }}{{ 'dashboard.table.last_saved'|trans|desc('Last Saved') }}
{{ row.name }} + + + + {{ row.name }} {{ row.type }} {{ row.modified|localizeddate('medium', 'short', null, ez_user_settings['timezone']) }} diff --git a/src/bundle/Resources/views/dashboard/tab/my_drafts.html.twig b/src/bundle/Resources/views/dashboard/tab/my_drafts.html.twig index e9bef85865..1d1bae2b20 100644 --- a/src/bundle/Resources/views/dashboard/tab/my_drafts.html.twig +++ b/src/bundle/Resources/views/dashboard/tab/my_drafts.html.twig @@ -4,20 +4,26 @@ - - - - - - + + + + + + + {% for row in data %} {% set content_draft_edit_url = content_is_user|default(false) ? 'ez_user_update' : 'ez_content_draft_edit' %} - - + + + diff --git a/src/bundle/Resources/views/dashboard/tab/my_media.html.twig b/src/bundle/Resources/views/dashboard/tab/my_media.html.twig index 81499930e9..d6607f29ae 100644 --- a/src/bundle/Resources/views/dashboard/tab/my_media.html.twig +++ b/src/bundle/Resources/views/dashboard/tab/my_media.html.twig @@ -4,16 +4,22 @@
{{ 'dashboard.table.name'|trans|desc('Name') }}{{ 'dashboard.table.content_type'|trans|desc('Content Type') }}{{ 'dashboard.table.modified_language'|trans|desc('Modified Language') }}{{ 'dashboard.table.version'|trans|desc('Version') }}{{ 'dashboard.table.last_saved'|trans|desc('Last Saved') }}{{ 'dashboard.table.name'|trans|desc('Name') }}{{ 'dashboard.table.content_type'|trans|desc('Content Type') }}{{ 'dashboard.table.modified_language'|trans|desc('Modified Language') }}{{ 'dashboard.table.version'|trans|desc('Version') }}{{ 'dashboard.table.last_saved'|trans|desc('Last Saved') }}
{{ row.name }}{{ row.type }} + + + + {{ row.name }}{{ row.content_type.name }} {{ admin_ui_config.languages.mappings[row.language].name }} {{ row.version }} {{ row.modified|localizeddate('medium', 'short', null, ez_user_settings['timezone']) }}
- - - - + + + + + {% for row in data %} - + +
{{ 'dashboard.table.name'|trans|desc('Name') }}{{ 'dashboard.table.content_type'|trans|desc('Content Type') }}{{ 'dashboard.table.last_saved'|trans|desc('Last Saved') }}{{ 'dashboard.table.name'|trans|desc('Name') }}{{ 'dashboard.table.content_type'|trans|desc('Content Type') }}{{ 'dashboard.table.last_saved'|trans|desc('Last Saved') }}
{{ row.name }} + + + + {{ row.name }} {{ row.type }} {{ row.modified|localizeddate('medium', 'short', null, ez_user_settings['timezone']) }} diff --git a/src/bundle/Resources/views/form_fields.html.twig b/src/bundle/Resources/views/form_fields.html.twig index 04551629fd..c32a8d65b8 100644 --- a/src/bundle/Resources/views/form_fields.html.twig +++ b/src/bundle/Resources/views/form_fields.html.twig @@ -31,6 +31,9 @@ {%- else -%}
{{ form_widget(form[choice.value]) }} + + +
{%- endif -%} {%- endfor -%} diff --git a/src/bundle/Resources/views/parts/page_title.html.twig b/src/bundle/Resources/views/parts/page_title.html.twig index 97fea99fb6..7f4313b75c 100644 --- a/src/bundle/Resources/views/parts/page_title.html.twig +++ b/src/bundle/Resources/views/parts/page_title.html.twig @@ -5,6 +5,10 @@ + {% elseif content_type_identifier is defined %} + + + {% endif %} {{ title }} diff --git a/src/bundle/Resources/views/parts/tab/content_type.html.twig b/src/bundle/Resources/views/parts/tab/content_type.html.twig index 405e2c02f6..ca9c079275 100644 --- a/src/bundle/Resources/views/parts/tab/content_type.html.twig +++ b/src/bundle/Resources/views/parts/tab/content_type.html.twig @@ -17,7 +17,7 @@ {% block page_title %} {% include '@ezdesign/parts/page_title.html.twig' with { title: 'content_type.view.view.title'|trans({ '%name%': content_type.name })|desc('%name%'), - iconName: 'content-type' + content_type_identifier: content_type.identifier } %} {% endblock %} diff --git a/src/lib/Tab/Dashboard/PagerContentToDataMapper.php b/src/lib/Tab/Dashboard/PagerContentToDataMapper.php index fbf111d29d..aaa3667b56 100644 --- a/src/lib/Tab/Dashboard/PagerContentToDataMapper.php +++ b/src/lib/Tab/Dashboard/PagerContentToDataMapper.php @@ -76,6 +76,7 @@ public function map(Pagerfanta $pager): array 'language' => $contentInfo->mainLanguageCode, 'contributor' => $contributor, 'version' => $content->versionInfo->versionNo, + 'content_type' => $content->getContentType(), 'modified' => $content->versionInfo->modificationDate, 'initialLanguageCode' => $content->versionInfo->initialLanguageCode, 'content_is_user' => (new ContentIsUser($this->userService))->isSatisfiedBy($content), diff --git a/src/lib/UI/Config/Provider/ContentTypes.php b/src/lib/UI/Config/Provider/ContentTypes.php index ff4407e5b2..adc3418cea 100644 --- a/src/lib/UI/Config/Provider/ContentTypes.php +++ b/src/lib/UI/Config/Provider/ContentTypes.php @@ -10,6 +10,7 @@ use eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProviderInterface; use EzSystems\EzPlatformAdminUi\UI\Config\ProviderInterface; use EzSystems\EzPlatformAdminUi\UI\Service\ContentTypeIconResolver; +use Symfony\Component\Routing\Generator\UrlGeneratorInterface; class ContentTypes implements ProviderInterface { @@ -22,19 +23,25 @@ class ContentTypes implements ProviderInterface /** @var \EzSystems\EzPlatformAdminUi\UI\Service\ContentTypeIconResolver */ private $contentTypeIconResolver; + /** @var \Symfony\Component\Routing\Generator\UrlGeneratorInterface */ + private $urlGenerator; + /** * @param \eZ\Publish\API\Repository\ContentTypeService $contentTypeService * @param \eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProviderInterface $userLanguagePreferenceProvider * @param \EzSystems\EzPlatformAdminUi\UI\Service\ContentTypeIconResolver $contentTypeIconResolver + * @param \Symfony\Component\Routing\Generator\UrlGeneratorInterface $urlGenerator */ public function __construct( ContentTypeService $contentTypeService, UserLanguagePreferenceProviderInterface $userLanguagePreferenceProvider, - ContentTypeIconResolver $contentTypeIconResolver + ContentTypeIconResolver $contentTypeIconResolver, + UrlGeneratorInterface $urlGenerator ) { $this->contentTypeService = $contentTypeService; $this->userLanguagePreferenceProvider = $userLanguagePreferenceProvider; $this->contentTypeIconResolver = $contentTypeIconResolver; + $this->urlGenerator = $urlGenerator; } /** @@ -58,6 +65,9 @@ public function getConfig() 'identifier' => $contentType->identifier, 'name' => $contentType->getName(), 'thumbnail' => $this->contentTypeIconResolver->getContentTypeIcon($contentType->identifier), + 'href' => $this->urlGenerator->generate('ezpublish_rest_loadContentType', [ + 'contentTypeId' => $contentType->id, + ]), ]; } } diff --git a/src/lib/UI/Dataset/ContentDraftsDataset.php b/src/lib/UI/Dataset/ContentDraftsDataset.php index d71bfa522e..65351be848 100644 --- a/src/lib/UI/Dataset/ContentDraftsDataset.php +++ b/src/lib/UI/Dataset/ContentDraftsDataset.php @@ -103,10 +103,9 @@ public function getContentDrafts(): array /** * @param \eZ\Publish\API\Repository\Values\Content\VersionInfo $draft + * @param \eZ\Publish\API\Repository\Values\ContentType\ContentType $contentType * * @return array - * - * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException */ private function mapContentDraft(VersionInfo $draft, ContentType $contentType): array { @@ -120,6 +119,7 @@ private function mapContentDraft(VersionInfo $draft, ContentType $contentType): 'contentId' => $contentInfo->id, 'name' => $draft->getName(), 'type' => $contentType->getName(), + 'content_type' => $contentType, 'language' => $draft->initialLanguageCode, 'version' => $draft->versionNo, 'modified' => $draft->modificationDate,