<commit_before>{% extends "IntractoSecretSantaBundle::base.html.twig" %}
{% block javascripts %}
    <script type="text/javascript">

    function addNewEntry(collectionHolder) {
        // Get entry prototype as defined in attribute data-prototype
        var prototype = collectionHolder.attr('data-prototype');
        // Adjust entry prototype for correct naming
        var number_of_entries = collectionHolder.children().length; // Note, owner is not counted as entry
        var newFormHtml = prototype.replace(/__name__/g, number_of_entries - 1).replace(/__entrycount__/g, number_of_entries + 1);

        // Add new entry to pool with animation
        var newForm = $(newFormHtml);
        collectionHolder.append(newForm);
        newForm.show(300);

        // Handle delete button events
        bindDeleteButtonEvents();
    } 

    function bindDeleteButtonEvents() {

        // Remove disabled state on delete-buttons
        $('.remove-entry').removeClass('disabled');


        // Loop over all delete buttons
        $('button.remove-entry').each(function(i){
            // Remove any previously binded event
            $(this).off('click');

            // Bind event
            $(this).click(function(e) {
                e.preventDefault();

                // Todo: Event logic
                $('tr.entry.not-owner:eq(' + i + ')').remove();

            });
        });

    }

    /* Variables */
    var collectionHolder = $('table.entries tbody');

    /* Document Ready */
    jQuery(document).ready(function() {

        //Add eventlistener on add-new-entry button
        $('.add-new-entry').click(function(e) {
            e.preventDefault();
            addNewEntry(collectionHolder);
        });

    });
    </script>
{% endblock %}
{% block main %}

<h1>Secret Santa</h1>

{#{ form_errors(form) }#}
<commit_msg>added todo message<commit_after>{% extends "IntractoSecretSantaBundle::base.html.twig" %}
{% block javascripts %}
    <script type="text/javascript">

    function addNewEntry(collectionHolder) {
        // Get entry prototype as defined in attribute data-prototype
        var prototype = collectionHolder.attr('data-prototype');
        // Adjust entry prototype for correct naming
        var number_of_entries = collectionHolder.children().length; // Note, owner is not counted as entry
        var newFormHtml = prototype.replace(/__name__/g, number_of_entries - 1).replace(/__entrycount__/g, number_of_entries + 1);

        // Add new entry to pool with animation
        var newForm = $(newFormHtml);
        collectionHolder.append(newForm);
        newForm.show(300);

        // Handle delete button events
        bindDeleteButtonEvents();
    } 

    function bindDeleteButtonEvents() {

        // Remove disabled state on delete-buttons
        $('.remove-entry').removeClass('disabled');


        // Loop over all delete buttons
        $('button.remove-entry').each(function(i){
            // Remove any previously binded event
            $(this).off('click');

            // Bind event
            $(this).click(function(e) {
                e.preventDefault();

                // Todo: Event logic
                $('tr.entry.not-owner:eq(' + i + ')').remove();
                alert('Todo: remove person logic, respecting incremental classnames etc.');

            });
        });

    }

    /* Variables */
    var collectionHolder = $('table.entries tbody');

    /* Document Ready */
    jQuery(document).ready(function() {

        //Add eventlistener on add-new-entry button
        $('.add-new-entry').click(function(e) {
            e.preventDefault();
            addNewEntry(collectionHolder);
        });

    });
    </script>
{% endblock %}
{% block main %}

<h1>Secret Santa</h1>

{#{ form_errors(form) }#}

{'fraction_non_alphanumeric': 0.1332631024493021, 'fraction_numerical': 0.003687121411640769, 'mean_word_length': 2.2517123287671232, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '1221952', 'n_tokens_mistral': 1051, 'n_tokens_neox': 978, 'n_words': 236}