<commit_before>{#

This file is part of the Networking package.

(c) net working AG <<EMAIL>>

For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.

#}

{% if admin is not defined %}
    {% set admin = sonata_admin.admin %}
{% endif %}
<div id="field_container_{{ id }}">
    <p></p>
    {% set increment = 0 %}
    {% if not admin.subject.alias %}
        {% for key, zone in get_initcms_template_zones() %}
            {% if (loop.first) %}
                <div class="row">
            {% endif %}


            <div class="{{ zone.class }}">
                <div class="dropzone well well-small">
                    <h6>{{ zone.name|trans() }} </h6>
                    {% if zone.max_content_items is not same as(-1) %}
                        <ul id="zone_{{ zone.name }}" class="sortable" data-content-types="{{ zone.restricted_types }}"
                            data-max-items="{{ zone.max_content_items }}">
                            {# Add a list item for the very first plus button with a field set to 0, used for the sorting of the li items that follow#}
                            <li class="networking-sort-zone">
                                <div class="plus_button"
                                     {% if zone.max_content_items > 0 and get_sub_form_by_zone(form.children, zone.name)|length >= zone.max_content_items %}style="display: none;"{% endif %}>
                                    <a class="add-layout"
                                       href="{{ url('admin_networking_initcms_layoutblock_create') }}"
                                       data-zone="{{ zone.name }}"
                                       data-sort-order="0"
                                       data-value="{{ zone.restricted_types }}"
                                       title="{% trans from 'SonataAdminBundle' %}link_add{% endtrans %}">
                                        <i class="glyphicon glyphicon-plus"></i>
                                    </a>
                                </div>
                            </li>
                            <li class="empty_layout_block" {% if get_sub_form_by_zone(form.children, zone.name)|length > 0 %} style="display: none;"{% endif %}>
                                <p class="info-soft ">
                                    {% trans from 'PageAdmin' %}info.layout_block_empty{% endtrans %}
                                </p>
                            </li>
                            {# loop through layout blocks #}
                            {% for layout_block_field_name, layout_block_field in get_sub_form_by_zone(form.children, zone.name) %}
                                {% set layoutBlockContent = render_initcms_admin_block(layout_block_field.vars.value) %}
                                {% if layoutBlockContent %}

                                    <li class="networking-sortable-list networking-sort-zone"
                                        id="layoutBlock_{{ layout_block_field.vars.value.id }}"
                                        data-content-type="{{ layout_block_field.vars.value.classType }}">
                                        {# preview of layout block of content #}

                                        <div class="content_preview">
                                            <div class="layout_controls">
                                                <i class="glyphicon glyphicon-move soft-background"></i>
                                                <i class="glyphicon glyphicon-trash soft-background delete_block"
                                                   data-value="{{ layout_block_field.vars.value.id }}"></i>
                                                <i class="glyphicon glyphicon-pencil soft-background layout-link"
                                                   data-href="{{ url('admin_networking_initcms_layoutblock_edit', {'id': layout_block_field.vars.value.id}) }}"></i>
                                            </div>
                                            <div class="layout-link"
                                                 data-href="{{ url('admin_networking_initcms_layoutblock_edit', {'id': layout_block_field.vars.value.id}) }}">
                                                {{ layoutBlockContent|raw }}
                                            </div>
                                        </div>

                                        {# modal window hidden content #}



                                        {# start the block for the plus button #}
                                        <div class="plus_button"
                                             {% if zone.max_content_items > 0 and get_sub_form_by_zone(form.children, zone.name)|length >= zone.max_content_items %}style="display: none;"{% endif %}>
                                            <a class="add-layout"
                                               href="{{ url('admin_networking_initcms_layoutblock_create') }}"
                                               data-zone="{{ zone.name }}"
                                               data-sort-order="{{ layout_block_field.vars.value.sortOrder }}"
                                               data-value="{{ zone.restricted_types }}"
                                               title="{% trans from 'SonataAdminBundle' %}link_add{% endtrans %}">
                                                <i class="glyphicon glyphicon-plus"></i>
                                            </a>
                                        </div>
                                    </li>
                                    {% set increment = increment + 1 %}
                                {% endif %}
                            {% endfor %}

                        </ul>
                    {% endif %}
                </div>
            </div>

            {% if (loop.last) %}
                </div>
            {% endif %}
        {% endfor %}
    {% else %}
        <div class="alert alert-info"><a
                    href="{{ admin.generateUrl('edit', {id: admin.subject.alias.id}) }}"
                    class="link-underlined  font-light">
                {{ 'link.alias.page'|trans({'%alias_page%': admin.subject.alias}, 'NetworkingInitCmsBundle') }}</a>
        </div>
    {% endif %}
    {# add dependent javascript based on if the request is ajax or not #}
    {% if app.request.isXmlHttpRequest %}
        {% include '@NetworkingInitCms/PageAdmin/page_edit_orm_one_ajax.html.twig' %}
    {% else %}

        {# addToBottom adds the content in the block to the end of the page #}
        {% jsblock 'addToBottom' %}
        <div id="layoutBlockModal" class="modal" aria-hidden="true" role="dialog" style="display: none">
        </div>
        {% include '@NetworkingInitCms/Form/content_type_select.html.twig' %}
        {% include '@NetworkingInitCms/PageAdmin/page_edit_layout_blocks_script.html.twig' with {'admin': admin} %}
        {% jsblock 'addToBottomEnd' %}
    {% endif %}
</div>
<commit_msg>fix sort order of pages<commit_after>{#

This file is part of the Networking package.

(c) net working AG <<EMAIL>>

For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.

#}

{% if admin is not defined %}
    {% set admin = sonata_admin.admin %}
{% endif %}
<div id="field_container_{{ id }}">
    <p></p>
    {% set increment = 0 %}
    {% if not admin.subject.alias %}
        {% for key, zone in get_initcms_template_zones() %}
            {% if (loop.first) %}
                <div class="row">
            {% endif %}


            <div class="{{ zone.class }}">
                <div class="dropzone well well-small">
                    <h6>{{ zone.name|trans() }} </h6>
                    {% if zone.max_content_items is not same as(-1) %}
                        <ul id="zone_{{ zone.name }}" class="sortable" data-content-types="{{ zone.restricted_types }}"
                            data-max-items="{{ zone.max_content_items }}">
                            {# Add a list item for the very first plus button with a field set to 0, used for the sorting of the li items that follow#}
                            <li class="networking-sort-zone">
                                <div class="plus_button"
                                     {% if zone.max_content_items > 0 and get_sub_form_by_zone(form.children, zone.name)|length >= zone.max_content_items %}style="display: none;"{% endif %}>
                                    <a class="add-layout"
                                       href="{{ url('admin_networking_initcms_layoutblock_create') }}"
                                       data-zone="{{ zone.name }}"
                                       data-sort-order="0"
                                       data-value="{{ zone.restricted_types }}"
                                       title="{% trans from 'SonataAdminBundle' %}link_add{% endtrans %}">
                                        <i class="glyphicon glyphicon-plus"></i>
                                    </a>
                                </div>
                            </li>
                            <li class="empty_layout_block" {% if get_sub_form_by_zone(form.children, zone.name)|length > 0 %} style="display: none;"{% endif %}>
                                <p class="info-soft ">
                                    {% trans from 'PageAdmin' %}info.layout_block_empty{% endtrans %}
                                </p>
                            </li>
                            {# loop through layout blocks #}
                            {% for layout_block_field_name, layout_block_field in get_sub_form_by_zone(form.children, zone.name) %}
                                {% set layoutBlockContent = render_initcms_admin_block(layout_block_field.vars.value) %}
                                {% if layoutBlockContent %}

                                    <li class="networking-sortable-list networking-sort-zone"
                                        id="layoutBlock_{{ layout_block_field.vars.value.id }}"
                                        data-content-type="{{ layout_block_field.vars.value.classType }}">
                                        {# preview of layout block of content #}

                                        <div class="content_preview">
                                            <div class="layout_controls">
                                                <i class="glyphicon glyphicon-move soft-background"></i>
                                                <i class="glyphicon glyphicon-trash soft-background delete_block"
                                                   data-value="{{ layout_block_field.vars.value.id }}"></i>
                                                <i class="glyphicon glyphicon-pencil soft-background layout-link"
                                                   data-href="{{ url('admin_networking_initcms_layoutblock_edit', {'id': layout_block_field.vars.value.id}) }}"></i>
                                            </div>
                                            <div class="layout-link"
                                                 data-href="{{ url('admin_networking_initcms_layoutblock_edit', {'id': layout_block_field.vars.value.id}) }}">
                                                {{ layoutBlockContent|raw }}
                                            </div>
                                        </div>

                                        {# modal window hidden content #}



                                        {# start the block for the plus button #}
                                        <div class="plus_button"
                                             {% if zone.max_content_items > 0 and get_sub_form_by_zone(form.children, zone.name)|length >= zone.max_content_items %}style="display: none;"{% endif %}>
                                            <a class="add-layout"
                                               href="{{ url('admin_networking_initcms_layoutblock_create') }}"
                                               data-zone="{{ zone.name }}"
                                               data-sort-order="{{ loop.index }}"
                                               data-value="{{ zone.restricted_types }}"
                                               title="{% trans from 'SonataAdminBundle' %}link_add{% endtrans %}">
                                                <i class="glyphicon glyphicon-plus"></i>
                                            </a>
                                        </div>
                                    </li>
                                    {% set increment = increment + 1 %}
                                {% endif %}
                            {% endfor %}

                        </ul>
                    {% endif %}
                </div>
            </div>

            {% if (loop.last) %}
                </div>
            {% endif %}
        {% endfor %}
    {% else %}
        <div class="alert alert-info"><a
                    href="{{ admin.generateUrl('edit', {id: admin.subject.alias.id}) }}"
                    class="link-underlined  font-light">
                {{ 'link.alias.page'|trans({'%alias_page%': admin.subject.alias}, 'NetworkingInitCmsBundle') }}</a>
        </div>
    {% endif %}
    {# add dependent javascript based on if the request is ajax or not #}
    {% if app.request.isXmlHttpRequest %}
        {% include '@NetworkingInitCms/PageAdmin/page_edit_orm_one_ajax.html.twig' %}
    {% else %}

        {# addToBottom adds the content in the block to the end of the page #}
        {% jsblock 'addToBottom' %}
        <div id="layoutBlockModal" class="modal" aria-hidden="true" role="dialog" style="display: none">
        </div>
        {% include '@NetworkingInitCms/Form/content_type_select.html.twig' %}
        {% include '@NetworkingInitCms/PageAdmin/page_edit_layout_blocks_script.html.twig' with {'admin': admin} %}
        {% jsblock 'addToBottomEnd' %}
    {% endif %}
</div>

{'fraction_non_alphanumeric': 0.11380741365970318, 'fraction_numerical': 0.0014067665470915102, 'mean_word_length': 1.139010079735219, 'pattern_counts': {'":': 0, '<': 111, '<?xml version=': 0, '>': 121, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 148, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6719699', 'n_tokens_mistral': 3438, 'n_tokens_neox': 3091, 'n_words': 716}