{% extends 'OroUIBundle:actions:update.html.twig' %} {% import 'OroUIBundle::macros.html.twig' as UI %} {% set entityId = entity.id %} {% set parentId = entity.parent ? entity.parent.id : null %} {% set formAction = entityId ? url('oro_menu_item_update', {'id': entityId}) : url('oro_menu_item_create', {'id': parentId}) %} {% oro_title_set({params : { "%title%": entity.defaultTitle.string|default('N/A'|trans), "%entityName%": (parentId ? 'oro.menu.menuitem.entity_label' : 'oro.menu.menuitem.roots_entity_label')|trans, } }) %} {% block navButtons %} {% if entityId %} {% if resource_granted('oro_menu_item_create') %} {{ UI.button({ 'path' : path('oro_menu_item_create', { 'id': entityId }), 'iCss': 'icon-folder-close', 'aCss': 'btn-primary', 'label': 'oro.ui.create_entity'|trans({'%entityName%': 'oro.menu.menuitem.entity_label'|trans}), 'title': 'oro.ui.create_entity'|trans({'%entityName%': 'oro.menu.menuitem.entity_label'|trans}) }) }} {% endif %} {% endif %} {{ parent() }} {{ UI.cancelButton(path('oro_menu_item_view', {'id': root.id})) }} {% set html = UI.saveAndStayButton() %} {{ UI.dropdownSaveButton({'html': html}) }} {% endblock navButtons %} {% block pageHeader %} {% if entityId %} {% set breadcrumbs = { 'entity': entity, 'indexPath': path('oro_menu_item_roots'), 'indexLabel': 'oro.menu.menuitem.roots_plural_label'|trans, 'entityTitle': entity.defaultTitle|default('N/A'|trans), 'additional': [{ 'indexPath': path('oro_menu_item_view', {'id': entity.root}), 'indexLabel': root.defaultTitle }] } %} {% else %} {% set entityLabel = parentId ? 'oro.menu.menuitem.entity_label' : 'oro.menu.menuitem.roots_entity_label' %} {% set title = 'oro.ui.create_entity'|trans({'%entityName%': entityLabel|trans}) %} {% set breadcrumbs = { 'entity': entity, 'indexPath': path('oro_menu_item_roots'), 'indexLabel': 'oro.menu.menuitem.roots_plural_label'|trans, 'entityTitle': title, 'additional': [{ 'indexPath': path('oro_menu_item_view', {'id': root.id}), 'indexLabel': root.defaultTitle }] } %} {% endif %} {{ parent() }} {% endblock pageHeader %} {% block content_data %} {% set id = 'menuitem-edit' %} {% set dataForm = [ form_row(form.titles), form_row(form.uri), form_row(form.condition), form_row(form.image) ] %} {% set dataBlocks = [{ 'title': 'oro.menu.menuitem.sections.general'|trans, 'class': 'active', 'subblocks': [{ 'title': '', 'data': dataForm }] }] %} {% set additionalData = [] %} {% for child in form.children if child.vars.extra_field is defined and child.vars.extra_field %} {% set additionalData = additionalData|merge([form_row(child)]) %} {% endfor %} {% if additionalData is not empty %} {% set dataBlocks = dataBlocks|merge([{ 'title': 'oro.menu.menuitem.sections.additional'|trans, 'subblocks': [{ 'title': '', 'useSpan': false, 'data' : additionalData }] }] ) %} {% endif %} {% set data = { 'formErrors': form_errors(form), 'dataBlocks': dataBlocks } %}
{% endblock content_data %}