<commit_before>{% extends 'layout.twig' %}
{% block title %}Wiadomości prywatne {{ parent() }}{% endblock %}

{% import 'components/modals.twig' as modal %}

{% block container %}
    {{ include('user/_top', {active: 'home'}) }}

    <div class="row">
        {% include 'user/_home-menu' %}

        <main class="col-md-10">
            <section class="panel panel-wrapper">
                <div class="panel-body">
                    <h2>Wiadomości prywatne</h2>

                    <ul class="nav nav-panel">
                        <li role="presentation" {{ parent != 'user.pm.submit' ? 'class="active"' }}><a href="{{ route('user.pm') }}">Wiadomości ({{ user('pm_unread') }}/{{ user('pm') }})</a></li>
                        <li role="presentation" {{ parent == 'user.pm.submit' ? 'class="active"' }}><a href="{{ route('user.pm.submit') }}">Napisz wiadomość</a></li>
                    </ul>

                    <div id="box-pm" class="panel panel-default">
                        <div class="panel-body">
                            {% block pm %}
                            {% endblock %}
                        </div>
                    </div>
                </div>
            </section>
        </main>
    </div>

    {{ modal.confirm('Czy na pewno usunąć tę wiadomość? Tej operacji nie będzie można cofnąć.') }}
{% endblock %}

{% block head %}
    {{ parent() }}

    <link rel="stylesheet" href="/css/user.css">
{% endblock %}

{% block body %}
    {{ parent() }}

    <script type="text/javascript" src="/js/modal.js"></script>
    <script type="text/javascript">
        $(function() {
            $('.btn-delete-pm').click(function() {
                var $this = $(this);

                $('#confirm').modal('show').one('click', '.danger', function() {
                    $('<form>', {'method': 'POST', 'action': $this.attr('href')})
                            .append('<input type="hidden" name="_token" value="' + $('meta[name="csrf-token"]').attr('content') + '">')
                            .appendTo('body')
                            .submit();
                });

                return false;
            });

            $('#box-pm a[data-toggle="tab"]').click(function(e) {
                if ($(e.target).attr('aria-controls') == 'preview') {
                    $.post('{{ route('user.pm.preview') }}', {'text': $('textarea[name="text"]').val()}, function(html) {
                        $('#preview').html(html);
                    });
                }
            });
        });
    </script><commit_msg>dodanie ajax loadera<commit_after>{% extends 'layout.twig' %}
{% block title %}Wiadomości prywatne {{ parent() }}{% endblock %}

{% import 'components/modals.twig' as modal %}

{% block container %}
    {{ include('user/_top', {active: 'home'}) }}

    <div class="row">
        {% include 'user/_home-menu' %}

        <main class="col-md-10">
            <section class="panel panel-wrapper">
                <div class="panel-body">
                    <h2>Wiadomości prywatne</h2>

                    <ul class="nav nav-panel">
                        <li role="presentation" {{ parent != 'user.pm.submit' ? 'class="active"' }}><a href="{{ route('user.pm') }}">Wiadomości ({{ user('pm_unread') }}/{{ user('pm') }})</a></li>
                        <li role="presentation" {{ parent == 'user.pm.submit' ? 'class="active"' }}><a href="{{ route('user.pm.submit') }}">Napisz wiadomość</a></li>
                    </ul>

                    <div id="box-pm" class="panel panel-default">
                        <div class="panel-body">
                            {% block pm %}
                            {% endblock %}
                        </div>
                    </div>
                </div>
            </section>
        </main>
    </div>

    {{ modal.confirm('Czy na pewno usunąć tę wiadomość? Tej operacji nie będzie można cofnąć.') }}
{% endblock %}

{% block head %}
    {{ parent() }}

    <link rel="stylesheet" href="/css/user.css">
{% endblock %}

{% block body %}
    {{ parent() }}

    <script type="text/javascript" src="/js/modal.js"></script>
    <script type="text/javascript">
        $(function() {
            $('.btn-delete-pm').click(function() {
                var $this = $(this);

                $('#confirm').modal('show').one('click', '.danger', function() {
                    $('<form>', {'method': 'POST', 'action': $this.attr('href')})
                            .append('<input type="hidden" name="_token" value="' + $('meta[name="csrf-token"]').attr('content') + '">')
                            .appendTo('body')
                            .submit();
                });

                return false;
            });

            $('#box-pm a[data-toggle="tab"]').click(function(e) {
                if ($(e.target).attr('aria-controls') == 'preview') {
                    $('#preview').html('<i class="fa fa-spinner fa-spin fa-2x"></i>');

                    $.post('{{ route('user.pm.preview') }}', {'text': $('textarea[name="text"]').val()}, function(html) {
                        $('#preview').html(html);
                    });
                }
            });
        });
    </script>
{'fraction_non_alphanumeric': 0.20867728930696872, 'fraction_numerical': 0.0017277788443079286, 'mean_word_length': 1.6286579212916246, 'pattern_counts': {'":': 0, '<': 67, '<?xml version=': 0, '>': 67, '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': '5543620', 'n_tokens_mistral': 1596, 'n_tokens_neox': 1469, 'n_words': 274}