<commit_before>{% extends "base.twig" %}
{% import 'macros/assets.twig' as assets %}

{% block css %}
    {{ assets.css('hammer') }}
{% endblock %}

{% block content %}
<div id="hammer">
    <h3>Martillo @ {{ subtitle.version.episode.fullname }}</h3>

    <div class='candidates'>
        Candidatos:
        <ul>
            {% for user in users %}
                <hammertarget id="{{ user[0].id }}" username="{{ user[0].username }}" count="{{ user[1] }}"></hammertarget>
            {% endfor %}
        </ul>
    </div>
</div>
{% endblock %}

{% block scripts %}
    <script type="text/javascript">
        let subID = {{ subtitle.id }};
        {% verbatim %}
            Vue.component('hammertarget', {
                template: "<li class='target' v-if='!deleted'><i class='fa fa-gavel hammer' aria-hidden='true' @click='hammer'></i> <a :href='\"/users/\"+id'>{{ username }}</a> ({{ count }} secuencias)</li>",
                props: ['id', 'username', 'count'],
                data: function() {
                    return {
                        deleted: false
                    }
                },
                methods: {
                    hammer: function() {
                        let pthis = this;
                        alertify.confirm('Estás a punto de eliminar todas las contribuciones de <b>'+pthis.username+'</b> en el subtítulo.<br/>¿Estás seguro de querer continuar?', function(){
                            $.ajax({
                                url: '/subtitles/' + subID + '/hammer',
                                method: 'POST',
                                data: {
                                    user: pthis.id
                                }
                            }).done(function() {
                                pthis.deleted = true;
                                alertify.success("Poof! Las contribuciones de <b>"+pthis.username+"</b> han sido eliminadas");
                            });
                        });                        
                    }
                }
            });

            let page = new Vue({
                el: '#hammer'
            });
        {% endverbatim %}
    </script>
{% endblock %}<commit_msg>Link title on hammer section to the episode itself<commit_after>{% extends "base.twig" %}
{% import 'macros/assets.twig' as assets %}

{% block css %}
    {{ assets.css('hammer') }}
{% endblock %}

{% block content %}
<div id="hammer">
    <h3>Martillo @ <a href="/episodes/{{ subtitle.version.episode.id }}">{{ subtitle.version.episode.fullname }}</a></h3>

    <div class='candidates'>
        Candidatos:
        <ul>
            {% for user in users %}
                <hammertarget id="{{ user[0].id }}" username="{{ user[0].username }}" count="{{ user[1] }}"></hammertarget>
            {% endfor %}
        </ul>
    </div>
</div>
{% endblock %}

{% block scripts %}
    <script type="text/javascript">
        let subID = {{ subtitle.id }};
        {% verbatim %}
            Vue.component('hammertarget', {
                template: "<li class='target' v-if='!deleted'><i class='fa fa-gavel hammer' aria-hidden='true' @click='hammer'></i> <a :href='\"/users/\"+id'>{{ username }}</a> ({{ count }} secuencias)</li>",
                props: ['id', 'username', 'count'],
                data: function() {
                    return {
                        deleted: false
                    }
                },
                methods: {
                    hammer: function() {
                        let pthis = this;
                        alertify.confirm('Estás a punto de eliminar todas las contribuciones de <b>'+pthis.username+'</b> en el subtítulo.<br/>¿Estás seguro de querer continuar?', function(){
                            $.ajax({
                                url: '/subtitles/' + subID + '/hammer',
                                method: 'POST',
                                data: {
                                    user: pthis.id
                                }
                            }).done(function() {
                                pthis.deleted = true;
                                alertify.success("Poof! Las contribuciones de <b>"+pthis.username+"</b> han sido eliminadas");
                            });
                        });                        
                    }
                }
            });

            let page = new Vue({
                el: '#hammer'
            });
        {% endverbatim %}
    </script>
{% endblock %}
{'fraction_non_alphanumeric': 0.15542781339818704, 'fraction_numerical': 0.002210921954455008, 'mean_word_length': 1.2154750244857981, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3199164', 'n_tokens_mistral': 1278, 'n_tokens_neox': 1170, 'n_words': 263}