<commit_before><tr class="version">
    <td class="fileCheckbox">
    </td>
    <td colspan="4">
        <ul class="version">
        {% for version in versions %}
            <li {% if loop.first %} class="selected" {% endif %}>
                <table>
                    <tr>
                        <td class="versionId">
                            v{{ version.displayId }}
                        </td>
                        <td class="description" data-toggle="modal" data-target="#modal{{version.id}}">
                            <a href="javascript:void(0)" data-toggle="tooltip" data-placement="top" title="{{ version.comment }}">
                                {{ version.description }}
                                {%- if version.comment is not null -%}
                                    <img class="comment" src="{{ asset('img/icons/comment.png') }}" alt="comment icon">
                                {%- endif -%}
                            </a>
                        </td>

                        <div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true" id="modal{{version.id}}">
                          <div class="modal-dialog modal-sm">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                    <h4 class="modal-title" id="myModalLabel">Version Management</h4>
                                </div>
                                <div class="modal-body">
                                    <ul>
                                        <li>File: {{version.file.name}}.{{version.file.type}}</li>
                                        <li>Version: {{version.displayId}}</li>
                                        <li>Date: {%- if "now"|date("Y/m/d") == version.date|date('Y/m/d') %}
                                                    {{ version.date|date('H:i') }}
                                                  {% else %}
                                                    {{ version.date|date('Y/m/d') }}
                                                  {% endif -%}
                                    </ul>
                                    <button type="button" class="btn btn-default restore" id='{{version.id}}'>Restore</button>

                                    <button type="button" class="btn btn-default download" id="{{version.id}}" onClick="self.location.href='{{ path('time_box_main_version_download', {'versionId': version.id}) }}'">Download</button>
                                    
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
                                </div>
                            </div>
                          </div>
                        </div>


                        <td class="size">
                            {% if version.size > 1000000  %}
                                {{ version.size // 1000000 + 1 }} MB
                            {% elseif version.size > 1000  %}
                                {{ version.size // 1000 + 1 }} KB
                            {% else %}
                                {{ version.size }} B
                            {% endif %}
                        </td>
                        <td class="lastEdit">
                            {%- if "now"|date("Y/m/d") == version.date|date('Y/m/d') %}
                                {{ version.date|date('H:i') }}
                            {% else %}
                                {{ version.date|date('Y/m/d') }}
                            {% endif -%}
                        </td>
                    </tr>
                </table>
            </li>
        {% endfor %}
        </ul>

        
        <script type="text/javascript">
            $(function () {
                $("a").tooltip();
            });
            $(document).ready(function() {
                $("button.restore").click(function(evt) {
                    var versionId = evt.target.id;    

                    $.ajax({
                        url: "{{ path('time_box_main_version_restore') }}",
                        type: "POST",
                        data: {
                            'versionId': JSON.stringify(versionId),
                        },
                        success: function() {
                            alert("Version restored!");
                        },
                        error: function (data) {
                            alert("Restoration failed with message:\n"+data);
                        }
                    });
                    return false;
                });
            });
        </script>
    </td>
</tr>
<commit_msg>Removed confirmation popup during file restoration.<commit_after><tr class="version">
    <td class="fileCheckbox">
    </td>
    <td colspan="4">
        <ul class="version">
        {% for version in versions %}
            <li {% if loop.first %} class="selected" {% endif %}>
                <table>
                    <tr>
                        <td class="versionId">
                            v{{ version.displayId }}
                        </td>
                        <td class="description" data-toggle="modal" data-target="#modal{{version.id}}">
                            <a href="javascript:void(0)" data-toggle="tooltip" data-placement="top" title="{{ version.comment }}">
                                {{ version.description }}
                                {%- if version.comment is not null -%}
                                    <img class="comment" src="{{ asset('img/icons/comment.png') }}" alt="comment icon">
                                {%- endif -%}
                            </a>
                        </td>

                        <div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true" id="modal{{version.id}}">
                          <div class="modal-dialog modal-sm">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                    <h4 class="modal-title" id="myModalLabel">Version Management</h4>
                                </div>
                                <div class="modal-body">
                                    <ul>
                                        <li>File: {{version.file.name}}.{{version.file.type}}</li>
                                        <li>Version: {{version.displayId}}</li>
                                        <li>Date: {%- if "now"|date("Y/m/d") == version.date|date('Y/m/d') %}
                                                    {{ version.date|date('H:i') }}
                                                  {% else %}
                                                    {{ version.date|date('Y/m/d') }}
                                                  {% endif -%}
                                    </ul>
                                    <button type="button" class="btn btn-default restore" id='{{version.id}}'>Restore</button>

                                    <button type="button" class="btn btn-default download" id="{{version.id}}" onClick="self.location.href='{{ path('time_box_main_version_download', {'versionId': version.id}) }}'">Download</button>

                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
                                </div>
                            </div>
                          </div>
                        </div>


                        <td class="size">
                            {% if version.size > 1000000  %}
                                {{ version.size // 1000000 + 1 }} MB
                            {% elseif version.size > 1000  %}
                                {{ version.size // 1000 + 1 }} KB
                            {% else %}
                                {{ version.size }} B
                            {% endif %}
                        </td>
                        <td class="lastEdit">
                            {%- if "now"|date("Y/m/d") == version.date|date('Y/m/d') %}
                                {{ version.date|date('H:i') }}
                            {% else %}
                                {{ version.date|date('Y/m/d') }}
                            {% endif -%}
                        </td>
                    </tr>
                </table>
            </li>
        {% endfor %}
        </ul>


        <script type="text/javascript">
            $(function () {
                $("a").tooltip();
            });
            $(document).ready(function() {
                $("button.restore").click(function(evt) {
                    var versionId = evt.target.id;

                    $.ajax({
                        url: "{{ path('time_box_main_version_restore') }}",
                        type: "POST",
                        data: {
                            'versionId': JSON.stringify(versionId),
                        },
                        success: function() {
                            $("#modal"+versionId+".modal").modal('toggle');
                            window.location = "{{ path('time_box_main_file') }}";
                        },
                        error: function (data) {
                            alert("Restoration failed with message:\n"+data);
                        }
                    });
                    return false;
                });
            });
        </script>
    </td>
</tr>

{'fraction_non_alphanumeric': 0.13798893717898064, 'fraction_numerical': 0.005728960885025681, 'mean_word_length': 0.8496529046401169, 'pattern_counts': {'":': 0, '<': 115, '<?xml version=': 0, '>': 119, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 63, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6443965', 'n_tokens_mistral': 2408, 'n_tokens_neox': 2166, 'n_words': 386}