<commit_before>{% macro collection_prototype(widget) %}
    {% if 'prototype' in widget.vars|keys %}
        {% set form = widget.vars.prototype %}
        {% set name = widget.vars.prototype.vars.name %}
    {% else %}
        {% set form = widget %}
        {% set name = widget.vars.full_name %}
    {% endif %}

    <div data-content="{{ name }}">
        <div class="row-oro oro-multiselect-holder">
            {{ form_errors(form) }}
            {% if form.children|length  %}
                {% for child in form %}
                    {{ form_errors(child) }}
                    {{ form_widget(child) }}
                {% endfor %}
            {% else %}
                {{ form_widget(form) }}
            {% endif %}
            {{ form_rest(form) }}
            <button class="removeRow btn btn-action btn-link" type="button" data-related="{{ name }}">×</button>
        </div>
    </div>
{% endmacro %}

{#
    Render flexible attribute row
    Parameters:
        value - flexible attribute
#}
{% macro flexibleAttributeRow(value) %}
    {{ _self.attibuteRow(value.attribute.label, value.__toString|default('N/A')) }}
{% endmacro %}

{#
    Render attribute row
    Parameters:
        title - attribute title
        value - attribute value
        additionalData - array with additional data
#}
{% macro attibuteRow(title, value, additionalData) %}
    {% macro attribute_data(value, additionalData) %}
        <div class="clearfix-oro">
            {% if value.value is not defined  %}
                <p class="control-label">{{ value }}</p>
            {% else %}
                <p class="control-label">{{ value.value }} <strong>{{ value.hint|trans }}</strong></p>
            {% endif %}
        </div>
        {% if additionalData|length %}
            {% for data in additionalData.data %}
                <div class="clearfix-oro">
                    <p class="control-label">{{ attribute(data, additionalData.field) }}</p>
                </div>
            {% endfor %}
        {% endif %}
    {% endmacro %}
    {{ _self.renderAttribute(title, _self.attribute_data(value, additionalData)) }}
{% endmacro %}

{#
    Render attribute row with custom data block
    Parameters:
        title - row title
        data - row data
#}
{% macro renderAttribute(title, data) %}
    <div class="control-group">
        <label class="control-label">{{ title|trans }}</label>
        <div class="controls">
            {{ data|raw }}
        </div>
    </div>
{% endmacro %}

{#
    Render property block
    Parameters:
        title - property title
        data  - property data
#}
{% macro renderProperty(title, data) %}
    {{ _self.renderAttribute(title, '<p class="control-label">' ~ data|default('N/A'|trans) ~ '</p>') }}
{% endmacro %}

{#
    Create the link
    Parameters - array:
        [
            'path'  - button url
            'class' - default class
            'aCss'  - additional button class
            'title' - button title
            'iCss'  - css class for 'i' tag (icon)
            'label' - button label
        ]
#}
{% macro link(parameters) %}
    <a href="{{ parameters.path }}"
       class="{{ parameters.class is defined? parameters.class : '' }} {{ parameters.aCss is defined? parameters.aCss : '' }}"
       title="{{ parameters.title|trans }}">
        {% if parameters.iCss is defined %}
            <i class="{{ parameters.iCss }} hide-text" >{{ parameters.label|trans }}</i>
        {% endif %}{{ parameters.label|trans }}
    </a>
{% endmacro %}

{#
    Create the button
    Parameters - array:
        [
            'path'  - button url
            'aCss'  - additional button class
            'title' - button title
            'iCss'  - css class for 'i' tag (icon)
            'label' - button label
        ]
#}
{% macro button(parameters) %}
    <div class="pull-left btn-group icons-holder">
        {{ _self.link(parameters|merge({'class': 'btn back icons-holder-text'})) }}
    </div>
{% endmacro %}

{#
    Create dropdown button
    Parameters - array:
        [
            'label' - button label
            'elements' - dropdown elements
            'html' - html from placeholder

        ]
#}
{% macro dropdownButton(parameters) %}
    <div class="btn-group">
        <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
            {{ parameters.label|trans }}
            <span class="caret"></span>
        </a>
        <ul class="dropdown-menu {{ parameters.classes is defined? parameters.classes|join(" ") : "" }}">
            {% if parameters.elements is defined and parameters.elements is not empty %}
                {% for item in parameters.elements %}
                    {{ _self.dropdownItem(parameters) }}
                {% endfor %}
            {% endif %}
            {% if parameters.html is defined and parameters.html is not empty %}
                {{ parameters.html }}
            {% endif %}
        </ul>
    </div>
{% endmacro %}

{#
    Create the dropdown button item
    Parameters - array:
        [
            'path'  - button url
            'aCss'  - additional button class
            'title' - button title<commit_msg>CRM-845: Fix demo notes refactoring<commit_after>{% macro collection_prototype(widget) %}
    {% if 'prototype' in widget.vars|keys %}
        {% set form = widget.vars.prototype %}
        {% set name = widget.vars.prototype.vars.name %}
    {% else %}
        {% set form = widget %}
        {% set name = widget.vars.full_name %}
    {% endif %}

    <div data-content="{{ name }}">
        <div class="row-oro oro-multiselect-holder">
            {{ form_errors(form) }}
            {% if form.children|length  %}
                {% for child in form %}
                    {{ form_errors(child) }}
                    {{ form_widget(child) }}
                {% endfor %}
            {% else %}
                {{ form_widget(form) }}
            {% endif %}
            {{ form_rest(form) }}
            <button class="removeRow btn btn-action btn-link" type="button" data-related="{{ name }}">×</button>
        </div>
    </div>
{% endmacro %}

{#
    Render flexible attribute row
    Parameters:
        value - flexible attribute
#}
{% macro flexibleAttributeRow(value) %}
    {{ _self.attibuteRow(value.attribute.label, value.__toString|default('N/A')) }}
{% endmacro %}

{#
    Render attribute row
    Parameters:
        title - attribute title
        value - attribute value
        additionalData - array with additional data
#}
{% macro attibuteRow(title, value, additionalData) %}
    {% macro attribute_data(value, additionalData) %}
        <div class="clearfix-oro">
            {% if value.value is not defined  %}
                <p class="control-label">{{ value }}</p>
            {% else %}
                <p class="control-label">{{ value.value }} <strong>{{ value.hint|trans }}</strong></p>
            {% endif %}
        </div>
        {% if additionalData|length %}
            {% for data in additionalData.data %}
                <div class="clearfix-oro">
                    <p class="control-label">{{ attribute(data, additionalData.field) }}</p>
                </div>
            {% endfor %}
        {% endif %}
    {% endmacro %}
    {{ _self.renderAttribute(title, _self.attribute_data(value, additionalData)) }}
{% endmacro %}

{#
    Render attribute row with custom data block
    Parameters:
        title - row title
        data - row data
#}
{% macro renderAttribute(title, data) %}
    <div class="control-group">
        <label class="control-label">{{ title|trans }}</label>
        <div class="controls">
            {{ data|raw }}
        </div>
    </div>
{% endmacro %}

{#
    Render property block
    Parameters:
        title - property title
        data  - property data
#}
{% macro renderProperty(title, data) %}
    {{ _self.renderAttribute(title, '<p class="control-label">' ~ data|default('N/A'|trans) ~ '</p>') }}
{% endmacro %}

{#
    Create the link
    Parameters - array:
        [
            'path'  - button url
            'class' - default class
            'aCss'  - additional button class
            'title' - button title
            'iCss'  - css class for 'i' tag (icon)
            'label' - button label
        ]
#}
{% macro link(parameters) %}
    <a href="{{ parameters.path }}"
       class="{{ parameters.class is defined? parameters.class : '' }} {{ parameters.aCss is defined? parameters.aCss : '' }}"
       title="{{ parameters.title|trans }}">
        {% if parameters.iCss is defined %}
            <i class="{{ parameters.iCss }} hide-text" >{{ parameters.label|trans }}</i>
        {% endif %}{{ parameters.label|trans }}
    </a>
{% endmacro %}

{#
    Create the button
    Parameters - array:
        [
            'path'  - button url
            'aCss'  - additional button class
            'title' - button title
            'iCss'  - css class for 'i' tag (icon)
            'label' - button label
        ]
#}
{% macro button(parameters) %}
    <div class="pull-left btn-group icons-holder">
        {{ _self.link(parameters|merge({'class': 'btn back icons-holder-text'})) }}
    </div>
{% endmacro %}

{#
    Create dropdown button
    Parameters - array:
        [
            'label' - button label
            'elements' - dropdown elements
            'html' - html from placeholder
            'aCss'  - additional drop down class
        ]
#}
{% macro dropdownButton(parameters) %}
    <div class="btn-group">
        <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
            {{ parameters.label|trans }}
            <span class="caret"></span>
        </a>
        <ul class="dropdown-menu {{ parameters.aCss is defined? parameters.aCss : '' }}">
            {% if parameters.elements is defined and parameters.elements is not empty %}
                {% for item in parameters.elements %}
                    {{ _self.dropdownItem(parameters) }}
                {% endfor %}
            {% endif %}
            {% if parameters.html is defined and parameters.html is not empty %}
                {{ parameters.html }}
            {% endif %}
        </ul>
    </div>
{% endmacro %}

{#
    Create the dropdown button item
    Parameters - array:
        [
            'path'  - button url
            'aCss'  - additional button class
            'title' - button title
{'fraction_non_alphanumeric': 0.1486773508399305, 'fraction_numerical': 0.00028963120293492954, 'mean_word_length': 1.8823038397328882, 'pattern_counts': {'":': 0, '<': 83, '<?xml version=': 0, '>': 83, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3952466', 'n_tokens_mistral': 3069, 'n_tokens_neox': 2814, 'n_words': 714}