<commit_before>{% set isWidgetContext = isWidgetContext is defined ? isWidgetContext : false %}
{% extends isWidgetContext ? 'OroFormBundle:Layout:widgetForm.html.twig' : bap.layout %}

{% import 'OroNavigationBundle:Include:contentTags.html.twig' as navigationMacro %}
{% 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 %}
    {% if isWidgetContext and savedId is defined and savedId %}
        <script type="text/javascript">
            require(['oroui/js/widget-manager'],
            function(widgetManager) {
                widgetManager.getWidgetInstance(
                    {{ app.request.get('_wid')|json_encode|raw }},
                    function (widget) {
                        widget.trigger('formSave', {{ savedId|json_encode|raw }});
                    }
                );
            });
        </script>
    {% else %}

    {% if addQueryParameters is not defined or addQueryParameters == true %}
        {% set formAction = oro_url_add_query(formAction) %}
    {% endif %}
    <form id="{{ form.vars.id }}" name="{{ form.vars.name }}" action="{{ formAction }}" {{ form_enctype(form) }}
          method="{{ form.vars.method }}" data-collect="true"
          {% if pageComponent is defined %}{{ UI.renderPageComponentAttributes(pageComponent) }}{% endif %}>
        {% if isWidgetContext %}
            <div class="widget-actions">
                <button type="reset" class="btn">{{ 'Cancel'|trans }}</button>
                <button type="submit" class="btn btn-success">{{ 'Save'|trans }}</button>
            </div>
        {% else %}
        <div class="container-fluid page-title">
            <div class="navigation clearfix navbar-extra navbar-extra-right">
                <div class="row">
                    <div class="pull-left pull-left-extra">
                        {% block pageHeader %}
                            <div class="clearfix customer-info well-small{% if avatar is not defined %} customer-simple{% endif %}">
                                {% if avatar is defined %}
                                    <div class="visual">
                                        <img src="{{ avatar ? avatar : asset('bundles/oroui/img/info-user.png') }}" alt="{{ breadcrumbs.entityTitle }}"/>
                                    </div>
                                {% endif %}
                                <div class="customer-content pull-left">
                                    <div class="clearfix">
                                        {% block breadcrumbs %}
                                            <div class="pull-left">
                                                <div class="sub-title"><a href="{{ oro_url_add_query(breadcrumbs.indexPath) }}">{{ breadcrumbs.indexLabel }}</a></div>
                                                <span class="separator">/</span>
                                                {% if breadcrumbs.additional is defined %}
                                                    {% for breadcrumb in breadcrumbs.additional %}
                                                    <div class="sub-title"><a href="{{ oro_url_add_query(breadcrumb.indexPath) }}">{{ breadcrumb.indexLabel }}</a></div>
                                                    <span class="separator">/</span>
                                                    {% endfor %}
                                                {% endif %}
                                                <h1 class="user-name">{{ breadcrumbs.entityTitle }}</h1>
                                            </div>
                                            {% block breadcrumbMessage %}{% endblock breadcrumbMessage %}
                                        {% endblock breadcrumbs %}
                                    </div>
                                    <div class="clearfix">
                                        <ul class="inline">
                                            {% block stats %}
                                                {% if breadcrumbs.entity.createdAt is defined and breadcrumbs.entity.updatedAt is defined %}
                                                    <li>
                                                        {{ 'oro.ui.created_at'|trans }}:
                                                        {{ breadcrumbs.entity.createdAt ?
                                                            breadcrumbs.entity.createdAt|oro_format_datetime :
                                                            'oro.ui.empty'|trans
                                                        }}
                                                    </li>
                                                    <li>
                                                        {{ 'oro.ui.updated_at'|trans }}:
                                                        {{ breadcrumbs.entity.updatedAt ?
                                                            breadcrumbs.entity.updatedAt|oro_format_datetime :
                                                            'oro.ui.empty'|trans
                                                        }}
                                                    </li>
                                                {% endif %}
                                            {% endblock stats %}
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        {% endblock pageHeader %}
                    </div>
                    <div class="pull-right">
                        <div class="pull-right title-buttons-container">
                            {% placeholder update_navButtons_before with {entity: entity} %}
                            {% block navButtons %}{% endblock navButtons %}
                            {% placeholder update_navButtons_after with {entity: entity} %}

                            {% if form.vars.method != 'GET' %}
                                <input type="hidden" name="input_action" value="" data-form-id="{{ form.vars.name }}"/>
                            {% endif %}
                        </div>
                        <div class="pull-right user-info-state">
                            <div class="inline-decorate-container">
                                <ul class="inline-decorate">
                                    {% 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 : 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 %}
                                </ul><commit_msg>BAP-8152: Make random_id = true by default for all FormTypes<commit_after>{% set isWidgetContext = isWidgetContext is defined ? isWidgetContext : false %}
{% extends isWidgetContext ? 'OroFormBundle:Layout:widgetForm.html.twig' : bap.layout %}

{% import 'OroNavigationBundle:Include:contentTags.html.twig' as navigationMacro %}
{% 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 %}
    {% if isWidgetContext and savedId is defined and savedId %}
        <script type="text/javascript">
            require(['oroui/js/widget-manager'],
            function(widgetManager) {
                widgetManager.getWidgetInstance(
                    {{ app.request.get('_wid')|json_encode|raw }},
                    function (widget) {
                        widget.trigger('formSave', {{ savedId|json_encode|raw }});
                    }
                );
            });
        </script>
    {% else %}

    {% if addQueryParameters is not defined or addQueryParameters == true %}
        {% set formAction = oro_url_add_query(formAction) %}
    {% endif %}
    <form id="{{ form.vars.id }}" name="{{ form.vars.name }}" action="{{ formAction }}" {{ form_enctype(form) }}
          method="{{ form.vars.method }}" data-collect="true"
          {% if pageComponent is defined %}{{ UI.renderPageComponentAttributes(pageComponent) }}{% endif %}>
        {% if isWidgetContext %}
            <div class="widget-actions">
                <button type="reset" class="btn">{{ 'Cancel'|trans }}</button>
                <button type="submit" class="btn btn-success">{{ 'Save'|trans }}</button>
            </div>
        {% else %}
        <div class="container-fluid page-title">
            <div class="navigation clearfix navbar-extra navbar-extra-right">
                <div class="row">
                    <div class="pull-left pull-left-extra">
                        {% block pageHeader %}
                            <div class="clearfix customer-info well-small{% if avatar is not defined %} customer-simple{% endif %}">
                                {% if avatar is defined %}
                                    <div class="visual">
                                        <img src="{{ avatar ? avatar : asset('bundles/oroui/img/info-user.png') }}" alt="{{ breadcrumbs.entityTitle }}"/>
                                    </div>
                                {% endif %}
                                <div class="customer-content pull-left">
                                    <div class="clearfix">
                                        {% block breadcrumbs %}
                                            <div class="pull-left">
                                                <div class="sub-title"><a href="{{ oro_url_add_query(breadcrumbs.indexPath) }}">{{ breadcrumbs.indexLabel }}</a></div>
                                                <span class="separator">/</span>
                                                {% if breadcrumbs.additional is defined %}
                                                    {% for breadcrumb in breadcrumbs.additional %}
                                                    <div class="sub-title"><a href="{{ oro_url_add_query(breadcrumb.indexPath) }}">{{ breadcrumb.indexLabel }}</a></div>
                                                    <span class="separator">/</span>
                                                    {% endfor %}
                                                {% endif %}
                                                <h1 class="user-name">{{ breadcrumbs.entityTitle }}</h1>
                                            </div>
                                            {% block breadcrumbMessage %}{% endblock breadcrumbMessage %}
                                        {% endblock breadcrumbs %}
                                    </div>
                                    <div class="clearfix">
                                        <ul class="inline">
                                            {% block stats %}
                                                {% if breadcrumbs.entity.createdAt is defined and breadcrumbs.entity.updatedAt is defined %}
                                                    <li>
                                                        {{ 'oro.ui.created_at'|trans }}:
                                                        {{ breadcrumbs.entity.createdAt ?
                                                            breadcrumbs.entity.createdAt|oro_format_datetime :
                                                            'oro.ui.empty'|trans
                                                        }}
                                                    </li>
                                                    <li>
                                                        {{ 'oro.ui.updated_at'|trans }}:
                                                        {{ breadcrumbs.entity.updatedAt ?
                                                            breadcrumbs.entity.updatedAt|oro_format_datetime :
                                                            'oro.ui.empty'|trans
                                                        }}
                                                    </li>
                                                {% endif %}
                                            {% endblock stats %}
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        {% endblock pageHeader %}
                    </div>
                    <div class="pull-right">
                        <div class="pull-right title-buttons-container">
                            {% placeholder update_navButtons_before with {entity: entity} %}
                            {% block navButtons %}{% endblock navButtons %}
                            {% placeholder update_navButtons_after with {entity: entity} %}

                            {% if form.vars.method != 'GET' %}
                                <input type="hidden" name="input_action" value="" data-form-id="{{ form.vars.id }}"/>
                            {% endif %}
                        </div>
                        <div class="pull-right user-info-state">
                            <div class="inline-decorate-container">
                                <ul class="inline-decorate">
                                    {% 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 : 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 %}
                                </ul>
{'fraction_non_alphanumeric': 0.10164954870837224, 'fraction_numerical': 0.0004979769685652039, 'mean_word_length': 0.9289230399807901, 'pattern_counts': {'":': 0, '<': 113, '<?xml version=': 0, '>': 113, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 218, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1564328', 'n_tokens_mistral': 3303, 'n_tokens_neox': 3038, 'n_words': 625}