<commit_before>{% extends 'ApplicationSonataClientOperationsBundle::standard_layout.html.twig' %}

{% use 'ApplicationSonataClientOperationsBundle:CRUD:form_panels.html.twig' with form_panels as formPanels %}
{% use 'ApplicationSonataClientOperationsBundle:CRUD:form_client_topinfo.html.twig' %}

{% block panel_block %}
{{ block('formPanels')}}
{% endblock panel_block %}

{% block javascripts %}
{{parent()}}
<script src="{{ asset('bundles/applicationsonataclientoperations/js/jquery.tablesorter.js') }}" type="text/javascript"></script>
<script src="{{ asset('bundles/applicationsonataclientoperations/js/jquery.columnfilters.js') }}" type="text/javascript"></script>
<script src="{{ asset('bundles/applicationsonataclientoperations/js/jquery.sticky.header.js') }}" type="text/javascript"></script>
{% endblock javascripts %}

{% block javascriptsafter %}
{{ parent()}}
<script type="text/javascript">
    $(function () {
        $('.sonata-ba-list .table').tablesorter({
            {% if not admin.getLocking %}headers:{ 0:{ sorter:false}, 1:{sorter:false} }, {% endif %}
            cancelSelection:false
        });
        $('.sonata-ba-list .table').columnFilters({
            {% if not admin.getLocking %}excludeColumns:[0, 1], {% endif %}
            wildCard:false,
            underline:true,
            alternateRowClassNames:['rowa', 'rowb']
        });
        var w = $('.sonata-ba-list table.table').width() + 71;
        if (w > 110) {
            $('#container').css('min-width', w + 'px');
        }
    });
    $(function () {
        var $table = $('.sonata-ba-list .table tbody:first')
        var $tr = $table.find('tr:first').clone();

        //$tr.css('position', 'absolute');

        var add_total_rows = false;
        $tr.children().each(function () {
            $(this).removeAttr('objectid');
            var $div = $(this).children();
            if (!$div.hasClass('totals')) {
                $(this).removeClass('sonata-ba-list-field-money').html('&nbsp;');
            }
            else {
                add_total_rows = true;
                var tc = $div.removeClass('totals')
                        .attr("class");
                $div.attr("class", tc + '_total')

                var sum = 0;
                $('.' + tc).each(function () {
                    sum += parseFloat($(this).html());
                });
                $div.html('<b>Total:<br/>' + sum + '</b>');
            }
        });

        if (add_total_rows) {
            $tr.appendTo($table);
        }
        else {
            $tr.remove();
        }
    });
    $(function () {
        $('.sonata-ba-list table.table td.sonata-ba-list-field-money').each(function () {
            var $this = $(this);
            var val = $this.text().trim().replace(/[^\d\.]+/, '');
            var repl = Number(val).toFixed(2).toString();

            $this.html($this.html().replace(val, repl));
            $this.html($this.html().replace('.', ','));
        });
    });
    $(function () {
        var $thead = $('.sonata-ba-list .table thead:first');
        var $tr = $('<tr />').prependTo($thead);
        var $th = $('<th />')
                .attr('colspan', $thead.children(':last').children().length)
                .append($('.clientoperations_tabs_types_block'))
                .appendTo($tr);
        var depth = 0;
        $thead.children().addClass('sticky_header').each(function(){
            $(this).attr('depth', depth++);
        });
        $('.sonata-ba-list .table').stickyHeader({
            'headerClassName':'sticky_header',
            'depth':[1, 1, 1]
        });
        //$('.sonata-ba-list .table thead:first').affix();
    });
    {% if not admin.getLocking %}

    $(function () {
        var editObjectAbstractUrl = '{{ admin.generateUrl('edit', {'id':'__id__'}) }}';
        var $table = $('.sonata-ba-list .table tbody:first');
        $table.find('tr').css('cursor', 'pointer').click(function (event) {
            var objectid = $(this).children(':last').attr('objectid');
            if (objectid) {
                var link = editObjectAbstractUrl.replace("__id__", objectid).replace('&amp;', '&');
                field_dialog_form_add_{{ id }}(event, link);
            }
        });
    });
    {% endif %}

    $(function () {

        $('.sonata-actions .sonata-action-element a').live('click', function(event){
            var link = $(this).attr('href');
            field_dialog_form_add_{{ id }}(event, link);
        });
    });

    //ajax load, complete
    var ajax_loading = false;
    $(function () {

        if(!ajax_loading){
            ajax_loading = $('<div id="ajax_loading" style="background:#fff; border:1px solid #dddddd; position:fixed; left:45%; top: 25%; padding:20px 30px; z-index:99999" class="all_loading"><img height="66" width="66" alt=""  src="/img/ajax-loader.gif" /></div>').hide().appendTo('body');
        }

        $('#ajax_loading')
                .bind('ajaxSend', function(){
                    ajax_loading.show();
                })
                .bind('ajaxComplete', function(){
                    ajax_loading.hide();
                });
    });

</script>
{% include 'ApplicationSonataClientOperationsBundle::list_layout.js.twig'%}
{% endblock javascriptsafter %}<commit_msg>Review #95 :: Client Operations - Form fix bug reload page, link create form<commit_after>{% extends 'ApplicationSonataClientOperationsBundle::standard_layout.html.twig' %}

{% use 'ApplicationSonataClientOperationsBundle:CRUD:form_panels.html.twig' with form_panels as formPanels %}
{% use 'ApplicationSonataClientOperationsBundle:CRUD:form_client_topinfo.html.twig' %}

{% block panel_block %}
{{ block('formPanels')}}
{% endblock panel_block %}

{% block javascripts %}
{{parent()}}
<script src="{{ asset('bundles/applicationsonataclientoperations/js/jquery.tablesorter.js') }}" type="text/javascript"></script>
<script src="{{ asset('bundles/applicationsonataclientoperations/js/jquery.columnfilters.js') }}" type="text/javascript"></script>
<script src="{{ asset('bundles/applicationsonataclientoperations/js/jquery.sticky.header.js') }}" type="text/javascript"></script>
{% endblock javascripts %}

{% block javascriptsafter %}
{{ parent()}}
<script type="text/javascript">
    $(function () {
        $('.sonata-ba-list .table').tablesorter({
            {% if not admin.getLocking %}headers:{ 0:{ sorter:false}, 1:{sorter:false} }, {% endif %}
            cancelSelection:false
        });
        $('.sonata-ba-list .table').columnFilters({
            {% if not admin.getLocking %}excludeColumns:[0, 1], {% endif %}
            wildCard:false,
            underline:true,
            alternateRowClassNames:['rowa', 'rowb']
        });
        var w = $('.sonata-ba-list table.table').width() + 71;
        if (w > 110) {
            $('#container').css('min-width', w + 'px');
        }
    });
    $(function () {
        var $table = $('.sonata-ba-list .table tbody:first')
        var $tr = $table.find('tr:first').clone();

        //$tr.css('position', 'absolute');

        var add_total_rows = false;
        $tr.children().each(function () {
            $(this).removeAttr('objectid');
            var $div = $(this).children();
            if (!$div.hasClass('totals')) {
                $(this).removeClass('sonata-ba-list-field-money').html('&nbsp;');
            }
            else {
                add_total_rows = true;
                var tc = $div.removeClass('totals')
                        .attr("class");
                $div.attr("class", tc + '_total')

                var sum = 0;
                $('.' + tc).each(function () {
                    sum += parseFloat($(this).html());
                });
                $div.html('<b>Total:<br/>' + sum + '</b>');
            }
        });

        if (add_total_rows) {
            $tr.appendTo($table);
        }
        else {
            $tr.remove();
        }
    });
    $(function () {
        $('.sonata-ba-list table.table td.sonata-ba-list-field-money').each(function () {
            var $this = $(this);
            var val = $this.text().trim().replace(/[^\d\.]+/, '');
            var repl = Number(val).toFixed(2).toString();

            $this.html($this.html().replace(val, repl));
            $this.html($this.html().replace('.', ','));
        });
    });
    $(function () {
        var $thead = $('.sonata-ba-list .table thead:first');
        var $tr = $('<tr />').prependTo($thead);
        var $th = $('<th />')
                .attr('colspan', $thead.children(':last').children().length)
                .append($('.clientoperations_tabs_types_block'))
                .appendTo($tr);
        var depth = 0;
        $thead.children().addClass('sticky_header').each(function(){
            $(this).attr('depth', depth++);
        });
        $('.sonata-ba-list .table').stickyHeader({
            'headerClassName':'sticky_header',
            'depth':[1, 1, 1]
        });
        //$('.sonata-ba-list .table thead:first').affix();
    });
    {% if not admin.getLocking %}

    $(function () {
        var editObjectAbstractUrl = '{{ admin.generateUrl('edit', {'id':'__id__'}) }}';
        var $table = $('.sonata-ba-list .table tbody:first');
        $table.find('tr').css('cursor', 'pointer').click(function (event) {
            var objectid = $(this).children(':last').attr('objectid');
            if (objectid) {
                var link = editObjectAbstractUrl.replace("__id__", objectid).replace('&amp;', '&');
                field_dialog_form_add_{{ id }}(event, link);
            }
        });
    });
    {% endif %}

    $(function () {

        $('.sonata-actions .sonata-action-element a').live('click', function(event){
            var link = $(this).attr('href');
            field_dialog_form_add_{{ id }}(event, link);
            return false;
        });
    });

    //ajax load, complete
    var ajax_loading = false;
    $(function () {

        if(!ajax_loading){
            ajax_loading = $('<div id="ajax_loading" style="background:#fff; border:1px solid #dddddd; position:fixed; left:45%; top: 25%; padding:20px 30px; z-index:99999" class="all_loading"><img height="66" width="66" alt=""  src="/img/ajax-loader.gif" /></div>').hide().appendTo('body');
        }

        $('#ajax_loading')
                .bind('ajaxSend', function(){
                    ajax_loading.show();
                })
                .bind('ajaxComplete', function(){
                    ajax_loading.hide();
                });
    });

</script>
{% include 'ApplicationSonataClientOperationsBundle::list_layout.js.twig'%}
{% endblock javascriptsafter %}
{'fraction_non_alphanumeric': 0.19487948982462722, 'fraction_numerical': 0.006377192159804933, 'mean_word_length': 2.2344555656657565, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 37, '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': '1569520', 'n_tokens_mistral': 3325, 'n_tokens_neox': 3104, 'n_words': 511}