Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
266 lines (244 sloc) 13.5 KB
{% set isWidgetContext = isWidgetContext is defined ? isWidgetContext : false %}
{% extends isWidgetContext ? 'OroFormBundle:Layout:widgetForm.html.twig' : bap.layout %}
{% import 'OroSyncBundle:Include:contentTags.html.twig' as syncMacro %}
{% import 'OroUIBundle::macros.html.twig' as UI %}
{% set entity = entity is defined ? entity : null %}
{% block before_content_addition %}
{% placeholder update_before_content_addition with {entity: entity} %}
{% endblock before_content_addition %}
{% block content %}
{% import 'OroUIBundle::macros.html.twig' as UI %}
{% if isWidgetContext and savedId is defined and savedId %}
{% block widget_context %}
<div {{ UI.renderPageComponentAttributes({
module: 'oroui/js/app/components/widget-form-component',
options: {
_wid: app.request.get('_wid'),
data: savedId|default(null)
}
}) }}></div>
{% endblock widget_context %}
{% else %}
{% set formAction = formAction|default() %}
{% if addQueryParameters is not defined or addQueryParameters == true %}
{% set formAction = oro_url_add_query(formAction) %}
{% endif %}
{% set formAttr = formAttr|default({})|merge({
'id': form.vars.id,
'data-collect': 'true'
}) %}
{% for key,value in formAttr %}
{% if value is iterable %}
{% set formAttr = formAttr|merge({(key): value|json_encode}) %}
{% endif %}
{% endfor %}
{% if pageComponent is defined %}
{% for key,value in pageComponent %}
{% if key == 'layout' %}
{% set formAttr = formAttr|merge({'data-layout': pageComponent.layout}) %}
{% elseif value is iterable %}
{% set formAttr = formAttr|merge({('data-page-component-' ~ key): value|json_encode}) %}
{% else %}
{% set formAttr = formAttr|merge({('data-page-component-' ~ key): value}) %}
{% endif %}
{% endfor %}
{% endif %}
{{ form_start(form, {'action': formAction, 'attr': formAttr}) }}
{% if isWidgetContext %}
{% block page_widget_actions %}
<div class="widget-actions">
<button type="reset" class="btn">{{ 'Cancel'|trans }}</button>
<button type="submit" class="btn btn-success">{{ 'Save'|trans }}</button>
</div>
{% endblock page_widget_actions %}
{% else %}
<div class="container-fluid page-title">
{% set titleButtonsBlock %}
{% placeholder update_navButtons_before with {entity: entity} %}
{% block navButtons %}{% placeholder update_navButtons with {entity: entity} %}{% endblock navButtons %}
{% placeholder update_navButtons_after with {entity: entity} %}
{% if form.vars.method != 'GET' %}
{% set inputAction = form.vars.default_input_action is defined
? form.vars.default_input_action
: constant('Oro\\Bundle\\UIBundle\\Route\\Router::ACTION_SAVE_CLOSE')
%}
<input
type="hidden"
name="input_action"
value="{{ inputAction }}"
data-form-id="{{ form.vars.id }}"
/>
{% endif %}
{% endset %}
{% set pageActionsBlock %}
{% block pageActions %}
{% placeholder update_pageActions_before with {entity: entity} %}
{% set audit_entity_id = audit_entity_id is defined ? audit_entity_id : form.vars.value.id|default %}
{% if audit_entity_id %}
{% placeholder change_history_block with {
'entity': entity|default(form.vars.value),
'entity_class': audit_entity_class|default(null),
'id': audit_entity_id,
'title': audit_title|default(form.vars.value.__toString is defined ? form.vars.value.__toString : null),
'audit_path': audit_path|default('oro_dataaudit_history'),
'audit_show_change_history': audit_show_change_history|default(false)
} %}
{% endif %}
{% placeholder update_pageActions_after with {entity: entity} %}
{% endblock pageActions %}
{% endset %}
<div class="navigation navbar-extra navbar-extra-right">
{% block pageHeader %}
<div class="row">
<div class="pull-left pull-left-extra">
{% if avatar is defined %}
<div class="page-title__icon">
{%- if avatar %}
<img src="{{ avatar }}" alt="{{ breadcrumbs.entityTitle }}"/>
{% endif -%}
</div>
{% endif %}
<div class="page-title__path">
<div class="top-row">
{% block breadcrumbs %}
{% if breadcrumbs is defined %}
<div class="page-title__entity-title-wrapper">
<div class="sub-title">
{%- if breadcrumbs.indexPath is defined -%}
<a href="{{ oro_url_add_query(breadcrumbs.indexPath) }}">{{ breadcrumbs.indexLabel }}</a>
{%- else -%}
{{ breadcrumbs.indexLabel }}
{%- endif -%}
</div>
<span class="separator">/</span>
{% if breadcrumbs.additional is defined %}
{% for breadcrumb in breadcrumbs.additional %}
<div class="sub-title">
{%- if breadcrumb.indexPath is defined -%}
<a href="{{ breadcrumb.indexPath }}">{{ breadcrumb.indexLabel }}</a>
{%- else -%}
{{ breadcrumb.indexLabel }}
{%- endif -%}
</div>
<span class="separator">/</span>
{% endfor %}
{% endif %}
{% if breadcrumbs.rawEntityTitle is defined and breadcrumbs.rawEntityTitle %}
<h1 class="page-title__entity-title">{{ breadcrumbs.entityTitle|raw }}</h1>
{% else %}
<h1 class="page-title__entity-title">{{ breadcrumbs.entityTitle }}</h1>
{% endif %}
</div>
{% endif %}
{% block breadcrumbMessage %}{% endblock breadcrumbMessage %}
{% endblock breadcrumbs %}
</div>
</div>
</div>
<div class="pull-right title-buttons-container">
{{ titleButtonsBlock }}
</div>
</div>
<div class="row inline-info">
<div class="pull-left-extra">
<div class="clearfix">
<ul class="inline">
{% block stats %}
{% if breadcrumbs.entity.createdAt is defined and breadcrumbs.entity.updatedAt is defined %}
{% if is_granted('VIEW', breadcrumbs.entity, 'createdAt') %}
<li>{{ 'oro.ui.created_at'|trans }}: {{ breadcrumbs.entity.createdAt ? breadcrumbs.entity.createdAt|oro_format_datetime : 'oro.ui.empty'|trans }}</li>
{% endif %}
{% if is_granted('VIEW', breadcrumbs.entity, 'updatedAt') %}
<li>{{ 'oro.ui.updated_at'|trans }}: {{ breadcrumbs.entity.updatedAt ? breadcrumbs.entity.updatedAt|oro_format_datetime : 'oro.ui.empty'|trans }}</li>
{% endif %}
{% endif %}
{% endblock stats %}
</ul>
</div>
</div>
<div class="pull-right page-title__entity-info-state">
<div class="inline-decorate-container">
<ul class="inline-decorate">
{{ pageActionsBlock }}
</ul>
</div>
</div>
</div>
{% endblock pageHeader %}
</div>
</div>
{% endif %}
<div class="layout-content">
{% block content_data %}
{% set data = oro_form_process(data, form, entity) %}
{% if entity and data is defined and data.dataBlocks is defined %}
{% set dataBlocks = data.dataBlocks %}
{%- set activitiesData -%}
{% placeholder update_content_data_activities with {entity: entity} %}
{%- endset -%}
{% if activitiesData is not empty %}
{% set dataBlocks = dataBlocks|merge([{
'title': 'oro.activity.sections.activities'|trans,
'subblocks': [
{
'spanClass': 'empty',
'data': [activitiesData]
}
]
}]) %}
{% endif %}
{%- set communicationsData -%}
{% placeholder update_content_data_communications with {entity: entity} %}
{%- endset -%}
{% if communicationsData is not empty %}
{% set dataBlocks = dataBlocks|merge([{
'title': 'Communications'|trans,
'subblocks': [
{
'spanClass': 'empty',
'data': [communicationsData]
}
]
}]) %}
{% endif %}
{%- set additionalInformationData -%}
{% placeholder update_content_data_additional_information with {entity: entity} %}
{%- endset -%}
{% if additionalInformationData is not empty %}
{% set dataBlocks = dataBlocks|merge([{
'title': 'Additional Information'|trans,
'subblocks': [
{
'spanClass': 'empty',
'data': [additionalInformationData]
}
]
}]) %}
{% endif %}
{%- set commentsData -%}
{% placeholder update_content_data_comments with {entity: entity} %}
{%- endset -%}
{% if commentsData is not empty %}
{% set dataBlocks = dataBlocks|merge([{
'title': 'oro.comment.entity_plural_label'|trans,
'subblocks': [
{
'spanClass': 'responsive-cell activity-list-widget',
'data': [commentsData]
}
]
}]) %}
{% endif %}
{% set data = data|merge({'dataBlocks': dataBlocks}) %}
{% endif %}
{{ UI.scrollData(id, data, entity, form) }}
{% endblock content_data %}
</div>
{% block sync_content_tags %}
{# block added just for possibility to disable it in child templates if needed #}
{{ syncMacro.syncContentTags(form.vars.value) }}
{% endblock %}
{{ form_end(form, {'render_rest': false}) }}
{{ oro_form_js_validation(form) }}
{% endif %}
{% endblock content %}
You can’t perform that action at this time.