<commit_before>{% extends "tabs-base.html" %}

{% block tabs %}
    {{ make_tab('detail', 'fa-info-circle', url('contest_view', contest.key), _('Info')) }}

    {% if contest.start_time <= now or perms.judge.see_private_contest %}
        {% if contest.show_scoreboard or perms.judge.see_private_contest or in_contest %}
            {{ make_tab('ranking', 'fa-bar-chart', url('contest_ranking', contest.key), _('Rankings')) }}
        {% else %}
            {{ make_tab('ranking', 'fa-bar-chart', None, _('Hidden Rankings')) }}
        {% endif %}
        {% if contest.show_scoreboard and request.user.is_authenticated %}
            {{ make_tab('participation', 'fa-users', url('contest_participation_own', contest.key), _('Participation')) }}
        {% endif %}
    {% endif %}
    {% if perms.judge.change_contest %}
        {{ make_tab('edit', 'fa-edit', url('admin:judge_contest_change', contest.id), _('Edit')) }}
    {% endif %}

    {% if request.user.is_authenticated %}
        {% if contest.can_join or participating or is_organizer %}
            {% if contest.ended %}
                {% if in_contest %}
                    {# They're in the contest because they're participating virtually #}
                    <form action="{{ url('contest_leave', contest.key) }}" method="post"
                          class="contest-join-pseudotab unselectable button full">
                        {% csrf_token %}
                        <input type="submit" class="leaving-forever" value="{{ _('Leave contest') }}">
                    </form>
                {% else %}
                    {# They're in the contest because they're participating virtually #}
                    <form action="{{ url('contest_join', contest.key) }}" method="post"
                          class="contest-join-pseudotab unselectable button full">
                        {% csrf_token %}
                        <input type="submit" value="{{ _('Virtual join') }}">
                    </form>
                {% endif %}
            {% else %}
                {% if in_contest %}
                    {# Allow people with ended participations to continue spectating #}
                    <form action="{{ url('contest_leave', contest.key) }}" method="post"
                          class="contest-join-pseudotab unselectable button full">
                        {% csrf_token %}
                        <input type="submit" value="
                            {%- if participating and participation.ended or request.user.profile in contest.organizers.all() %}
                                {{- _('Stop spectating') -}}
                            {% else %}
                                {{- _('Leave contest') -}}
                            {% endif %}">
                    </form>
                {% elif participating and participation.ended or is_organizer %}
                    <form action="{{ url('contest_join', contest.key) }}" method="post"
                          class="contest-join-pseudotab unselectable button full">
                        {% csrf_token %}
                        <input type="submit" value="{{ _('Spectate contest') }}">
                    </form>
                {% elif participating %}
                    <form action="{{ url('contest_join', contest.key) }}" method="post"
                          class="contest-join-pseudotab unselectable button full">
                        {% csrf_token %}
                        <input type="submit" value="{{ _('Join contest') }}">
                    </form>
                {% else %}
                    <form action="{{ url('contest_join', contest.key) }}" method="post"
                          class="contest-join-pseudotab unselectable button full">
                        {% csrf_token %}
                        <input type="submit" class="first-join" value="{{ _('Join contest') }}">
                    </form>
                {% endif %}
            {% endif %}
        {% endif %}
    {% elif contest.can_join %}
        <form action="{{ url('auth_login') }}" method="get"
              class="contest-join-pseudotab unselectable button full">
            <input type="hidden" name="next" value="{{ LOGIN_RETURN_PATH|urlencode }}">
            <input type="submit" value="{{ _('Login to participate') }}">
        </form>
    {% endif %}
{% endblock %}
<commit_msg>Allow contest organizers to see hidden scoreboard<commit_after>{% extends "tabs-base.html" %}

{% block tabs %}
    {{ make_tab('detail', 'fa-info-circle', url('contest_view', contest.key), _('Info')) }}

    {% if contest.start_time <= now or perms.judge.see_private_contest %}
        {% if contest.show_scoreboard or contest.can_see_scoreboard(request) %}
            {{ make_tab('ranking', 'fa-bar-chart', url('contest_ranking', contest.key), _('Rankings')) }}
        {% else %}
            {{ make_tab('ranking', 'fa-bar-chart', None, _('Hidden Rankings')) }}
        {% endif %}
        {% if contest.show_scoreboard and request.user.is_authenticated %}
            {{ make_tab('participation', 'fa-users', url('contest_participation_own', contest.key), _('Participation')) }}
        {% endif %}
    {% endif %}
    {% if perms.judge.change_contest %}
        {{ make_tab('edit', 'fa-edit', url('admin:judge_contest_change', contest.id), _('Edit')) }}
    {% endif %}

    {% if request.user.is_authenticated %}
        {% if contest.can_join or participating or is_organizer %}
            {% if contest.ended %}
                {% if in_contest %}
                    {# They're in the contest because they're participating virtually #}
                    <form action="{{ url('contest_leave', contest.key) }}" method="post"
                          class="contest-join-pseudotab unselectable button full">
                        {% csrf_token %}
                        <input type="submit" class="leaving-forever" value="{{ _('Leave contest') }}">
                    </form>
                {% else %}
                    {# They're in the contest because they're participating virtually #}
                    <form action="{{ url('contest_join', contest.key) }}" method="post"
                          class="contest-join-pseudotab unselectable button full">
                        {% csrf_token %}
                        <input type="submit" value="{{ _('Virtual join') }}">
                    </form>
                {% endif %}
            {% else %}
                {% if in_contest %}
                    {# Allow people with ended participations to continue spectating #}
                    <form action="{{ url('contest_leave', contest.key) }}" method="post"
                          class="contest-join-pseudotab unselectable button full">
                        {% csrf_token %}
                        <input type="submit" value="
                            {%- if participating and participation.ended or request.user.profile in contest.organizers.all() %}
                                {{- _('Stop spectating') -}}
                            {% else %}
                                {{- _('Leave contest') -}}
                            {% endif %}">
                    </form>
                {% elif participating and participation.ended or is_organizer %}
                    <form action="{{ url('contest_join', contest.key) }}" method="post"
                          class="contest-join-pseudotab unselectable button full">
                        {% csrf_token %}
                        <input type="submit" value="{{ _('Spectate contest') }}">
                    </form>
                {% elif participating %}
                    <form action="{{ url('contest_join', contest.key) }}" method="post"
                          class="contest-join-pseudotab unselectable button full">
                        {% csrf_token %}
                        <input type="submit" value="{{ _('Join contest') }}">
                    </form>
                {% else %}
                    <form action="{{ url('contest_join', contest.key) }}" method="post"
                          class="contest-join-pseudotab unselectable button full">
                        {% csrf_token %}
                        <input type="submit" class="first-join" value="{{ _('Join contest') }}">
                    </form>
                {% endif %}
            {% endif %}
        {% endif %}
    {% elif contest.can_join %}
        <form action="{{ url('auth_login') }}" method="get"
              class="contest-join-pseudotab unselectable button full">
            <input type="hidden" name="next" value="{{ LOGIN_RETURN_PATH|urlencode }}">
            <input type="submit" value="{{ _('Login to participate') }}">
        </form>
    {% endif %}
{% endblock %}

{'fraction_non_alphanumeric': 0.1471461187214612, 'fraction_numerical': 0.0, 'mean_word_length': 1.6325120192307692, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '230765', 'n_tokens_mistral': 2423, 'n_tokens_neox': 2140, 'n_words': 482}