<commit_before>       
{% block sonata_page_top_bar %}
    {% if sonata_page.isEditor or (app.security and app.security.token and is_granted('ROLE_PREVIOUS_ADMIN')) %}

        <div class="hideable">


            {% if sonata_page.isEditor and sonata_page.isInlineEditionOn %}
                <!-- CMS specific variables -->
                <script>
                    jQuery(document).ready(function () {
                        Sonata.Page.init({
                            url: {
                                block_save_position: '{{ path('admin_sonata_page_block_savePosition', { 'id': page.id }) }}',
                                block_edit: '{{ path('admin_sonata_page_block_edit', {'id': 'BLOCK_ID'}) }}'
                            }
                        });
                    });
                </script>
            {% endif %}

            <header class="sonata-bc sonata-page-top-bar navbar navbar-inverse navbar-fixed-top" role="banner">
                <div class="container">
                    <ul class="nav navbar-nav">
                        {% if app.security and app.security.token and is_granted('ROLE_SONATA_ADMIN') %}
                            <li><a href="{{ path('sonata_admin_dashboard') }}">{{ "header.sonata_admin_dashboard"|trans({}, 'SonataPageBundle') }}</a></li>
                            {% endif %}

                        {% if sonata_page.isEditor %}
                            {% set sites = sonata_page.siteavailables %}

                            {% if sites|length > 1 and site is defined %}
                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ site.name }} <span class="caret"></span></a>
                                    <ul class="dropdown-menu">
                                        {% for site in sites %}
                                            <li><a href="{{ site.url }}">{{ site.name }}</a></li>
                                            {% endfor %}
                                    </ul>
                                </li>
                            {% endif %}

                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Page <span class="caret"></span></a>
                                <ul class="dropdown-menu">
                                    {% if page is defined %}
                                        <li><a href="{{ path('admin_sonata_page_page_edit', {'id': page.id }) }}" target="_new">{{ "header.edit_page"|trans({}, 'SonataPageBundle') }}</a></li>
                                        <li><a href="{{ path('admin_sonata_page_page_snapshot_create', {'id': page.id }) }}" target="_new">{{ "header.create_snapshot"|trans({}, 'SonataPageBundle') }}</a></li>
                                        <li class="divider"></li>
                                        {% endif %}

                                    <li><a href="{{ path('admin_sonata_page_page_list') }}" target="_new">{{ "header.view_all_pages"|trans({}, 'SonataPageBundle') }}</a></li>

                                    {% if error_codes is defined and error_codes|length %}
                                        <li class="divider"></li>
                                        <li><a href="{{ path('sonata_page_exceptions_list') }}" target="_new">{{ "header.view_all_exceptions"|trans({}, 'SonataPageBundle') }}</a></li>
                                        {% endif %}
                                </ul>
                            </li>

                            {% if page is defined %}
                                <li>
                                    <a href="{{ url('admin_sonata_page_page_compose', {'id': page.id}) }}">
                                        <i class="fa fa-magic"></i>
                                        {{ 'header.compose_page'|trans({}, 'SonataPageBundle')}}
                                    </a>
                                </li>
                            {% endif %}

                            {% if page is defined and not page.enabled %}
                                <li><span style="padding-left: 20px; background: red;"><strong><em>{{ 'header.page_is_disabled'|trans([], 'SonataPageBundle') }}</em></strong></span></li>
                                            {% endif %}

                            {% if sonata_page.isInlineEditionOn and page is defined %}
                                <li>
                                    <form class="form-inline" style="margin: 0px">
                                        <label class="checkbox inline" for="page-action-enabled-edit"><input type="checkbox" id="page-action-enabled-edit">{{ 'header.show_zone'|trans({}, 'SonataPageBundle') }}</label>
                                        <input type="submit" class="btn" value="{{ 'btn_save_position'|trans({}, 'SonataPageBundle') }}" id="page-action-save-position">
                                    </form>
                                </li>
                            {% endif %}
                        {% endif %}

                        {% if app.security and app.security.token and is_granted('ROLE_PREVIOUS_ADMIN') %}
                            <li><a href="{{ url('homepage', {'_switch_user': '_exit'}) }}">{{ "header.switch_user_exit"|trans({}, 'SonataPageBundle')}}</a></li>
                            {% endif %}

                    </ul>
                </div>
        </div>
    </header>
    <style>
        .hideable .switch{
            position: fixed;
            right: 0;
            top: 0;
            background-color: red;
            color: #EEE;
            z-index: 1000000;
        }
    </style>
    <script>
        // the semi-colon before function invocation is a safety net against concatenated
// scripts and/or other plugins which may not be closed properly.
        ;
        (function ($, window, document, undefined) {

            "use strict";

            var pluginName = "hideableBlock",
                    defaults = {
                    };

            function Plugin(el, options) {
                this.el = el;
                this.$el = $(el);
                /*this.$panel = $('<div class="panel"></div>');*/
                /*this.$el.children().wrapAll(this.$panel);*/
                /*this.$panel.hide();*/

                this.settings = $.extend({}, defaults, options);
                this._defaults = defaults;
                this._name = pluginName;
                this.init();
            }

            $.extend(Plugin.prototype, {
                init: function () {
                    this.$panel = this.$el.children().wrapAll('<div class="panel"></div>');
                    this.$sbtn = $('<button class="switch">switch</button>');

                    this.$el.append(this.$sbtn);
                    this.bindEvents();
                },
                bindEvents: function () {
                    var self = this;
                    this.$sbtn.on('click', function () {
                        if (self.$panel.is(':visible')) {
                            self.hidePanel();
                        } else {
                            self.showPanel();
                        }
                    });
                },
                showPanel: function () {
                    this.$panel.show();
                },
                hidePanel: function () {
                    this.$panel.hide();

                }
            });

            $.fn[ pluginName ] = function (options) {
                return this.each(function () {
                    if (!$.data(this, "plugin_" + pluginName)) {
                        $.data(this, "plugin_" + pluginName, new Plugin(this, options));
                    }
                });
            };

        })(jQuery, window, document);

        /*$(".hideable").hideableBlock({});*/
    </script>
    {% endif %}
{% endblock %}<commit_msg>updates..<commit_after>       
{% block sonata_page_top_bar %}
    {% if sonata_page.isEditor or (app.security and app.security.token and is_granted('ROLE_PREVIOUS_ADMIN')) %}

        <div class="hideable">


            {% if sonata_page.isEditor and sonata_page.isInlineEditionOn %}
                <!-- CMS specific variables -->
                <script>
                    jQuery(document).ready(function () {
                        Sonata.Page.init({
                            url: {
                                block_save_position: '{{ path('admin_sonata_page_block_savePosition', { 'id': page.id }) }}',
                                block_edit: '{{ path('admin_sonata_page_block_edit', {'id': 'BLOCK_ID'}) }}'
                            }
                        });
                    });
                </script>
            {% endif %}

            <header class="sonata-bc sonata-page-top-bar navbar navbar-inverse navbar-fixed-top" role="banner">
                <div class="container">
                    <ul class="nav navbar-nav">
                        {% if app.security and app.security.token and is_granted('ROLE_SONATA_ADMIN') %}
                            <li><a href="{{ path('sonata_admin_dashboard') }}">{{ "header.sonata_admin_dashboard"|trans({}, 'SonataPageBundle') }}</a></li>
                            {% endif %}

                        {% if sonata_page.isEditor %}
                            {% set sites = sonata_page.siteavailables %}

                            {% if sites|length > 1 and site is defined %}
                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ site.name }} <span class="caret"></span></a>
                                    <ul class="dropdown-menu">
                                        {% for site in sites %}
                                            <li><a href="{{ site.url }}">{{ site.name }}</a></li>
                                            {% endfor %}
                                    </ul>
                                </li>
                            {% endif %}

                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Page <span class="caret"></span></a>
                                <ul class="dropdown-menu">
                                    {% if page is defined %}
                                        <li><a href="{{ path('admin_sonata_page_page_edit', {'id': page.id }) }}" target="_new">{{ "header.edit_page"|trans({}, 'SonataPageBundle') }}</a></li>
                                        <li><a href="{{ path('admin_sonata_page_page_snapshot_create', {'id': page.id }) }}" target="_new">{{ "header.create_snapshot"|trans({}, 'SonataPageBundle') }}</a></li>
                                        <li class="divider"></li>
                                        {% endif %}

                                    <li><a href="{{ path('admin_sonata_page_page_list') }}" target="_new">{{ "header.view_all_pages"|trans({}, 'SonataPageBundle') }}</a></li>

                                    {% if error_codes is defined and error_codes|length %}
                                        <li class="divider"></li>
                                        <li><a href="{{ path('sonata_page_exceptions_list') }}" target="_new">{{ "header.view_all_exceptions"|trans({}, 'SonataPageBundle') }}</a></li>
                                        {% endif %}
                                </ul>
                            </li>

                            {% if page is defined %}
                                <li>
                                    <a href="{{ url('admin_sonata_page_page_compose', {'id': page.id}) }}">
                                        <i class="fa fa-magic"></i>
                                        {{ 'header.compose_page'|trans({}, 'SonataPageBundle')}}
                                    </a>
                                </li>
                            {% endif %}

                            {% if page is defined and not page.enabled %}
                                <li><span style="padding-left: 20px; background: red;"><strong><em>{{ 'header.page_is_disabled'|trans([], 'SonataPageBundle') }}</em></strong></span></li>
                                            {% endif %}

                            {% if sonata_page.isInlineEditionOn and page is defined %}
                                <li>
                                    <form class="form-inline" style="margin: 0px">
                                        <label class="checkbox inline" for="page-action-enabled-edit"><input type="checkbox" id="page-action-enabled-edit">{{ 'header.show_zone'|trans({}, 'SonataPageBundle') }}</label>
                                        <input type="submit" class="btn" value="{{ 'btn_save_position'|trans({}, 'SonataPageBundle') }}" id="page-action-save-position">
                                    </form>
                                </li>
                            {% endif %}
                        {% endif %}

                        {% if app.security and app.security.token and is_granted('ROLE_PREVIOUS_ADMIN') %}
                            <li><a href="{{ url('homepage', {'_switch_user': '_exit'}) }}">{{ "header.switch_user_exit"|trans({}, 'SonataPageBundle')}}</a></li>
                            {% endif %}

                    </ul>
                </div>
        </div>
    </header>
    <style>
        .hideable .switch{
            position: fixed;
            right: 0;
            top: 0;
            background-color: red;
            color: #EEE;
            z-index: 1000000;
        }
    </style>
    <script>
        // the semi-colon before function invocation is a safety net against concatenated
// scripts and/or other plugins which may not be closed properly.
        ;
        (function ($, window, document, undefined) {

            "use strict";

            var pluginName = "hideableBlock",
                    defaults = {
                    };

            function Plugin(el, options) {
                this.el = el;
                this.$el = $(el);
                /*this.$panel = $('<div class="panel"></div>');*/
                /*this.$el.children().wrapAll(this.$panel);*/
                /*this.$panel.hide();*/

                this.settings = $.extend({}, defaults, options);
                this._defaults = defaults;
                this._name = pluginName;
                this.init();
            }

            $.extend(Plugin.prototype, {
                init: function () {
                    this.$panel = this.$el.children().wrapAll('<div class="panel"></div>');
                    this.$sbtn = $('<button class="switch">switch</button>');

                    this.$el.append(this.$sbtn);
                    this.bindEvents();
                },
                bindEvents: function () {
                    var self = this;
                    this.$sbtn.on('click', function () {
                        if (self.$panel.is(':visible')) {
                            self.hidePanel();
                        } else {
                            self.showPanel();
                        }
                    });
                },
                showPanel: function () {
                    this.$panel.show();
                },
                hidePanel: function () {
                    this.$panel.hide();

                }
            });

            $.fn[ pluginName ] = function (options) {
                return this.each(function () {
                    if (!$.data(this, "plugin_" + pluginName)) {
                        $.data(this, "plugin_" + pluginName, new Plugin(this, options));
                    }
                });
            };

        })(jQuery, window, document);

        $(".hideable").hideableBlock({});
    </script>
    {% endif %}
{% endblock %}
{'fraction_non_alphanumeric': 0.1440677966101695, 'fraction_numerical': 0.0016201395812562313, 'mean_word_length': 1.0992805755395683, 'pattern_counts': {'":': 0, '<': 185, '<?xml version=': 0, '>': 187, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 78, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4443517', 'n_tokens_mistral': 4087, 'n_tokens_neox': 3686, 'n_words': 718}