<commit_before><div class="row" style="text-align:center; margin-bottom:10px; margin-top:20px;">
    <div class="input-append">
        <input type="text" id="search-text" name="search" class="span4" placeholder="{{ _('action_add_ester_search_placeholder') }}" value="" data-intro="{{ _('action_add_ester_help_search') }}" data-position="bottom" /><button id="search-button" class="btn">{{ _('search_button') }}</button>
    </div>
</div>
<div class="row" style="text-align:center; margin-bottom:10px; margin-top:20px;">
    <img src="{{ static_url('images/spinner_white.gif') }}" id="search-spinner" style="padding:40px; display:none; " />
</div>
<table id="search-results" class="table" style="margin:0px 0px 50px 0px;">
</table>

<script>

    function importItem(ester_id, entity, definition) {
        $('#modal-box').modal('hide');
        $('#modal-box').html('');
        $.post('/ester/import', {
            'ester_id': ester_id,
            'entity': entity,
            'definition': definition,
        },
        function(new_id) {
            window.location = '/entity/{{ entity_definition_keyname }}/'+new_id;
        });
    };

    $(document).ready(function(){
        $('#search-text').focus();

        $("#search-text").keyup(function(event) {
            if(event.keyCode == 13){
                $("#search-button").click();
            }
        });

        $('#search-button').click(function() {
            if($('#search-text').val()) {
                $('#search-spinner').show();
                $('#search-results').hide();
                $('#search-results').html('');
                $.get('https://i9lyebbfnd.execute-api.eu-central-1.amazonaws.com/prod', {
                        q: $('#search-text').val(),
                        f: 'human'
                    },
                    function(list) {
                        for (i in list) {
                            var item = list[i];
                            var tr = '<tr>';
                            // tr += '<td style="width:50px;">';
                            // if(item.isbn) tr += '<img src="https://ester.entu.eu/cover/'+item.isbn+'" style="width:50px; height:50px;" />';
                            // if(item.issn && !item.isbn) tr += '<img src="https://ester.entu.eu/cover/'+item.issn+'" style="width:50px; height:50px;" />';
                            // tr += '</td>';
                            tr += '<td style="width:99%">';
                            if(item.title) tr += '<b>'+item.title.join('<br />')+'</b><br />';
                            if(item.subtitle) tr += '<i>'+item.subtitle.join(', ')+'</i><br />';
                            if(item.author) tr += '<b>'+item.author.join(' / ')+'</b><br />';
                            if(item['publishing-date']) tr += item['publishing-date'].join(', ')+'<br />';
                            if(item.isbn) tr += '<i>'+item.isbn.join(', ')+'</i>';
                            if(item.issn) tr += ' <i>'+item.issn.join(', ')+'</i>';
                            tr += '</td>';
                            tr += '<td id="ester-'+item['ester-id'][0]+'"><a href="javascript:importItem(\''+item['ester-id'][0]+'\',{{ parent_entity_id }},\'{{ entity_definition_keyname }}\');" class="btn btn-success pull-right" style="margin-right:5px;">{{ _('action_add_ester_add') }}</a></td>';
                            tr += '</tr>';
                            $('#search-results').append(tr);

                            if(!item['ester-id']) continue
                            $.get('/ester/check', {ester_id: item['ester-id'][0]}, function(data) {
                                $('#ester-' + data.result.ester_id).append('<a href="/entity/'+data.result.definition+'/'+data.result.entity+'" class="btn btn-info pull-right" style="margin-top:5px;margin-right:5px;">{{ _('action_add_ester_open') }}</a>')
                            }, 'json');
                        };
                        $('#search-results').show();
                        $('#search-spinner').hide();
                }, 'json').fail(function() {
                    $('#search-spinner').hide();
                    $('#search-results').hide();
                    $('#search-results').html('');
                });
            } else {
                $('#search-text').focus();
            }

        });

    });
</script><commit_msg>Replace . in id<commit_after><div class="row" style="text-align:center; margin-bottom:10px; margin-top:20px;">
    <div class="input-append">
        <input type="text" id="search-text" name="search" class="span4" placeholder="{{ _('action_add_ester_search_placeholder') }}" value="" data-intro="{{ _('action_add_ester_help_search') }}" data-position="bottom" /><button id="search-button" class="btn">{{ _('search_button') }}</button>
    </div>
</div>
<div class="row" style="text-align:center; margin-bottom:10px; margin-top:20px;">
    <img src="{{ static_url('images/spinner_white.gif') }}" id="search-spinner" style="padding:40px; display:none; " />
</div>
<table id="search-results" class="table" style="margin:0px 0px 50px 0px;">
</table>

<script>

    function importItem(ester_id, entity, definition) {
        $('#modal-box').modal('hide');
        $('#modal-box').html('');
        $.post('/ester/import', {
            'ester_id': ester_id,
            'entity': entity,
            'definition': definition,
        },
        function(new_id) {
            window.location = '/entity/{{ entity_definition_keyname }}/'+new_id;
        });
    };

    $(document).ready(function(){
        $('#search-text').focus();

        $("#search-text").keyup(function(event) {
            if(event.keyCode == 13){
                $("#search-button").click();
            }
        });

        $('#search-button').click(function() {
            if($('#search-text').val()) {
                $('#search-spinner').show();
                $('#search-results').hide();
                $('#search-results').html('');
                $.get('https://i9lyebbfnd.execute-api.eu-central-1.amazonaws.com/prod', {
                        q: $('#search-text').val(),
                        f: 'human'
                    },
                    function(list) {
                        for (i in list) {
                            var item = list[i];
                            var tr = '<tr>';
                            // tr += '<td style="width:50px;">';
                            // if(item.isbn) tr += '<img src="https://ester.entu.eu/cover/'+item.isbn+'" style="width:50px; height:50px;" />';
                            // if(item.issn && !item.isbn) tr += '<img src="https://ester.entu.eu/cover/'+item.issn+'" style="width:50px; height:50px;" />';
                            // tr += '</td>';
                            tr += '<td style="width:99%">';
                            if(item.title) tr += '<b>'+item.title.join('<br />')+'</b><br />';
                            if(item.subtitle) tr += '<i>'+item.subtitle.join(', ')+'</i><br />';
                            if(item.author) tr += '<b>'+item.author.join(' / ')+'</b><br />';
                            if(item['publishing-date']) tr += item['publishing-date'].join(', ')+'<br />';
                            if(item.isbn) tr += '<i>'+item.isbn.join(', ')+'</i>';
                            if(item.issn) tr += ' <i>'+item.issn.join(', ')+'</i>';
                            tr += '</td>';
                            tr += '<td id="ester-'+item['ester-id'][0].replace('.', '')+'"><a href="javascript:importItem(\''+item['ester-id'][0]+'\',{{ parent_entity_id }},\'{{ entity_definition_keyname }}\');" class="btn btn-success pull-right" style="margin-right:5px;">{{ _('action_add_ester_add') }}</a></td>';
                            tr += '</tr>';
                            $('#search-results').append(tr);

                            if(!item['ester-id']) continue
                            $.get('/ester/check', {ester_id: item['ester-id'][0]}, function(data) {
                                $('#ester-' + data.result.ester_id.replace('.', '')).append('<a href="/entity/'+data.result.definition+'/'+data.result.entity+'" class="btn btn-info pull-right" style="margin-top:5px;margin-right:5px;">{{ _('action_add_ester_open') }}</a>')
                            }, 'json');
                        };
                        $('#search-results').show();
                        $('#search-spinner').hide();
                }, 'json').fail(function() {
                    $('#search-spinner').hide();
                    $('#search-results').hide();
                    $('#search-results').html('');
                });
            } else {
                $('#search-text').focus();
            }

        });

    });
</script>
{'fraction_non_alphanumeric': 0.22365126337354882, 'fraction_numerical': 0.008650125199180514, 'mean_word_length': 1.7061903295349554, 'pattern_counts': {'":': 0, '<': 89, '<?xml version=': 0, '>': 89, 'https://': 6, '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': '4799576', 'n_tokens_mistral': 2600, 'n_tokens_neox': 2540, 'n_words': 359}