Skip to content

Commit

Permalink
IBX-6315: Edit/Preview embedded items
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasOsti committed Sep 1, 2023
1 parent 80ae098 commit 8e31e17
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@
? {
href: Routing.generate('ibexa.product_catalog.product.edit', {
productCode,
languageCode: languages.languageCode,
languageCode: languages[0].languageCode,
}),
}
: { onClick: () => editContent({ contentId, locationId, languageCode: languages.languageCode }) };
: { onClick: () => editContent({ contentId, locationId, languageCode: languages[0].languageCode }) };

return {
label: Translator.trans(/*@Desc("Edit")*/ 'embedded_items.action.edit', {}, 'content'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@
&__table-action--remove-item {
padding: calculateRem(4px);
}

&__actions-cell {
display: flex;
gap: calculateRem(4px);
justify-content: center;
align-items: center;
}
}

.btn {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@

{% set body_row_cols_template = body_row_cols_template|merge([
{
content: col_raw_actions,
content: col_raw_actions_template,
raw: true,
has_icon: true,
class: 'ibexa-relations__actions-cell'
},
]) %}

Expand All @@ -88,6 +88,7 @@
class: 'ibexa-relations__item',
}) }}
{% endset %}

<div
class="ibexa-relations__wrapper"
data-row-template="{{ row_template|e('html_attr') }}"
Expand All @@ -102,7 +103,7 @@
{% include '@ibexadesign/ui/component/embedded_item_actions/embedded_item_actions.html.twig' with {
content_id: relation.contentId,
location_id: relation.contentInfo.mainLocationId,
versionNo: relation.contentInfo.currentVersionNo,
version_no: relation.contentInfo.currentVersionNo,
} only %}
{% endset %}

Expand Down Expand Up @@ -162,7 +163,7 @@
{
content: col_raw_actions,
raw: true,
has_icon: true,
class: 'ibexa-relations__actions-cell'
},
]) %}

Expand Down Expand Up @@ -310,5 +311,4 @@
</div>
{% set attr = attr|merge({'hidden': 'hidden'}) %}
{{ block('form_widget') }}

{% endblock %}
42 changes: 17 additions & 25 deletions src/bundle/Resources/views/themes/admin/ui/html_body.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,23 @@
{% set form = ibexa_render_embedded_item_edit_form() %}

{{ form_start(form, {
attr: { target: '_blank' }
attr: { target: '_blank' }
}) }}
{{ form_widget(form.content_info, {
attr: {
hidden: 'hidden',
class: 'ibexa-embedded-item-edit__form-field ibexa-embedded-item-edit__form-field--content-info'
}
}) }}
{{ form_widget(form.version_info, {
attr: {
hidden: 'hidden',
class: 'ibexa-embedded-item-edit__form-field ibexa-embedded-item-edit__form-field--version-info'
}
}) }}
{{ form_widget(form.language, {
attr: {
hidden: 'hidden',
class: 'ibexa-embedded-item-edit__form-field ibexa-embedded-item-edit__form-field--language'
}
}) }}
{{ form_widget(form.location, {
attr: {
hidden: 'hidden',
class: 'ibexa-embedded-item-edit__form-field ibexa-embedded-item-edit__form-field--location'
}
}) }}
{{ form_widget(form.content_info, { 'attr': {
'hidden': 'hidden',
'class': 'ibexa-embedded-item-edit__form-field ibexa-embedded-item-edit__form-field--content-info'
} }) }}
{{ form_widget(form.version_info, { 'attr': {
'hidden': 'hidden',
'class': 'ibexa-embedded-item-edit__form-field ibexa-embedded-item-edit__form-field--version-info'
} }) }}
{{ form_widget(form.language, { 'attr': {
'hidden': 'hidden',
'class': 'ibexa-embedded-item-edit__form-field ibexa-embedded-item-edit__form-field--language'
} }) }}
{{ form_widget(form.location, { 'attr': {
'hidden': 'hidden',
'class': 'ibexa-embedded-item-edit__form-field ibexa-embedded-item-edit__form-field--location'
} }) }}
{{ form_end(form) }}
</div>

0 comments on commit 8e31e17

Please sign in to comment.