<commit_before>{% extends "user/base-users.html" %}

{% block title_ruler %}{% endblock %}

{% block title_row %}
    {% set title = contest.name %}
    {% include "contest/contest-tabs.html" %}
{% endblock %}

{% block users_media %}
    <style>
        #users-table .username {
            min-width: 20em;
        }

        #users-table td {
            height: 2.5em;
        }

        #users-table a {
            display: block;
        }

        .userinfo a, .user-name a, .user-name form {
            display: inline !important;
        }

        #users-table th a, #users-table th a:link, #users-table th a:visited {
            color: white;
        }

        #users-table th a:hover {
            color: #0F0;
        }

        #users-table td a:hover {
            text-decoration: underline;
        }

        .rank {
            min-width: 2.5em
        }

        .points {
            min-width: 4em;
        }

        .disqualified {
            background-color: #ffa8a8 !important;
        }

        .full-score, .full-score a {
            font-weight: bold;
            color: green;
        }

        .partial-score, .partial-score a {
            color: green;
        }

        .failed-score, .failed-score a {
            font-weight: bold;
            color: red;
        }

        .pretest-full-score, .pretest-full-score a {
            font-weight: bold;
            color: #2980b9;
        }

        .pretest-partial-score, .pretest-partial-score a {
            color: #2980b9;
        }

        .pretest-failed-score, .pretest-failed-score a {
            font-weight: bold;
            color: red;
        }

        .user-points, .user-points a {
            font-weight: bold;
            color: black;
        }

        .solving-time {
            color: gray;
            font-weight: normal;
            font-size: 0.75em;
            padding-bottom: -0.75em;
        }

        .point-denominator {
            border-top: 1px solid gray;
            font-size: 0.7em;
        }

        .start-time {
            display: none;
        }

        .user-name {
            position: relative;
        }

        .organization-column {
            display: none;
            text-align: left !important;
            border-right: none !important;
        }

        .organization-column a {
            color: gray !important;
            font-weight: 600;
        }
    </style>

    {% if has_rating %}
        <style>#users-table .rate-box {
            font-size: 0.85em;
            float: left;
        }

        #users-table td:nth-child(1) .rating {
            margin-left: 1.25em;
            display: block;
        }

        #users-table td:nth-child(2) a {
            display: block;
        }
        </style>
    {% endif %}

    <style>
        .select2-selection__arrow {
            display: none;
        }

        .select2-selection__rendered {
            cursor: text;
            overflow: initial !important
        }

        .select2-results__option--highlighted {
            background-color: #DEDEDE !important;
        }

        .select2-results__option {
            white-space: nowrap;
        }

        #search-contest, #search-contest + .select2 {
            margin-top: 0.5em;
        }

        #search-contest {
            width: 200px;
            height: 2.3em;
        }
    </style>
{% endblock %}

{% block users_js_media %}
    {% if can_edit %}
        <script type="text/javascript">
            $(function () {
                $('a.disqualify-participation').click(function (e) {
                    e.preventDefault();
                    if (e.ctrlKey || e.metaKey || confirm("{{ _('Are you sure you want to disqualify this participation?') }}"))
                        $(this).closest('form').submit();
                })
                $('a.un-disqualify-participation').click(function (e) {
                    e.preventDefault();
                    if (e.ctrlKey || e.metaKey || confirm("{{ _('Are you sure you want to un-disqualify this participation?') }}"))
                        $(this).closest('form').submit();
                })
            });
        </script>
    {% endif %}
    {% if not contest.ended %}
        <script type="text/javascript">
            $(function () {
                window.install_tooltips = function () {
                    $('td.user-name').find('span:first-child').each(function () {
                        var link = $(this);
                        link.mouseenter(function (e) {
                            var start_time = link.siblings('.start-time').text().trim();
                            link.addClass('tooltipped tooltipped-e').attr('aria-label', start_time);
                        }).mouseleave(function (e) {
                            link.removeClass('tooltipped tooltipped-e').removeAttr('aria-label');
                        });
                    });
                };

                install_tooltips();
            });
        </script>
    {% endif %}
    <script type="text/javascript">
        $(function () {
            var url = '{{ url('contest_participation', contest.key, '__username__') }}';
            var placeholder = $('#search-contest').replaceWith($('<select>').attr({
                id: 'search-contest'
            })).attr('placeholder');

            $('#search-contest').select2({
                placeholder: placeholder,
                ajax: {
                    url: '{{ url('contest_user_search_select2_ajax', contest.key) }}'
                },
                minimumInputLength: 1,
                templateResult: function (data) {
                    return $('<span>')
                        .append($('<img>', {
                            class: 'user-search-image',
                            src: data.gravatar_url,
                            width: 24,
                            height: 24,
                        }))
                        .append($('<span>', {
                            class: data.display_rank + ' user-search-name',
                        }).text(data.text));
                }
            }).on('change', function () {
                window.location.href = url.replace('__username__', $(this).val());
            });

            $('#show-organizations-checkbox').click(function () {
                $('.organization-column').toggle();
                localStorage.setItem('show-organizations', $('.organization-column').is(':visible') ? 'true' : 'false');
            });
            
            if (localStorage.getItem('show-organizations') == 'true') {
                $('.organization-column').show();
                $('#show-organizations-checkbox').prop('checked', true);
            }
        });
    </script>
    {% include "contest/media-js.html" %}
{% endblock %}

{% block before_users_table %}
    <div style="margin-bottom: 0.5em">
        {% if tab == 'participation' %}
            {% if contest.can_see_full_scoreboard(request.user) %}
                <input id="search-contest" type="text" placeholder="{{ _('View user participation') }}">
            {% endif %}
        {% endif %}
        <input id="show-organizations-checkbox" type="checkbox" style="vertical-align: bottom">
        <label for="show-organizations-checkbox" style="vertical-align: bottom">{{ _('Show organizations') }}</label>
    </div>
{% endblock %}

{% block users_table %}
    {% include "contest/ranking-table.html" %}
{% endblock %}
<commit_msg>Use a more precise filter for participation start tooltip (#1566)<commit_after>{% extends "user/base-users.html" %}

{% block title_ruler %}{% endblock %}

{% block title_row %}
    {% set title = contest.name %}
    {% include "contest/contest-tabs.html" %}
{% endblock %}

{% block users_media %}
    <style>
        #users-table .username {
            min-width: 20em;
        }

        #users-table td {
            height: 2.5em;
        }

        #users-table a {
            display: block;
        }

        .userinfo a, .user-name a, .user-name form {
            display: inline !important;
        }

        #users-table th a, #users-table th a:link, #users-table th a:visited {
            color: white;
        }

        #users-table th a:hover {
            color: #0F0;
        }

        #users-table td a:hover {
            text-decoration: underline;
        }

        .rank {
            min-width: 2.5em
        }

        .points {
            min-width: 4em;
        }

        .disqualified {
            background-color: #ffa8a8 !important;
        }

        .full-score, .full-score a {
            font-weight: bold;
            color: green;
        }

        .partial-score, .partial-score a {
            color: green;
        }

        .failed-score, .failed-score a {
            font-weight: bold;
            color: red;
        }

        .pretest-full-score, .pretest-full-score a {
            font-weight: bold;
            color: #2980b9;
        }

        .pretest-partial-score, .pretest-partial-score a {
            color: #2980b9;
        }

        .pretest-failed-score, .pretest-failed-score a {
            font-weight: bold;
            color: red;
        }

        .user-points, .user-points a {
            font-weight: bold;
            color: black;
        }

        .solving-time {
            color: gray;
            font-weight: normal;
            font-size: 0.75em;
            padding-bottom: -0.75em;
        }

        .point-denominator {
            border-top: 1px solid gray;
            font-size: 0.7em;
        }

        .start-time {
            display: none;
        }

        .user-name {
            position: relative;
        }

        .organization-column {
            display: none;
            text-align: left !important;
            border-right: none !important;
        }

        .organization-column a {
            color: gray !important;
            font-weight: 600;
        }
    </style>

    {% if has_rating %}
        <style>#users-table .rate-box {
            font-size: 0.85em;
            float: left;
        }

        #users-table td:nth-child(1) .rating {
            margin-left: 1.25em;
            display: block;
        }

        #users-table td:nth-child(2) a {
            display: block;
        }
        </style>
    {% endif %}

    <style>
        .select2-selection__arrow {
            display: none;
        }

        .select2-selection__rendered {
            cursor: text;
            overflow: initial !important
        }

        .select2-results__option--highlighted {
            background-color: #DEDEDE !important;
        }

        .select2-results__option {
            white-space: nowrap;
        }

        #search-contest, #search-contest + .select2 {
            margin-top: 0.5em;
        }

        #search-contest {
            width: 200px;
            height: 2.3em;
        }
    </style>
{% endblock %}

{% block users_js_media %}
    {% if can_edit %}
        <script type="text/javascript">
            $(function () {
                $('a.disqualify-participation').click(function (e) {
                    e.preventDefault();
                    if (e.ctrlKey || e.metaKey || confirm("{{ _('Are you sure you want to disqualify this participation?') }}"))
                        $(this).closest('form').submit();
                })
                $('a.un-disqualify-participation').click(function (e) {
                    e.preventDefault();
                    if (e.ctrlKey || e.metaKey || confirm("{{ _('Are you sure you want to un-disqualify this participation?') }}"))
                        $(this).closest('form').submit();
                })
            });
        </script>
    {% endif %}
    {% if not contest.ended %}
        <script type="text/javascript">
            $(function () {
                window.install_tooltips = function () {
                    $('td.user-name').find('> span:first-child').each(function () {
                        var link = $(this);
                        link.mouseenter(function (e) {
                            var start_time = link.siblings('.start-time').text().trim();
                            link.addClass('tooltipped tooltipped-e').attr('aria-label', start_time);
                        }).mouseleave(function (e) {
                            link.removeClass('tooltipped tooltipped-e').removeAttr('aria-label');
                        });
                    });
                };

                install_tooltips();
            });
        </script>
    {% endif %}
    <script type="text/javascript">
        $(function () {
            var url = '{{ url('contest_participation', contest.key, '__username__') }}';
            var placeholder = $('#search-contest').replaceWith($('<select>').attr({
                id: 'search-contest'
            })).attr('placeholder');

            $('#search-contest').select2({
                placeholder: placeholder,
                ajax: {
                    url: '{{ url('contest_user_search_select2_ajax', contest.key) }}'
                },
                minimumInputLength: 1,
                templateResult: function (data) {
                    return $('<span>')
                        .append($('<img>', {
                            class: 'user-search-image',
                            src: data.gravatar_url,
                            width: 24,
                            height: 24,
                        }))
                        .append($('<span>', {
                            class: data.display_rank + ' user-search-name',
                        }).text(data.text));
                }
            }).on('change', function () {
                window.location.href = url.replace('__username__', $(this).val());
            });

            $('#show-organizations-checkbox').click(function () {
                $('.organization-column').toggle();
                localStorage.setItem('show-organizations', $('.organization-column').is(':visible') ? 'true' : 'false');
            });
            
            if (localStorage.getItem('show-organizations') == 'true') {
                $('.organization-column').show();
                $('#show-organizations-checkbox').prop('checked', true);
            }
        });
    </script>
    {% include "contest/media-js.html" %}
{% endblock %}

{% block before_users_table %}
    <div style="margin-bottom: 0.5em">
        {% if tab == 'participation' %}
            {% if contest.can_see_full_scoreboard(request.user) %}
                <input id="search-contest" type="text" placeholder="{{ _('View user participation') }}">
            {% endif %}
        {% endif %}
        <input id="show-organizations-checkbox" type="checkbox" style="vertical-align: bottom">
        <label for="show-organizations-checkbox" style="vertical-align: bottom">{{ _('Show organizations') }}</label>
    </div>
{% endblock %}

{% block users_table %}
    {% include "contest/ranking-table.html" %}
{% endblock %}

{'fraction_non_alphanumeric': 0.14207940512548134, 'fraction_numerical': 0.008498207409374585, 'mean_word_length': 1.3306514002785084, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 48, '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': '2951466', 'n_tokens_mistral': 4374, 'n_tokens_neox': 4025, 'n_words': 760}