Skip to content

Commit f20c8da

Browse files
authored
IBX-10204: Updated create/edit content header (#1630)
1 parent dd6c5a6 commit f20c8da

File tree

10 files changed

+134
-91
lines changed

10 files changed

+134
-91
lines changed

src/bundle/Resources/public/img/ibexa-icons.svg

Lines changed: 10 additions & 0 deletions
Loading
Lines changed: 10 additions & 0 deletions
Loading

src/bundle/Resources/public/js/scripts/edit.header.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
return;
1010
}
1111

12+
const headerBottomRowNode = headerNode.querySelector('.ibexa-edit-header__row--bottom');
1213
const { height: expandedHeaderHeight } = headerNode.getBoundingClientRect();
1314
const scrolledContent = doc.querySelector('.ibexa-edit-content > :first-child');
1415
const { controlZIndex } = ibexa.helpers.modal;
1516
const fitEllipsizedTitle = () => {
16-
const headerBottomRowNode = headerNode.querySelector('.ibexa-edit-header__row--bottom');
1717
const titleNode = headerBottomRowNode.querySelector('.ibexa-edit-header__name--ellipsized');
1818
const firstMenuEntryNode = headerNode.querySelector('.ibexa-context-menu .ibexa-context-menu__item');
1919
const { left: titleNodeLeft, width: titleNodeWidth } = titleNode.getBoundingClientRect();
@@ -43,6 +43,8 @@
4343

4444
if (shouldHeaderBeSlim) {
4545
fitEllipsizedTitle();
46+
} else {
47+
headerBottomRowNode.style.width = '100%';
4648
}
4749
};
4850

src/bundle/Resources/public/scss/_edit-header.scss

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@
3030
}
3131

3232
&--full {
33-
display: inline-block;
33+
display: -webkit-box;
34+
-webkit-line-clamp: 2;
35+
-webkit-box-orient: vertical;
36+
white-space: normal;
3437
max-width: 100%;
3538
overflow: hidden;
3639
text-overflow: ellipsis;
@@ -44,6 +47,7 @@
4447

4548
&--top {
4649
height: calculateRem(48px);
50+
margin-bottom: calculateRem(16px);
4751

4852
.ibexa-edit-header__title {
4953
height: 0;
@@ -73,31 +77,21 @@
7377
fill: $ibexa-color-dark-400;
7478
}
7579
}
76-
77-
&--left {
78-
max-width: 75%;
79-
80-
.ibexa-label {
81-
margin-bottom: 0;
82-
color: $ibexa-color-dark-400;
83-
}
84-
}
8580
}
8681

8782
&__context-actions {
8883
display: flex;
8984
width: 100%;
9085
}
9186

92-
&__tooltip {
93-
margin-left: calculateRem(8px);
87+
&__info-bar {
9488
display: flex;
95-
align-items: center;
96-
justify-content: center;
89+
transition: all $ibexa-admin-transition-duration $ibexa-admin-transition;
9790
}
9891

99-
&__action-name-container {
100-
transition: all $ibexa-admin-transition-duration $ibexa-admin-transition;
92+
&__info-bar-action-type {
93+
display: flex;
94+
align-items: center;
10195
}
10296

10397
&__action-name {
@@ -108,6 +102,8 @@
108102
}
109103

110104
&__subtitle {
105+
margin-top: calculateRem(4px);
106+
font-size: $ibexa-text-font-size-medium;
111107
opacity: 1;
112108
transition: all $ibexa-admin-transition-duration $ibexa-admin-transition;
113109
}
@@ -122,12 +118,30 @@
122118
transition-duration: $ibexa-admin-transition-duration;
123119
}
124120

121+
&__meta {
122+
display: flex;
123+
flex-direction: row;
124+
gap: calculateRem(4px);
125+
}
126+
127+
&__meta-item {
128+
display: flex;
129+
gap: calculateRem(4px);
130+
align-items: center;
131+
margin-top: calculateRem(8px);
132+
padding: calculateRem(4px) calculateRem(8px);
133+
font-size: calculateRem(10px);
134+
color: $ibexa-color-dark-500;
135+
border-radius: calculateRem(16px);
136+
border: calculateRem(1px) solid $ibexa-color-light-600;
137+
}
138+
125139
&__extra-bottom-content {
126140
margin-top: calculateRem(10px);
127141
}
128142

129143
.ibexa-autosave {
130-
display: inline-block;
144+
display: flex;
131145
border-left: calculateRem(1px) solid $ibexa-color-light;
132146
padding-left: calculateRem(12px);
133147
margin-left: calculateRem(12px);
@@ -152,7 +166,7 @@
152166
border-bottom: none;
153167
}
154168

155-
&__action-name-container {
169+
&__info-bar {
156170
margin-top: calculateRem(-8px);
157171
}
158172

@@ -170,6 +184,10 @@
170184
min-height: calculateRem(34px);
171185
}
172186

187+
&__meta {
188+
display: none;
189+
}
190+
173191
&__name {
174192
&--ellipsized {
175193
display: inline-block;

src/bundle/Resources/translations/ibexa_content_create.en.xliff

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
<target state="new">Creating</target>
1717
<note>key: creating</note>
1818
</trans-unit>
19-
<trans-unit id="750bead6705b295c7b7d66c27b2768c1b9329ed5" resname="editing_details">
20-
<source>Location: %location% Translation: %language%</source>
21-
<target state="new">Location: %location% Translation: %language%</target>
22-
<note>key: editing_details</note>
19+
<trans-unit id="582b09a837963ba464ba24493c8cc7c360b99708" resname="editing_details_subtitle">
20+
<source>under: %location%</source>
21+
<target state="new">under: %location%</target>
22+
<note>key: editing_details_subtitle</note>
2323
</trans-unit>
2424
<trans-unit id="32d50c07b2eacd6fa72742ff1c1f5963c26a251d" resname="new_content_item">
2525
<source>New %contentType%</source>

src/bundle/Resources/translations/ibexa_content_edit.en.xliff

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
<target state="new">This Field Type is not editable</target>
1717
<note>key: content.field.non_editable</note>
1818
</trans-unit>
19+
<trans-unit id="927b5658769b10a67f0aa5e9f3d8b35e746e0276" resname="content.meta.created_by">
20+
<source>Created by %name%</source>
21+
<target state="new">Created by %name%</target>
22+
<note>key: content.meta.created_by</note>
23+
</trans-unit>
1924
<trans-unit id="07d6fb7c02b8730592a3bb68a315caa63031d44e" resname="content.published.success">
2025
<source>Content published.</source>
2126
<target state="new">Content published.</target>
@@ -31,6 +36,11 @@
3136
<target state="new">Location: %location% Translation: %language%</target>
3237
<note>key: editing_details</note>
3338
</trans-unit>
39+
<trans-unit id="582b09a837963ba464ba24493c8cc7c360b99708" resname="editing_details_subtitle">
40+
<source>under: %location%</source>
41+
<target state="new">under: %location%</target>
42+
<note>key: editing_details_subtitle</note>
43+
</trans-unit>
3444
<trans-unit id="009667fab56f0bec66634f009a75ffd9425f2987" resname="fieldtype.translation_is_disabled">
3545
<source>Translating the %fieldName% Field is disabled. See content type definition for details.</source>
3646
<target state="new">Translating the %fieldName% Field is disabled. See content type definition for details.</target>

src/bundle/Resources/views/themes/admin/content/create/create.html.twig

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
title: 'new_content_item'|trans({'%contentType%': content_type.name})|desc('New %contentType%'),
2020
icon_name: content_type.name,
2121
show_autosave_status: true,
22-
subtitle: 'editing_details'|trans({
23-
'%location%': parent_location.contentInfo.name,
24-
'%language%': language.name
25-
})|desc('Location: %location% Translation: %language%' ),
22+
subtitle: 'editing_details_subtitle'|trans({ '%location%': parent_location.contentInfo.name })|desc('under: %location%'),
2623
context_actions: knp_menu_render(content_create_sidebar_right, {'template': '@ibexadesign/ui/menu/context_menu.html.twig'})
2724
} %}
2825
{% block after_title %}

src/bundle/Resources/views/themes/admin/content/edit/edit.html.twig

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@
2222
icon_name: 'edit',
2323
show_autosave_status: true,
2424
description: content_type.description,
25-
subtitle: 'editing_details'|trans({
26-
'%location%': parent_location.contentInfo.name,
27-
'%language%': language.name
28-
})|desc('Location: %location% Translation: %language%'),
25+
language: language,
26+
subtitle: 'editing_details_subtitle'|trans({ '%location%': parent_location.contentInfo.name })|desc('under: %location%'),
2927
context_actions: knp_menu_render(content_edit_sidebar_right, { 'template': '@ibexadesign/ui/menu/context_menu.html.twig' })
3028
} %}
3129
{% block after_title %}

0 commit comments

Comments
 (0)